Compare commits
79 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
1620d78e73 | ||
|
fc54d62111 | ||
|
f5422a70b6 | ||
|
e3b3c1ef82 | ||
|
bba871df2f | ||
|
5bbad3147c | ||
|
2bac7cf414 | ||
|
b7c76fda31 | ||
|
d5a76e899d | ||
|
dd05bf0d96 | ||
|
95e68c4ae8 | ||
|
d299d0e72d | ||
|
6fddb31c4c | ||
|
53b043d4ef | ||
|
7b51f050d7 | ||
|
7730dc3e5c | ||
|
0740e84d63 | ||
|
c917888262 | ||
|
0b54e7f5ae | ||
|
8cac6088c6 | ||
|
1548f4c24f | ||
|
b9f426ae1e | ||
|
52b0ad649c | ||
|
c9d0f210bc | ||
|
7aaef16266 | ||
|
28874a9f33 | ||
|
319ff649ab | ||
|
92f6d6ec02 | ||
|
9fdc276260 | ||
|
9113f3387a | ||
|
0bd453b527 | ||
|
b697e1bff3 | ||
|
833ec84921 | ||
|
53ad7375c7 | ||
|
5fd400faa9 | ||
|
f2a0b0ee20 | ||
|
18525aa17b | ||
|
ac3d9ab761 | ||
|
2fc727c154 | ||
|
d76cc09ed6 | ||
|
2c0323bc98 | ||
|
7fbe6c3594 | ||
|
55f3cd37af | ||
|
d0f3c0576c | ||
|
7d9070c514 | ||
|
534cd9d45e | ||
|
2f5bb2506a | ||
|
3e2fd64279 | ||
|
5b4b471a4f | ||
|
b8217eeff4 | ||
|
dcc363390f | ||
|
62eed0e4a3 | ||
|
c8bdc75e1d | ||
|
39d3d92364 | ||
|
b669d115c2 | ||
|
7ff96877d2 | ||
|
c6cdd5422f | ||
|
d6ca4e555a | ||
|
d8aa018995 | ||
|
08dab374da | ||
|
dbd33782f2 | ||
|
1d703a476a | ||
|
f5a9758cea | ||
|
f07e2cdd9d | ||
|
f2c32b3ea4 | ||
|
92d47a55d4 | ||
|
41f3f01167 | ||
|
a8c4af5a45 | ||
|
858c09f370 | ||
|
179d64d33c | ||
|
eac4bab342 | ||
|
a8466df62d | ||
|
cb64a886e9 | ||
|
dbabfb082c | ||
|
607876187d | ||
|
7f3539aa76 | ||
|
4ad0bbd672 | ||
|
85172f4f85 | ||
|
b702c08825 |
1
.gitmodules
vendored
1
.gitmodules
vendored
@@ -4,6 +4,7 @@
|
|||||||
[submodule "lib/chibios-contrib"]
|
[submodule "lib/chibios-contrib"]
|
||||||
path = lib/chibios-contrib
|
path = lib/chibios-contrib
|
||||||
url = https://github.com/qmk/ChibiOS-Contrib
|
url = https://github.com/qmk/ChibiOS-Contrib
|
||||||
|
branch = k-type-fix
|
||||||
[submodule "lib/ugfx"]
|
[submodule "lib/ugfx"]
|
||||||
path = lib/ugfx
|
path = lib/ugfx
|
||||||
url = https://github.com/qmk/uGFX
|
url = https://github.com/qmk/uGFX
|
||||||
|
10
Makefile
10
Makefile
@@ -19,10 +19,12 @@ endif
|
|||||||
# Otherwise the [OK], [ERROR] and [WARN] messages won't be displayed correctly
|
# Otherwise the [OK], [ERROR] and [WARN] messages won't be displayed correctly
|
||||||
override SILENT := false
|
override SILENT := false
|
||||||
|
|
||||||
|
ifndef SUB_IS_SILENT
|
||||||
QMK_VERSION := $(shell git describe --abbrev=0 --tags 2>/dev/null)
|
QMK_VERSION := $(shell git describe --abbrev=0 --tags 2>/dev/null)
|
||||||
ifneq ($(QMK_VERSION),)
|
ifneq ($(QMK_VERSION),)
|
||||||
$(info QMK Firmware $(QMK_VERSION))
|
$(info QMK Firmware $(QMK_VERSION))
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
ON_ERROR := error_occurred=1
|
ON_ERROR := error_occurred=1
|
||||||
|
|
||||||
@@ -114,6 +116,14 @@ list-keyboards:
|
|||||||
echo $(KEYBOARDS)
|
echo $(KEYBOARDS)
|
||||||
exit 0
|
exit 0
|
||||||
|
|
||||||
|
define PRINT_KEYBOARD
|
||||||
|
$(info $(PRINTING_KEYBOARD))
|
||||||
|
endef
|
||||||
|
|
||||||
|
generate-keyboards-file:
|
||||||
|
$(foreach PRINTING_KEYBOARD,$(KEYBOARDS),$(eval $(call PRINT_KEYBOARD)))
|
||||||
|
exit 0
|
||||||
|
|
||||||
#Compatibility with the old make variables, anything you specify directly on the command line
|
#Compatibility with the old make variables, anything you specify directly on the command line
|
||||||
# always overrides the detected folders
|
# always overrides the detected folders
|
||||||
ifdef keyboard
|
ifdef keyboard
|
||||||
|
62
bootloader.mk
Normal file
62
bootloader.mk
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
# Copyright 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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
# If it's possible that multiple bootloaders can be used for one project,
|
||||||
|
# you can leave this unset, and the correct size will be selected
|
||||||
|
# automatically.
|
||||||
|
#
|
||||||
|
# Sets the bootloader defined in the keyboard's/keymap's rules.mk
|
||||||
|
# Current options:
|
||||||
|
# atmel-dfu
|
||||||
|
# lufa-dfu
|
||||||
|
# qmk-dfu
|
||||||
|
# halfkay
|
||||||
|
# caterina
|
||||||
|
# bootloadHID
|
||||||
|
#
|
||||||
|
# BOOTLOADER_SIZE can still be defined manually, but it's recommended
|
||||||
|
# you add any possible configuration to this list
|
||||||
|
|
||||||
|
ifeq ($(strip $(BOOTLOADER)), atmel-dfu)
|
||||||
|
OPT_DEFS += -DBOOTLOADER_ATMEL_DFU
|
||||||
|
OPT_DEFS += -DBOOTLOADER_DFU
|
||||||
|
BOOTLOADER_SIZE = 4096
|
||||||
|
endif
|
||||||
|
ifeq ($(strip $(BOOTLOADER)), lufa-dfu)
|
||||||
|
OPT_DEFS += -DBOOTLOADER_LUFA_DFU
|
||||||
|
OPT_DEFS += -DBOOTLOADER_DFU
|
||||||
|
BOOTLOADER_SIZE = 4096
|
||||||
|
endif
|
||||||
|
ifeq ($(strip $(BOOTLOADER)), qmk-dfu)
|
||||||
|
OPT_DEFS += -DBOOTLOADER_QMK_DFU
|
||||||
|
OPT_DEFS += -DBOOTLOADER_DFU
|
||||||
|
BOOTLOADER_SIZE = 4096
|
||||||
|
endif
|
||||||
|
ifeq ($(strip $(BOOTLOADER)), halfkay)
|
||||||
|
OPT_DEFS += -DBOOTLOADER_HALFKAY
|
||||||
|
BOOTLOADER_SIZE = 512
|
||||||
|
endif
|
||||||
|
ifeq ($(strip $(BOOTLOADER)), caterina)
|
||||||
|
OPT_DEFS += -DBOOTLOADER_CATERINA
|
||||||
|
BOOTLOADER_SIZE = 4096
|
||||||
|
endif
|
||||||
|
ifeq ($(strip $(BOOTLOADER)), bootloadHID)
|
||||||
|
OPT_DEFS += -DBOOTLOADER_BOOTLOADHID
|
||||||
|
BOOTLOADER_SIZE = 4096
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef BOOTLOADER_SIZE
|
||||||
|
OPT_DEFS += -DBOOTLOADER_SIZE=$(strip $(BOOTLOADER_SIZE))
|
||||||
|
endif
|
@@ -230,6 +230,7 @@ VPATH += $(USER_PATH)
|
|||||||
include common_features.mk
|
include common_features.mk
|
||||||
include $(TMK_PATH)/protocol.mk
|
include $(TMK_PATH)/protocol.mk
|
||||||
include $(TMK_PATH)/common.mk
|
include $(TMK_PATH)/common.mk
|
||||||
|
include bootloader.mk
|
||||||
|
|
||||||
SRC += $(TMK_COMMON_SRC)
|
SRC += $(TMK_COMMON_SRC)
|
||||||
OPT_DEFS += $(TMK_COMMON_DEFS)
|
OPT_DEFS += $(TMK_COMMON_DEFS)
|
||||||
@@ -266,10 +267,10 @@ $(KEYBOARD_OUTPUT)_INC := $(PROJECT_INC) $(GFXINC)
|
|||||||
$(KEYBOARD_OUTPUT)_CONFIG := $(PROJECT_CONFIG)
|
$(KEYBOARD_OUTPUT)_CONFIG := $(PROJECT_CONFIG)
|
||||||
|
|
||||||
# Default target.
|
# Default target.
|
||||||
all: build sizeafter
|
all: build check-size
|
||||||
|
|
||||||
# Change the build target to build a HEX file or a library.
|
# Change the build target to build a HEX file or a library.
|
||||||
build: elf hex
|
build: elf cphex
|
||||||
#build: elf hex eep lss sym
|
#build: elf hex eep lss sym
|
||||||
#build: lib
|
#build: lib
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
* [Getting started](README.md)
|
* [Getting started](README.md)
|
||||||
* [QMK Introduction](getting_started_introduction.md)
|
* [QMK Introduction](getting_started_introduction.md)
|
||||||
* [Install Build Tools](getting_started_build_tools.md)
|
* [Install Build Tools](getting_started_build_tools.md)
|
||||||
* Alternative: [Vagrant Guide](getting_started_vagrant_guide.md)
|
* Alternative: [Vagrant Guide](getting_started_vagrant.md)
|
||||||
* [Build/Compile instructions](getting_started_make_guide.md)
|
* [Build/Compile instructions](getting_started_make_guide.md)
|
||||||
* [Flashing instructions](flashing.md)
|
* [Flashing instructions](flashing.md)
|
||||||
* [Contributing to QMK](contributing.md)
|
* [Contributing to QMK](contributing.md)
|
||||||
@@ -26,6 +26,7 @@
|
|||||||
* [Backlight](feature_backlight.md)
|
* [Backlight](feature_backlight.md)
|
||||||
* [Bootmagic](feature_bootmagic.md)
|
* [Bootmagic](feature_bootmagic.md)
|
||||||
* [Dynamic Macros](feature_dynamic_macros.md)
|
* [Dynamic Macros](feature_dynamic_macros.md)
|
||||||
|
* [Grave Escape](feature_grave_escape.md)
|
||||||
* [Key Lock](feature_key_lock.md)
|
* [Key Lock](feature_key_lock.md)
|
||||||
* [Layouts](feature_layouts.md)
|
* [Layouts](feature_layouts.md)
|
||||||
* [Leader Key](feature_leader_key.md)
|
* [Leader Key](feature_leader_key.md)
|
||||||
@@ -70,7 +71,6 @@
|
|||||||
* For Makers and Modders
|
* For Makers and Modders
|
||||||
* [Hand Wiring Guide](hand_wire.md)
|
* [Hand Wiring Guide](hand_wire.md)
|
||||||
* [ISP flashing guide](isp_flashing_guide.md)
|
* [ISP flashing guide](isp_flashing_guide.md)
|
||||||
* [Modding your keyboard](modding_your_keyboard.md)
|
|
||||||
|
|
||||||
* For a Deeper Understanding
|
* For a Deeper Understanding
|
||||||
* [How Keyboards Work](how_keyboards_work.md)
|
* [How Keyboards Work](how_keyboards_work.md)
|
||||||
|
@@ -27,7 +27,9 @@ This level contains all of the options for that particular keymap. If you wish t
|
|||||||
|
|
||||||
# The `config.h` file
|
# The `config.h` file
|
||||||
|
|
||||||
This is a C header file that is one of the first things included, and will persist over the whole project (if included). Lots of variables can be set here and accessed elsewhere.
|
This is a C header file that is one of the first things included, and will persist over the whole project (if included). Lots of variables can be set here and accessed elsewhere. The `config.h` file shouldn't be including other `config.h` files, or anything besides this:
|
||||||
|
|
||||||
|
#include "config_common.h"
|
||||||
|
|
||||||
## `config.h` Options
|
## `config.h` Options
|
||||||
|
|
||||||
@@ -123,6 +125,15 @@ If you define these options you will enable the associated feature, which may in
|
|||||||
* how many taps before oneshot toggle is triggered
|
* how many taps before oneshot toggle is triggered
|
||||||
* `#define IGNORE_MOD_TAP_INTERRUPT`
|
* `#define IGNORE_MOD_TAP_INTERRUPT`
|
||||||
* makes it possible to do rolling combos (zx) with keys that convert to other keys on hold
|
* makes it possible to do rolling combos (zx) with keys that convert to other keys on hold
|
||||||
|
* `#define QMK_KEYS_PER_SCAN 4`
|
||||||
|
* Allows sending more than one key per scan. By default, only one key event gets
|
||||||
|
sent via `process_record()` per scan. This has little impact on most typing, but
|
||||||
|
if you're doing a lot of chords, or your scan rate is slow to begin with, you can
|
||||||
|
have some delay in processing key events. Each press and release is a separate
|
||||||
|
event. For a keyboard with 1ms or so scan times, even a very fast typist isn't
|
||||||
|
going to produce the 500 keystrokes a second needed to actually get more than a
|
||||||
|
few ms of delay from this. But if you're doing chording on something with 3-4ms
|
||||||
|
scan times? You probably want this.
|
||||||
|
|
||||||
### RGB Light Configuration
|
### RGB Light Configuration
|
||||||
|
|
||||||
@@ -170,7 +181,13 @@ This is a [make](https://www.gnu.org/software/make/manual/make.html) file that i
|
|||||||
* `ARCH = AVR8`
|
* `ARCH = AVR8`
|
||||||
* `F_USB = $(F_CPU)`
|
* `F_USB = $(F_CPU)`
|
||||||
* `OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT`
|
* `OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT`
|
||||||
* `OPT_DEFS += -DBOOTLOADER_SIZE=4096`
|
* `BOOTLOADER = atmel-dfu` with the following options:
|
||||||
|
* `atmel-dfu`
|
||||||
|
* `lufa-dfu`
|
||||||
|
* `qmk-dfu`
|
||||||
|
* `halfkay`
|
||||||
|
* `caterina`
|
||||||
|
* `bootloadHID`
|
||||||
|
|
||||||
### Feature Options
|
### Feature Options
|
||||||
|
|
||||||
|
@@ -122,7 +122,7 @@ We also ask that you follow these guidelines:
|
|||||||
|
|
||||||
## Quantum/TMK Core
|
## Quantum/TMK Core
|
||||||
|
|
||||||
Before you put a lot of work into building your new feature you should make sure you are implementing it in the best way. You can get a basic understanding of QMK by reading [Understaning QMK](understanding_qmk.html), which will take you on a tour of the QMK program flow. From here you should talk to us to get a sense of the best way to implement your idea. There are two main ways to do this:
|
Before you put a lot of work into building your new feature you should make sure you are implementing it in the best way. You can get a basic understanding of QMK by reading [Understaning QMK](understanding_qmk.md), which will take you on a tour of the QMK program flow. From here you should talk to us to get a sense of the best way to implement your idea. There are two main ways to do this:
|
||||||
|
|
||||||
* [Chat on Gitter](https://gitter.im/qmk/qmk_firmware)
|
* [Chat on Gitter](https://gitter.im/qmk/qmk_firmware)
|
||||||
* [Open an Issue](https://github.com/qmk/qmk_firmware/issues/new)
|
* [Open an Issue](https://github.com/qmk/qmk_firmware/issues/new)
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
For a lot of people a custom keyboard is about more than sending button presses to your computer. You want to be able to do things that are more complex than simple button presses and macros. QMK has hooks that allow you to inject code, override functionality, and otherwise customize how your keyboard behaves in different situations.
|
For a lot of people a custom keyboard is about more than sending button presses to your computer. You want to be able to do things that are more complex than simple button presses and macros. QMK has hooks that allow you to inject code, override functionality, and otherwise customize how your keyboard behaves in different situations.
|
||||||
|
|
||||||
This page does not assume any special knowledge about QMK, but reading [Understanding QMK](understanding_qmk.html) will help you understand what is going on at a more fundamental level.
|
This page does not assume any special knowledge about QMK, but reading [Understanding QMK](understanding_qmk.md) will help you understand what is going on at a more fundamental level.
|
||||||
|
|
||||||
## A Word on Core vs Keyboards vs Keymap
|
## A Word on Core vs Keyboards vs Keymap
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
# Frequently Asked Build Questions
|
# Frequently Asked Build Questions
|
||||||
|
|
||||||
This page covers questions about building QMK. If you have not yet you should read the [Build Environment Setup](getting_started_build_tools.md) and [Make Instructions](make_instructions.md) guides.
|
This page covers questions about building QMK. If you have not yet you should read the [Build Environment Setup](getting_started_build_tools.md) and [Make Instructions](getting_started_make_guide.md) guides.
|
||||||
|
|
||||||
## Can't program on Linux
|
## Can't program on Linux
|
||||||
You will need proper permission to operate a device. For Linux users see udev rules below. Easy way is to use `sudo` command, if you are not familiar with this command check its manual with `man sudo` or this page on line.
|
You will need proper permission to operate a device. For Linux users see udev rules below. Easy way is to use `sudo` command, if you are not familiar with this command check its manual with `man sudo` or this page on line.
|
||||||
|
@@ -125,11 +125,9 @@ https://github.com/tmk/tmk_keyboard/issues/213
|
|||||||
https://github.com/tekezo/Karabiner/issues/403
|
https://github.com/tekezo/Karabiner/issues/403
|
||||||
|
|
||||||
|
|
||||||
## Esc and `~ on a key
|
## Esc and `~ on a single key
|
||||||
|
|
||||||
Use `GRAVE_ESC` or `KC_GESC` in your keymap. `GUI`+`GRAVE_ESC` results in `` ` `` and `SHIFT`+`GRAVE_ESC` results in `~`.
|
See the [Grave Escape](feature_grave_escape.md) feature.
|
||||||
|
|
||||||
Note that this will break the CTRL+SHIFT+ESC shortcut to the Windows task manager. Use `#define GRAVE_ESC_CTRL_OVERRIDE` in your `config.h` to get the shortcut back. With this option, `ESC_GRAVE` results in `ESC` if `CTRL` is held, even if `SHIFT` or `GUI` are also held.
|
|
||||||
|
|
||||||
## Arrow on Right Modifier keys with Dual-Role
|
## Arrow on Right Modifier keys with Dual-Role
|
||||||
This turns right modifer keys into arrow keys when the keys are tapped while still modifiers when the keys are hold. In TMK the dual-role function is dubbed **TAP**.
|
This turns right modifer keys into arrow keys when the keys are tapped while still modifiers when the keys are hold. In TMK the dual-role function is dubbed **TAP**.
|
||||||
|
@@ -15,7 +15,7 @@ This will allow you to use `FN_CAPS` and `ALT_TAB` in your `KEYMAP()`, keeping i
|
|||||||
|
|
||||||
### Limits of these aliases
|
### Limits of these aliases
|
||||||
|
|
||||||
Currently, the keycodes able to used with these functions are limited to the [Basic Keycodes](keycodes_basic.html), meaning you can't use keycodes like `KC_TILD`, or anything greater than 0xFF. For a full list of the keycodes able to be used see [Basic Keycodes](keycodes_basic.html).
|
Currently, the keycodes able to used with these functions are limited to the [Basic Keycodes](keycodes_basic.md), meaning you can't use keycodes like `KC_TILD`, or anything greater than 0xFF. For a full list of the keycodes able to be used see [Basic Keycodes](keycodes_basic.md).
|
||||||
|
|
||||||
# Switching and toggling layers
|
# Switching and toggling layers
|
||||||
|
|
||||||
@@ -131,7 +131,7 @@ We've added shortcuts to make common modifier/tap (mod-tap) mappings more compac
|
|||||||
|
|
||||||
# One Shot Keys
|
# One Shot Keys
|
||||||
|
|
||||||
One shot keys are keys that remain active until the next key is pressed, and then are releasd. This allows you to type keyboard combinations without pressing more than one key at a time.
|
One shot keys are keys that remain active until the next key is pressed, and then are released. This allows you to type keyboard combinations without pressing more than one key at a time. These keys are usually called "Sticky keys" or "Dead keys".
|
||||||
|
|
||||||
For example, if you define a key as `OSM(MOD_LSFT)`, you can type a capital A character by first pressing and releasing shift, and then pressing and releasing A. Your computer will see the shift key being held the moment shift is pressed, and it will see the shift key being released immediately after A is released.
|
For example, if you define a key as `OSM(MOD_LSFT)`, you can type a capital A character by first pressing and releasing shift, and then pressing and releasing A. Your computer will see the shift key being held the moment shift is pressed, and it will see the shift key being released immediately after A is released.
|
||||||
|
|
||||||
|
17
docs/feature_grave_esc.md
Normal file
17
docs/feature_grave_esc.md
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
# Grave Escape
|
||||||
|
|
||||||
|
Grave Escape is a feature that allows you to share the grave key (`\`` and `~`) on the same key as Escape. When `KC_GESC` is used it will act as `KC_ESC`, unless Shift or GUI is pressed, in which case it will act as `KC_GRAVE`.
|
||||||
|
|
||||||
|
|
||||||
|
| Key | Alias | Description |
|
||||||
|
|-----|-------|-------------|
|
||||||
|
| `GRAVE_ESC` | `KC_GESC` | Act as `KC_ESC` normally, or `KC_GRAVE` when GUI or Shift are held. |
|
||||||
|
|
||||||
|
There are several possible key combinations this will break, among them Ctrl+Shift+Esc on Windows and Cmd+Opt+Esc on macOS. You can use these options in your `config.h` to work around this:
|
||||||
|
|
||||||
|
| Option | Description |
|
||||||
|
|--------|-------------|
|
||||||
|
| `GRAVE_ESC_ALT_OVERRIDE` | Always send Escape if Alt is pressed. |
|
||||||
|
| `GRAVE_ESC_CTRL_OVERRIDE` | Always send Escape if Ctrl is pressed. |
|
||||||
|
| `GRAVE_ESC_GUI_OVERRIDE` | Always send Escape if GUI is pressed. |
|
||||||
|
| `GRAVE_ESC_SHIFT_OVERRIDE` | Always send Escape if SHIFT is pressed. |
|
@@ -8,4 +8,4 @@ Here's how to use it:
|
|||||||
2. Enable key lock by including `KEY_LOCK_ENABLE = yes` in your Makefile.
|
2. Enable key lock by including `KEY_LOCK_ENABLE = yes` in your Makefile.
|
||||||
3. That's it!
|
3. That's it!
|
||||||
|
|
||||||
Important: switching layers does not cancel the key lock. Additionally, key lock is only able to hold standard action keys and One Shot modifier keys (for example, if you have your shift defined as `OSM(KC_LSFT)`; see [One Shot Keys](quantum_keycodes.md#one-shot-keys)). This does not include any of the QMK special functions (except One Shot modifiers), or shifted versions of keys such as KC_LPRN. If it's in the [basic_keycodes](basic_keycodes.md) list, it can be held. If it's not, then it can't be.
|
Important: switching layers does not cancel the key lock. Additionally, key lock is only able to hold standard action keys and One Shot modifier keys (for example, if you have your shift defined as `OSM(KC_LSFT)`; see [One Shot Keys](quantum_keycodes.md#one-shot-keys)). This does not include any of the QMK special functions (except One Shot modifiers), or shifted versions of keys such as KC_LPRN. If it's in the [Basic Keycodes](keycodes_basic.md) list, it can be held. If it's not, then it can't be.
|
||||||
|
@@ -55,10 +55,6 @@ Instead of using `#include "planck.h"`, you can use this line to include whateve
|
|||||||
|
|
||||||
#include QMK_KEYBOARD_H
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
In your config.h, you can also use this variable to include the keyboard's `config.h`:
|
|
||||||
|
|
||||||
#include QMK_KEYBOARD_CONFIG_H
|
|
||||||
|
|
||||||
If you want to keep some keyboard-specific code, you can use these variables to escape it with an `#ifdef` statement:
|
If you want to keep some keyboard-specific code, you can use these variables to escape it with an `#ifdef` statement:
|
||||||
|
|
||||||
* `KEYBOARD_<folder1>_<folder2>`
|
* `KEYBOARD_<folder1>_<folder2>`
|
||||||
@@ -73,4 +69,4 @@ For example:
|
|||||||
#endif
|
#endif
|
||||||
```
|
```
|
||||||
|
|
||||||
Note that the names are lowercase and match the folder/file names for the keyboard/revision exactly.
|
Note that the names are lowercase and match the folder/file names for the keyboard/revision exactly.
|
||||||
|
@@ -8,34 +8,78 @@ Macros allow you to send multiple keystrokes when pressing just one key. QMK has
|
|||||||
|
|
||||||
## The new way: `SEND_STRING()` & `process_record_user`
|
## The new way: `SEND_STRING()` & `process_record_user`
|
||||||
|
|
||||||
Sometimes you just want a key to type out words or phrases. For the most common situations we've provided `SEND_STRING()`, which will type out your string for you. All ascii that is easily translated to a keycode is supported (eg `\n\t`).
|
Sometimes you just want a key to type out words or phrases. For the most common situations we've provided `SEND_STRING()`, which will type out your string (i.e. a sequence of characters) for you. All ASCII characters that are easily translated to a keycode are supported (e.g. `\n\t`).
|
||||||
|
|
||||||
For example:
|
Here is an example `keymap.c` for a two-key keyboard:
|
||||||
|
|
||||||
```c
|
```c
|
||||||
enum custom_keycodes {
|
enum custom_keycodes {
|
||||||
PRINT_TRUTH = SAFE_RANGE
|
MY_CUSTOM_MACRO = SAFE_RANGE
|
||||||
};
|
};
|
||||||
|
|
||||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
if (record->event.pressed) {
|
if (record->event.pressed) {
|
||||||
switch(keycode) {
|
switch(keycode) {
|
||||||
case PRINT_TRUTH:
|
case MY_CUSTOM_MACRO:
|
||||||
SEND_STRING("QMK is the best thing ever!");
|
SEND_STRING("QMK is the best thing ever!"); // this is our macro!
|
||||||
return false; break;
|
return false; break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
[0] = {
|
||||||
|
{MY_CUSTOM_MACRO, KC_ESC}
|
||||||
|
}
|
||||||
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
### Tap/down/up
|
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.
|
||||||
|
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.
|
||||||
|
You can do that by adding another keycode and adding another case to the switch statement, like so:
|
||||||
|
|
||||||
|
```c
|
||||||
|
enum custom_keycodes {
|
||||||
|
MY_CUSTOM_MACRO = SAFE_RANGE,
|
||||||
|
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; break;
|
||||||
|
case MY_OTHER_MACRO:
|
||||||
|
SEND_STRING(SS_LCTRL("ac")); // selects all and copies
|
||||||
|
return false; break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
[0] = {
|
||||||
|
{MY_CUSTOM_MACRO, MY_OTHER_MACRO}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
### TAP, DOWN and UP
|
||||||
|
|
||||||
|
You may want to use keys in your macros that you can't write down, such as `Ctrl` or `Home`.
|
||||||
You can send arbitary keycodes by wrapping them in:
|
You can send arbitary keycodes by wrapping them in:
|
||||||
|
|
||||||
* `SS_TAP()`
|
* `SS_TAP()` presses and releases a key.
|
||||||
* `SS_DOWN()`
|
* `SS_DOWN()` presses (but does not release) a key.
|
||||||
* `SS_UP()`
|
* `SS_UP()` releases a key.
|
||||||
|
|
||||||
For example:
|
For example:
|
||||||
|
|
||||||
@@ -52,12 +96,14 @@ There's also a couple of mod shortcuts you can use:
|
|||||||
* `SS_LCTRL(string)`
|
* `SS_LCTRL(string)`
|
||||||
* `SS_LGUI(string)`
|
* `SS_LGUI(string)`
|
||||||
* `SS_LALT(string)`
|
* `SS_LALT(string)`
|
||||||
|
* `SS_LSFT(string)`
|
||||||
|
|
||||||
That can be used like this:
|
These press the respective modifier, send the supplied string and then release the modifier.
|
||||||
|
They can be used like this:
|
||||||
|
|
||||||
SEND_STRING(SS_LCTRL("a"));
|
SEND_STRING(SS_LCTRL("a"));
|
||||||
|
|
||||||
Which would send LCTRL+a (LTRL down, a, LTRL up) - notice that they take strings (eg `"k"`), and not the `X_K` keycodes.
|
Which would send LCTRL+a (LCTRL down, a, LCTRL up) - notice that they take strings (eg `"k"`), and not the `X_K` keycodes.
|
||||||
|
|
||||||
### Alternative keymaps
|
### Alternative keymaps
|
||||||
|
|
||||||
|
@@ -87,8 +87,8 @@ These control the RGB Lighting functionality.
|
|||||||
| Long Name | Short Name | Description |
|
| Long Name | Short Name | Description |
|
||||||
|-----------|------------|-------------|
|
|-----------|------------|-------------|
|
||||||
||`RGB_TOG`|toggle on/off|
|
||`RGB_TOG`|toggle on/off|
|
||||||
||`RGB_MOD`|cycle through modes|
|
|`RGB_MODE_FORWARD`|`RGB_MOD`|cycle through modes, use reverse direction when shift is held|
|
||||||
||`RGB_SMOD`|cycle through modes, use reverse direction when shift is hold|
|
|`RGB_MODE_REVERSE`|`RGB_RMOD`|cycle through modes in reverse (also suppost shift to go forward)|
|
||||||
||`RGB_HUI`|hue increase|
|
||`RGB_HUI`|hue increase|
|
||||||
||`RGB_HUD`|hue decrease|
|
||`RGB_HUD`|hue decrease|
|
||||||
||`RGB_SAI`|saturation increase|
|
||`RGB_SAI`|saturation increase|
|
||||||
@@ -104,6 +104,8 @@ These control the RGB Lighting functionality.
|
|||||||
|`RGB_MODE_XMAS`|`RGB_M_X`| Switch to the Christmas animation |
|
|`RGB_MODE_XMAS`|`RGB_M_X`| Switch to the Christmas animation |
|
||||||
|`RGB_MODE_GRADIENT`|`RGB_M_G`| Switch to the static gradient mode |
|
|`RGB_MODE_GRADIENT`|`RGB_M_G`| Switch to the static gradient mode |
|
||||||
|
|
||||||
|
note: for backwards compatibility, `RGB_SMOD` is an alias for `RGB_MOD`.
|
||||||
|
|
||||||
## Hardware Modification
|
## Hardware Modification
|
||||||
|
|
||||||

|

|
||||||
|
@@ -73,8 +73,15 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|||||||
switch (keycode) {
|
switch (keycode) {
|
||||||
case KC_MAKE:
|
case KC_MAKE:
|
||||||
if (!record->event.pressed) {
|
if (!record->event.pressed) {
|
||||||
SEND_STRING("make " QMK_KEYBOARD ":" QMK_KEYMAP);
|
SEND_STRING("make " QMK_KEYBOARD ":" QMK_KEYMAP
|
||||||
SEND_STRING(SS_TAP(X_ENTER));
|
#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;
|
return false;
|
||||||
break;
|
break;
|
||||||
@@ -85,3 +92,5 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|||||||
|
|
||||||
This will add a new `KC_MAKE` keycode that can be used in any of your keymaps. And this keycode will output `make <keyboard>:<keymap">`, 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.
|
This will add a new `KC_MAKE` keycode that can be used in any of your keymaps. And this keycode will output `make <keyboard>:<keymap">`, 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).
|
||||||
|
|
||||||
|
@@ -17,7 +17,7 @@ QMK has a staggering number of features for building your keyboard. It can take
|
|||||||
* [Pointing Device](feature_pointing_device.md) - Framework for connecting your custom pointing device to your keyboard.
|
* [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 ps2 mouse directly to your keyboard.
|
* [PS2 Mouse](feature_ps2_mouse.md) - Driver for connecting a ps2 mouse directly to your keyboard.
|
||||||
* [RGB Light](feature_rgblight.md) - RGB lighting for your keyboard.
|
* [RGB Light](feature_rgblight.md) - RGB lighting for your keyboard.
|
||||||
* [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.
|
||||||
* [Stenography](feature_stenography.md) - Put your keyboard into Plover mode for stenography use.
|
* [Stenography](feature_stenography.md) - Put your keyboard into Plover mode for stenography use.
|
||||||
* [Tap Dance](feature_tap_dance.md) - Make a single key do as many things as you want.
|
* [Tap Dance](feature_tap_dance.md) - Make a single key do as many things as you want.
|
||||||
* [Terminal](feature_terminal.md) - CLI interface to the internals of your keyboard.
|
* [Terminal](feature_terminal.md) - CLI interface to the internals of your keyboard.
|
||||||
|
@@ -1,12 +1,20 @@
|
|||||||
# Flashing Intrustructions
|
# Flashing Intrustructions / Bootloader Information
|
||||||
|
|
||||||
There are quite a few different types of bootloaders that keyboards use, and just about all of the use a different flashing method. Luckily, projects like the [QMK Toolbox](https://github.com/qmk/qmk_toolbox/releases) aim to be compatible with all the different types without having to think about it much, but this article will describe the different types of bootloaders, and available methods for flashing them.
|
There are quite a few different types of bootloaders that keyboards use, and just about all of the use a different flashing method. Luckily, projects like the [QMK Toolbox](https://github.com/qmk/qmk_toolbox/releases) aim to be compatible with all the different types without having to think about it much, but this article will describe the different types of bootloaders, and available methods for flashing them.
|
||||||
|
|
||||||
|
If you have a bootloader selected with the `BOOTLOADER` variable in your `rules.mk`, QMK will automatically calculate if your .hex file is the right size to be flashed to the device, and output the total size it bytes (along with the max). To run this process manually, compile with the target `check-size`, eg `make planck/rev4:default:check-size`.
|
||||||
|
|
||||||
## DFU
|
## DFU
|
||||||
|
|
||||||
Atmel's DFU bootloader comes on all atmega32u4 chips by default, and is used by many keyboards that have their own ICs on their PCBs (Older OLKB boards, Clueboards). Some keyboards may also use LUFA's DFU bootloader (or QMK's fork) (Newer OLKB boards) that adds in additional features specific to that hardware.
|
Atmel's DFU bootloader comes on all atmega32u4 chips by default, and is used by many keyboards that have their own ICs on their PCBs (Older OLKB boards, Clueboards). Some keyboards may also use LUFA's DFU bootloader (or QMK's fork) (Newer OLKB boards) that adds in additional features specific to that hardware.
|
||||||
|
|
||||||
These bootloaders are usually 4096 bytes for the atmega32u4 chip.
|
To ensure compatability with the DFU bootloader, make sure this block is present your `rules.mk` (optionally with `lufa-dfu` or `qmk-dfu` instead):
|
||||||
|
|
||||||
|
# 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
|
||||||
|
|
||||||
Compatible flashers:
|
Compatible flashers:
|
||||||
|
|
||||||
@@ -26,15 +34,32 @@ or:
|
|||||||
|
|
||||||
make <keyboard>:<keymap>:dfu
|
make <keyboard>:<keymap>:dfu
|
||||||
|
|
||||||
|
### QMK DFU
|
||||||
|
|
||||||
|
QMK has a fork of the LUFA DFU bootloader that allows for a simple matrix scan for exiting the bootloader and returning to the application, as well as flashing an LED/making a ticking noise with a speaker when things are happening. To enable these features, use this block in your `config.h` (The key that exits the bootloader needs to be hooked-up to the INPUT and OUTPUT defined here):
|
||||||
|
|
||||||
|
#define QMK_ESC_OUTPUT F1 // usually COL
|
||||||
|
#define QMK_ESC_INPUT D5 // usually ROW
|
||||||
|
#define QMK_LED E6
|
||||||
|
#define QMK_SPEAKER C6
|
||||||
|
|
||||||
|
The Manufacturer and Product names are automatically pulled from your `config.h`, and "Bootloader" is added to the product.
|
||||||
|
|
||||||
|
To generate this bootloader, use the `bootloader` target, eg `make planck/rev4:default:bootloader`.
|
||||||
|
|
||||||
|
To generate a production-ready .hex file (containing the application and the bootloader), use the `production` target, eg `make planck/rev4:default:production`.
|
||||||
|
|
||||||
## Caterina
|
## 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/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.
|
||||||
|
|
||||||
This block of code allows for Caterina compatibility in QMK:
|
To ensure compatability with the Caterina bootloader, make sure this block is present your `rules.mk`:
|
||||||
|
|
||||||
#define CATERINA_BOOTLOADER
|
# Bootloader
|
||||||
|
# This definition is optional, and if your keyboard supports multiple bootloaders of
|
||||||
These bootloaders are usually 4096 bytes for the atmega32u4 chip.
|
# different sizes, comment this out, and the correct address will be loaded
|
||||||
|
# automatically (+60). See bootloader.mk for all options.
|
||||||
|
BOOTLOADER = caterina
|
||||||
|
|
||||||
Compatible flashers:
|
Compatible flashers:
|
||||||
|
|
||||||
@@ -57,7 +82,13 @@ or
|
|||||||
|
|
||||||
Halfkay is a super-slim protocol developed by PJRC that uses HID, and come on all Teensys (namely the 2.0).
|
Halfkay is a super-slim protocol developed by PJRC that uses HID, and come on all Teensys (namely the 2.0).
|
||||||
|
|
||||||
This bootloader is 512 bytes.
|
To ensure compatability with the Halfkay bootloader, make sure this block is present 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 = halfkay
|
||||||
|
|
||||||
Compatible flashers:
|
Compatible flashers:
|
||||||
|
|
||||||
|
@@ -13,7 +13,7 @@ The full syntax of the `make` command is `<keyboard_folder>:<keymap>:<target>`,
|
|||||||
|
|
||||||
The `<target>` means the following
|
The `<target>` means the following
|
||||||
* If no target is given, then it's the same as `all` below
|
* If no target is given, then it's the same as `all` below
|
||||||
* `all` compiles as many keyboard/revision/keymap combinations as specified. For example, `make planck/rev4:default:all` will generate a single .hex, while `make planck/rev4:all` will generate a hex for every keymap available to the planck.
|
* `all` compiles as many keyboard/revision/keymap combinations as specified. For example, `make planck/rev4:default` will generate a single .hex, while `make planck/rev4:all` will generate a hex for every keymap available to the planck.
|
||||||
* `dfu`, `teensy` or `dfu-util`, compile and upload the firmware to the keyboard. If the compilation fails, then nothing will be uploaded. The programmer to use depends on the keyboard. For most keyboards it's `dfu`, but for ChibiOS keyboards you should use `dfu-util`, and `teensy` for standard Teensys. To find out which command you should use for your keyboard, check the keyboard specific readme.
|
* `dfu`, `teensy` or `dfu-util`, compile and upload the firmware to the keyboard. If the compilation fails, then nothing will be uploaded. The programmer to use depends on the keyboard. For most keyboards it's `dfu`, but for ChibiOS keyboards you should use `dfu-util`, and `teensy` for standard Teensys. To find out which command you should use for your keyboard, check the keyboard specific readme.
|
||||||
* **Note**: some operating systems need root access for these commands to work, so in that case you need to run for example `sudo make planck/rev4:default:dfu`.
|
* **Note**: some operating systems need root access for these commands to work, so in that case you need to run for example `sudo make planck/rev4:default:dfu`.
|
||||||
* `clean`, cleans the build output folders to make sure that everything is built from scratch. Run this before normal compilation if you have some unexplainable problems.
|
* `clean`, cleans the build output folders to make sure that everything is built from scratch. Run this before normal compilation if you have some unexplainable problems.
|
||||||
|
@@ -41,7 +41,7 @@ A macro which has been recorded on the keyboard and which will be lost when the
|
|||||||
## Eclipse
|
## Eclipse
|
||||||
An IDE that is popular with many C developers.
|
An IDE that is popular with many C developers.
|
||||||
|
|
||||||
* [Eclipse Setup Instructions](eclipse.html)
|
* [Eclipse Setup Instructions](eclipse.md)
|
||||||
|
|
||||||
## Firmware
|
## Firmware
|
||||||
The software that controls your MCU.
|
The software that controls your MCU.
|
||||||
@@ -62,7 +62,7 @@ In-system programming, a method of programming an AVR chip using external hardwa
|
|||||||
An interface for receiving debugging messages from your keyboard. You can view these messages using [QMK Flasher](https://github.com/qmk/qmk_flasher) or [PJRC's hid_listen](https://www.pjrc.com/teensy/hid_listen.html)
|
An interface for receiving debugging messages from your keyboard. You can view these messages using [QMK Flasher](https://github.com/qmk/qmk_flasher) or [PJRC's hid_listen](https://www.pjrc.com/teensy/hid_listen.html)
|
||||||
|
|
||||||
## Keycode
|
## Keycode
|
||||||
A 2-byte number that represents a particular key. `0x00`-`0xFF` are used for [Basic Keycodes](keycodes_basic.html) while `0x100`-`0xFFFF` are used for [Quantum Keycodes](quantum_keycodes.html).
|
A 2-byte number that represents a particular key. `0x00`-`0xFF` are used for [Basic Keycodes](keycodes_basic.md) while `0x100`-`0xFFFF` are used for [Quantum Keycodes](quantum_keycodes.md).
|
||||||
|
|
||||||
## Key Down
|
## Key Down
|
||||||
An event that happens when a key is pressed down, but is completed before a key is released.
|
An event that happens when a key is pressed down, but is completed before a key is released.
|
||||||
@@ -79,7 +79,7 @@ An abstraction used to allow a key to serve multiple purposes. The highest activ
|
|||||||
## Leader Key
|
## Leader Key
|
||||||
A feature that allows you to tap the leader key followed by a sequence of 1, 2, or 3 keys to activate key presses or other quantum features.
|
A feature that allows you to tap the leader key followed by a sequence of 1, 2, or 3 keys to activate key presses or other quantum features.
|
||||||
|
|
||||||
* [Leader Key Documentation](feature_leader_key.html)
|
* [Leader Key Documentation](feature_leader_key.md)
|
||||||
|
|
||||||
## LED
|
## LED
|
||||||
Light Emitting Diode, the most common device used for indicators on a keyboard.
|
Light Emitting Diode, the most common device used for indicators on a keyboard.
|
||||||
@@ -104,13 +104,13 @@ A key that is held down while typing another key to modify the action of that ke
|
|||||||
## Mousekeys
|
## Mousekeys
|
||||||
A feature that lets you control your mouse cursor and click from your keyboard.
|
A feature that lets you control your mouse cursor and click from your keyboard.
|
||||||
|
|
||||||
* [Mousekeys Documentation](feature_mouse_keys.html)
|
* [Mousekeys Documentation](feature_mouse_keys.md)
|
||||||
|
|
||||||
## N-Key Rollover (NKRO)
|
## N-Key Rollover (NKRO)
|
||||||
A term that applies to keyboards that are capable of reporting any number of key-presses at once.
|
A term that applies to keyboards that are capable of reporting any number of key-presses at once.
|
||||||
|
|
||||||
## Oneshot Modifier
|
## Oneshot Modifier
|
||||||
A modifier that acts as if it is held down until another key is released, so you can press the mod and then press the key, rather than holding the mod while pressing the key.
|
A modifier that acts as if it is held down until another key is released, so you can press the mod and then press the key, rather than holding the mod while pressing the key. Also known as a Sticky key or a Dead key.
|
||||||
|
|
||||||
## ProMicro
|
## ProMicro
|
||||||
A low cost AVR development board. Clones of this device are often found on ebay very inexpensively (under $5) but people often struggle with flashing their pro micros.
|
A low cost AVR development board. Clones of this device are often found on ebay very inexpensively (under $5) but people often struggle with flashing their pro micros.
|
||||||
@@ -133,7 +133,7 @@ A 1 byte number that is sent as part of a HID report over USB that represents a
|
|||||||
## Space Cadet Shift
|
## Space Cadet Shift
|
||||||
A special set of shift keys which allow you to type various types of braces by tapping the left or right shift one or more times.
|
A special set of shift keys which allow you to type various types of braces by tapping the left or right shift one or more times.
|
||||||
|
|
||||||
* [Space Cadet Shift Documentation](feature_space_cadet.html)
|
* [Space Cadet Shift Documentation](feature_space_cadet.md)
|
||||||
|
|
||||||
## Tap
|
## Tap
|
||||||
Pressing and releasing a key. In some situations you will need to distinguish between a key down and a key up event, and Tap always refers to both at once.
|
Pressing and releasing a key. In some situations you will need to distinguish between a key down and a key up event, and Tap always refers to both at once.
|
||||||
|
@@ -77,7 +77,7 @@ Key with `KC_TRANS` (`KC_TRNS` and `_______` are the alias) doesn't has its own
|
|||||||
|
|
||||||
## Anatomy Of A `keymap.c`
|
## Anatomy Of A `keymap.c`
|
||||||
|
|
||||||
For this example we will walk through the [default Clueboard 66% keymap](https://github.com/qmk/qmk_firmware/blob/master/keyboards/clueboard_66/keymaps/default/keymap.c). You'll find it helpful to open that file in another browser window so you can look at everything in context.
|
For this example we will walk through an [older version of the default Clueboard 66% keymap](https://github.com/qmk/qmk_firmware/blob/ca01d94005f67ec4fa9528353481faa622d949ae/keyboards/clueboard/keymaps/default/keymap.c). You'll find it helpful to open that file in another browser window so you can look at everything in context.
|
||||||
|
|
||||||
There are 3 main sections of a `keymap.c` file you'll want to concern yourself with:
|
There are 3 main sections of a `keymap.c` file you'll want to concern yourself with:
|
||||||
|
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
This document attempts to explain how the QMK firmware works from a very high level. It assumes you understand basic programming concepts but does not (except where needed to demonstrate) assume familiarity with C. It assumes that you have a basic understanding of the following documents:
|
This document attempts to explain how the QMK firmware works from a very high level. It assumes you understand basic programming concepts but does not (except where needed to demonstrate) assume familiarity with C. It assumes that you have a basic understanding of the following documents:
|
||||||
|
|
||||||
* [QMK Overview](qmk_overview.md)
|
* [Introduction](getting_started_introduction.md)
|
||||||
* [How Keyboards Work](how_keyboards_work.md)
|
* [How Keyboards Work](how_keyboards_work.md)
|
||||||
* [FAQ](faq.md)
|
* [FAQ](faq.md)
|
||||||
|
|
||||||
|
10
keyboards/atreus/keymaps/khitsule/config.h
Normal file
10
keyboards/atreus/keymaps/khitsule/config.h
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
#ifndef CONFIG_USER_H
|
||||||
|
#define CONFIG_USER_H
|
||||||
|
|
||||||
|
#include "../../config.h"
|
||||||
|
|
||||||
|
#define PREVENT_STUCK_MODIFIERS
|
||||||
|
|
||||||
|
#define IGNORE_MOD_TAP_INTERRUPT
|
||||||
|
|
||||||
|
#endif
|
64
keyboards/atreus/keymaps/khitsule/keymap.c
Normal file
64
keyboards/atreus/keymaps/khitsule/keymap.c
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
// Personal keymap of khitsule
|
||||||
|
|
||||||
|
#include "atreus.h"
|
||||||
|
|
||||||
|
#define ALPH 0
|
||||||
|
#define LOWR 1
|
||||||
|
#define RAIS 2
|
||||||
|
|
||||||
|
// enum layers {
|
||||||
|
// ALPH, //alpha qwerty
|
||||||
|
// LOWR, //layer 1: nav and functions
|
||||||
|
// RAIS //layer 2: numpad and symbols
|
||||||
|
// };
|
||||||
|
|
||||||
|
// define any macros here to keep keymap clean and readable
|
||||||
|
|
||||||
|
#define KM_DLEFT LGUI(LCTL(KC_LEFT))
|
||||||
|
#define KM_DRIGHT LGUI(LCTL(KC_RIGHT))
|
||||||
|
|
||||||
|
#define tap_mod_macro(record, mod, macro) ( ((record)->event.pressed) ? \
|
||||||
|
( ((record)->tap.count <= 0 || (record)->tap.interrupted) ? MACRO(D(mod), END) : MACRO_NONE ) : \
|
||||||
|
( ((record)->tap.count > 0 && !((record)->tap.interrupted)) ? (macro) : MACRO(U(mod), END) ) )
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
[ALPH] = {
|
||||||
|
{KC_Q, KC_W, KC_E, KC_R, KC_T, KC_TRNS, KC_Y, KC_U, KC_I, KC_O, KC_P},
|
||||||
|
{KC_A, KC_S, KC_D, KC_F, KC_G, KC_TRNS, KC_H, KC_J, KC_K, KC_L, KC_SCLN},
|
||||||
|
{KC_Z, KC_X, KC_C, KC_V, KC_B, CTL_T(KC_SPC), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH},
|
||||||
|
{KC_ESC, KC_TRNS, KC_TRNS, ALT_T(KC_ENT), LT(LOWR, KC_TAB), SFT_T(KC_BSPC), LT(RAIS, KC_DEL), KC_LGUI, KC_TRNS, KC_QUOT, KC_MINUS}
|
||||||
|
},
|
||||||
|
[LOWR] = {
|
||||||
|
{KC_PSCR, KC_HOME, KC_UP, KC_END, KC_TRNS, KC_TRNS, KC_LPRN, KC_F7, KC_F8, KC_F9, KC_RPRN},
|
||||||
|
{KC_VOLU, KC_LEFT, KC_DOWN, KC_RIGHT, KC_PGUP, KC_TRNS, KC_LBRC, KC_F4, KC_F5, KC_F6, KC_RBRC},
|
||||||
|
{KC_VOLD, KC_MPRV, KC_MPLY, KC_MNXT, KC_PGDN, KC_TRNS, LSFT(KC_LBRC), KC_F1, KC_F2, KC_F3, LSFT(KC_RBRC)},
|
||||||
|
{KM_DLEFT, KM_DRIGHT, LALT(KC_TAB), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}
|
||||||
|
},
|
||||||
|
[RAIS] = {
|
||||||
|
{KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_TRNS, KC_TRNS, KC_7, KC_8, KC_9, KC_TRNS},
|
||||||
|
{KC_CIRC, KC_AMPR, KC_GRV, KC_TILD, KC_PIPE, KC_TRNS, KC_PLUS, KC_4, KC_5, KC_6, KC_ASTR},
|
||||||
|
{KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSLS, KC_TRNS, KC_MINUS, KC_1, KC_2, KC_3, KC_SLASH},
|
||||||
|
{RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_0, KC_DOT, KC_EQL}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const uint16_t PROGMEM fn_actions[] = {
|
||||||
|
[1] = ACTION_MACRO_TAP(1),
|
||||||
|
[2] = ACTION_MACRO_TAP(2)
|
||||||
|
};
|
||||||
|
|
||||||
|
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||||
|
{
|
||||||
|
switch(id) {
|
||||||
|
case 1:
|
||||||
|
return tap_mod_macro(record, LGUI, MACRO( D(LSFT), T(9), U(LSFT), END));
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
return tap_mod_macro(record, LALT, MACRO( D(LSFT), T(0), U(LSFT), END));
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
return MACRO_NONE;
|
||||||
|
};
|
23
keyboards/atreus/keymaps/khitsule/readme.md
Normal file
23
keyboards/atreus/keymaps/khitsule/readme.md
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
# Atreus Layout by Khitsule
|
||||||
|

|
||||||
|
|
||||||
|
[KLE link](http://www.keyboard-layout-editor.com/#/gists/35ed66c55456699fd8f5d06750984a07)
|
||||||
|
|
||||||
|
## Layers
|
||||||
|
| Layer | Legend |
|
||||||
|
| ----- | ------ |
|
||||||
|
| Base | Top left (black) |
|
||||||
|
| Lower | Top right (purple) |
|
||||||
|
| Raise | Bottom right (pink) |
|
||||||
|
|
||||||
|
## 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
|
||||||
|
* Ctrl/Space
|
||||||
|
* Shift/Backspace
|
||||||
|
* Alt/Enter
|
||||||
|
* Lower/Tab
|
||||||
|
* Raise/Delete
|
@@ -5,7 +5,6 @@ ifdef TEENSY2
|
|||||||
ATREUS_UPLOAD_COMMAND = teensy_loader_cli -w -mmcu=$(MCU) $(TARGET).hex
|
ATREUS_UPLOAD_COMMAND = teensy_loader_cli -w -mmcu=$(MCU) $(TARGET).hex
|
||||||
else
|
else
|
||||||
OPT_DEFS += -DATREUS_ASTAR
|
OPT_DEFS += -DATREUS_ASTAR
|
||||||
OPT_DEFS += -DCATERINA_BOOTLOADER
|
|
||||||
ATREUS_UPLOAD_COMMAND = while [ ! -r $(USB) ]; do sleep 1; done; \
|
ATREUS_UPLOAD_COMMAND = while [ ! -r $(USB) ]; do sleep 1; done; \
|
||||||
avrdude -p $(MCU) -c avr109 -U flash:w:$(TARGET).hex -P $(USB)
|
avrdude -p $(MCU) -c avr109 -U flash:w:$(TARGET).hex -P $(USB)
|
||||||
endif
|
endif
|
||||||
@@ -27,7 +26,6 @@ MCU = atmega32u4
|
|||||||
# software delays.
|
# software delays.
|
||||||
F_CPU = 16000000
|
F_CPU = 16000000
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# LUFA specific
|
# LUFA specific
|
||||||
#
|
#
|
||||||
@@ -47,19 +45,20 @@ ARCH = AVR8
|
|||||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||||
F_USB = $(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.
|
||||||
|
ifdef TEENSY2
|
||||||
|
BOOTLOADER = halfkay
|
||||||
|
else
|
||||||
|
BOOTLOADER = caterina
|
||||||
|
endif
|
||||||
|
|
||||||
# Interrupt driven control endpoint task(+60)
|
# Interrupt driven control endpoint task(+60)
|
||||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
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
|
# Build Options
|
||||||
# comment out to disable the options.
|
# comment out to disable the options.
|
||||||
#
|
#
|
||||||
|
@@ -38,8 +38,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#define MATRIX_ROW_PINS { D2, D3, D1, D0, D4 }
|
#define MATRIX_ROW_PINS { D2, D3, D1, D0, D4 }
|
||||||
#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, B2, B6, B5, B4, E6, D7, C6 }
|
#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, B2, B6, B5, B4, E6, D7, C6 }
|
||||||
|
|
||||||
#define CATERINA_BOOTLOADER
|
|
||||||
|
|
||||||
/* COL2ROW or ROW2COL */
|
/* COL2ROW or ROW2COL */
|
||||||
#define DIODE_DIRECTION ROW2COL
|
#define DIODE_DIRECTION ROW2COL
|
||||||
|
|
||||||
|
97
keyboards/atreus62/keymaps/pcewing/keymap.c
Normal file
97
keyboards/atreus62/keymaps/pcewing/keymap.c
Normal file
@@ -0,0 +1,97 @@
|
|||||||
|
#include "atreus62.h"
|
||||||
|
|
||||||
|
#define _______ KC_TRNS
|
||||||
|
#define FN MO(_FN)
|
||||||
|
#define TODO KC_NO
|
||||||
|
|
||||||
|
enum atreus62_layers {
|
||||||
|
_DEFAULT,
|
||||||
|
_FN,
|
||||||
|
_RESET
|
||||||
|
};
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
|
||||||
|
/* Default layer
|
||||||
|
* ,-----------------------------------------. ,-----------------------------------------.
|
||||||
|
* | = | 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 ||Delete||Enter || N | M | , | . | / |Shift |
|
||||||
|
* |------+------+------+------+------+------|| || ||------+------+------+------+------+------|
|
||||||
|
* | Ctrl | Win | Alt | ` | Fn | Bksp |`------'`------'|Space | Fn | | Alt | Win | Ctrl |
|
||||||
|
* `-----------------------------------------' `-----------------------------------------'
|
||||||
|
*/
|
||||||
|
[_DEFAULT] = { /* qwerty */
|
||||||
|
{ 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 },
|
||||||
|
{ 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_DEL, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT },
|
||||||
|
{ KC_LCTL, KC_LGUI, KC_LALT, KC_GRV, FN, KC_BSPC, KC_ENT, KC_SPC, FN, TODO, KC_RALT, KC_RGUI, KC_RCTL }
|
||||||
|
},
|
||||||
|
|
||||||
|
/* Function layer
|
||||||
|
* ,-----------------------------------------. ,-----------------------------------------.
|
||||||
|
* | | | | | | | | | F10 | F11 | F12 | | |
|
||||||
|
* |------+------+------+------+------+------| |------+------+------+------+------+------|
|
||||||
|
* | | Home | Up | End | PgUp | | | PrSc | F7 | F8 | F9 | | |
|
||||||
|
* |------+------+------+------+------+------| |------+------+------+------+------+------|
|
||||||
|
* | Caps | Left | Down |Right | PgDn | |,------.,------.|Pause | F4 | F5 | F6 | | |
|
||||||
|
* |------+------+------+------+------+------|| || ||------+------+------+------+------+------|
|
||||||
|
* | | { | } | [ | ] | || || ||Insert| F1 | F2 | F3 | | |
|
||||||
|
* |------+------+------+------+------+------|| || ||------+------+------+------+------+------|
|
||||||
|
* | | | | | | |`------'`------'| | | | | | |
|
||||||
|
* `-----------------------------------------' `-----------------------------------------'
|
||||||
|
*/
|
||||||
|
[_FN] = {
|
||||||
|
{ _______, _______, _______, _______, _______, _______, _______, _______, KC_F10, KC_F11, KC_F12, _______, TO(_RESET) },
|
||||||
|
{ _______, KC_HOME, KC_UP, KC_END, KC_PGDN, _______, _______, KC_PSCR, KC_F7, KC_F8, KC_F9, _______, _______ },
|
||||||
|
{ _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGUP, _______, _______, KC_PAUS, KC_F4, KC_F5, KC_F6, _______, _______ },
|
||||||
|
{ _______, KC_LCBR, KC_RCBR, KC_LBRC, KC_RBRC, _______, _______, KC_INS, KC_F1, KC_F2, KC_F3, _______, _______ },
|
||||||
|
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }
|
||||||
|
},
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This layer makes it possible to reset the firmware; don't get rid of it and make sure there is a way to activate it.
|
||||||
|
*/
|
||||||
|
[_RESET] = {
|
||||||
|
{ TO(_DEFAULT), KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO },
|
||||||
|
{ KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO },
|
||||||
|
{ KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO },
|
||||||
|
{ KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO },
|
||||||
|
{ 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 }
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
[_TRNS] = {
|
||||||
|
{ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS },
|
||||||
|
{ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS },
|
||||||
|
{ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS },
|
||||||
|
{ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS },
|
||||||
|
{ KC_TRNS, 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;
|
||||||
|
};
|
@@ -35,18 +35,15 @@ ARCH = AVR8
|
|||||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||||
F_USB = $(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)
|
# Interrupt driven control endpoint task(+60)
|
||||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
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
|
# 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
|
# the appropriate keymap folder that will get included automatically
|
||||||
|
45
keyboards/bfake/bfake.c
Normal file
45
keyboards/bfake/bfake.c
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.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 <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "bfake.h"
|
||||||
|
#include "rgblight.h"
|
||||||
|
|
||||||
|
#include <avr/pgmspace.h>
|
||||||
|
|
||||||
|
#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();
|
||||||
|
}
|
@@ -19,7 +19,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#define BFAKE_H
|
#define BFAKE_H
|
||||||
|
|
||||||
#include "quantum.h"
|
#include "quantum.h"
|
||||||
#include "ps2avrGB.h"
|
|
||||||
|
|
||||||
#define KEYMAP( \
|
#define KEYMAP( \
|
||||||
K61, K71, K72, K73, K74, K64, K65, K75, K76, K77, K78, K68, K66, K10, K60,\
|
K61, K71, K72, K73, K74, K64, K65, K75, K76, K77, K78, K68, K66, K10, K60,\
|
@@ -14,12 +14,18 @@ GNU General Public License for more details.
|
|||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef BFAKE_CONFIG_H
|
#ifndef BFAKE_CONFIG_H
|
||||||
#define BFAKE_CONFIG_H
|
#define BFAKE_CONFIG_H
|
||||||
|
|
||||||
#include "config_common.h"
|
#include "config_common.h"
|
||||||
|
|
||||||
|
#define VENDOR_ID 0x20A0
|
||||||
|
#define PRODUCT_ID 0x422D
|
||||||
#define MANUFACTURER NotActuallyWinkeyless
|
#define MANUFACTURER NotActuallyWinkeyless
|
||||||
|
#define PRODUCT b.fake
|
||||||
|
|
||||||
|
#define RGBLED_NUM 16
|
||||||
|
|
||||||
#define MATRIX_ROWS 8
|
#define MATRIX_ROWS 8
|
||||||
#define MATRIX_COLS 11
|
#define MATRIX_COLS 11
|
||||||
@@ -31,4 +37,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#define DIODE_DIRECTION COL2ROW
|
#define DIODE_DIRECTION COL2ROW
|
||||||
#define DEBOUNCING_DELAY 5
|
#define DEBOUNCING_DELAY 5
|
||||||
|
|
||||||
|
|
||||||
|
#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
|
#endif
|
106
keyboards/bfake/i2c.c
Normal file
106
keyboards/bfake/i2c.c
Normal file
@@ -0,0 +1,106 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2016 Luiz Ribeiro <luizribeiro@gmail.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 <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Please do not modify this file
|
||||||
|
|
||||||
|
#include <avr/io.h>
|
||||||
|
#include <util/twi.h>
|
||||||
|
|
||||||
|
#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<<TWINT) | (1<<TWSTA) | (1<<TWEN);
|
||||||
|
while (!(TWCR & (1<<TWINT)));
|
||||||
|
|
||||||
|
// check if the start condition was successfully transmitted
|
||||||
|
if ((TWSR & 0xF8) != TW_START) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// transmit address and wait
|
||||||
|
TWDR = address;
|
||||||
|
TWCR = (1<<TWINT) | (1<<TWEN);
|
||||||
|
while (!(TWCR & (1<<TWINT)));
|
||||||
|
|
||||||
|
// 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 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void i2c_stop(void) {
|
||||||
|
TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWSTO);
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t i2c_write(uint8_t data) {
|
||||||
|
TWDR = data;
|
||||||
|
|
||||||
|
// transmit data and wait
|
||||||
|
TWCR = (1<<TWINT) | (1<<TWEN);
|
||||||
|
while (!(TWCR & (1<<TWINT)));
|
||||||
|
|
||||||
|
if ((TWSR & 0xF8) != TW_MT_DATA_ACK) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t i2c_send(uint8_t address, uint8_t *data, uint16_t length) {
|
||||||
|
if (i2c_start(address)) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (uint16_t i = 0; i < length; i++) {
|
||||||
|
if (i2c_write(data[i])) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
i2c_stop();
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
27
keyboards/bfake/i2c.h
Normal file
27
keyboards/bfake/i2c.h
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2016 Luiz Ribeiro <luizribeiro@gmail.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 <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// 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
|
106
keyboards/bfake/matrix.c
Normal file
106
keyboards/bfake/matrix.c
Normal file
@@ -0,0 +1,106 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.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 <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <avr/io.h>
|
||||||
|
#include <util/delay.h>
|
||||||
|
|
||||||
|
#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<<PIND7);
|
||||||
|
// all columns are pulled-up
|
||||||
|
PORTA = 0xFF;
|
||||||
|
PORTC |= (0b111111<<2);
|
||||||
|
PORTD |= (1<<PIND7);
|
||||||
|
|
||||||
|
// initialize matrix state: all keys off
|
||||||
|
for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
|
||||||
|
matrix[row] = 0x00;
|
||||||
|
matrix_debouncing[row] = 0x00;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
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) {
|
||||||
|
}
|
14
keyboards/bfake/readme.md
Normal file
14
keyboards/bfake/readme.md
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
B.fake
|
||||||
|
========
|
||||||
|
|
||||||
|
A 60% keyboard with RGB
|
||||||
|
|
||||||
|
Keyboard Maintainer: QMK Community
|
||||||
|
Hardware Supported: B.fake PCB
|
||||||
|
Hardware Availability: https://www.aliexpress.com/store/product/bface-60-RGB-underground-copy-pcb-from-china-gh60-pcb-Customize-keyboard-PCB/2230037_32731084597.html
|
||||||
|
|
||||||
|
Make example for this keyboard (after setting up your build environment):
|
||||||
|
|
||||||
|
make bfake: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.
|
50
keyboards/bfake/rules.mk
Normal file
50
keyboards/bfake/rules.mk
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
# Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
# 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
|
396
keyboards/bfake/usbconfig.h
Normal file
396
keyboards/bfake/usbconfig.h
Normal file
@@ -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 '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__ */
|
45
keyboards/bmini/bmini.c
Normal file
45
keyboards/bmini/bmini.c
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.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 <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "bmini.h"
|
||||||
|
#include "rgblight.h"
|
||||||
|
|
||||||
|
#include <avr/pgmspace.h>
|
||||||
|
|
||||||
|
#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();
|
||||||
|
}
|
@@ -19,7 +19,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#define BMINI_H
|
#define BMINI_H
|
||||||
|
|
||||||
#include "quantum.h"
|
#include "quantum.h"
|
||||||
#include "ps2avrGB.h"
|
|
||||||
|
|
||||||
#define KEYMAP( \
|
#define KEYMAP( \
|
||||||
K05, K25, K35, K45, K55, K06, KA6, KA7, K07, KB5, KC5, KD5, KE5, KD1, KE1, KE2, \
|
K05, K25, K35, K45, K55, K06, KA6, KA7, K07, KB5, KC5, KD5, KE5, KD1, KE1, KE2, \
|
41
keyboards/bmini/config.h
Normal file
41
keyboards/bmini/config.h
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.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 <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#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
|
106
keyboards/bmini/i2c.c
Normal file
106
keyboards/bmini/i2c.c
Normal file
@@ -0,0 +1,106 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2016 Luiz Ribeiro <luizribeiro@gmail.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 <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Please do not modify this file
|
||||||
|
|
||||||
|
#include <avr/io.h>
|
||||||
|
#include <util/twi.h>
|
||||||
|
|
||||||
|
#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<<TWINT) | (1<<TWSTA) | (1<<TWEN);
|
||||||
|
while (!(TWCR & (1<<TWINT)));
|
||||||
|
|
||||||
|
// check if the start condition was successfully transmitted
|
||||||
|
if ((TWSR & 0xF8) != TW_START) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// transmit address and wait
|
||||||
|
TWDR = address;
|
||||||
|
TWCR = (1<<TWINT) | (1<<TWEN);
|
||||||
|
while (!(TWCR & (1<<TWINT)));
|
||||||
|
|
||||||
|
// 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 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void i2c_stop(void) {
|
||||||
|
TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWSTO);
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t i2c_write(uint8_t data) {
|
||||||
|
TWDR = data;
|
||||||
|
|
||||||
|
// transmit data and wait
|
||||||
|
TWCR = (1<<TWINT) | (1<<TWEN);
|
||||||
|
while (!(TWCR & (1<<TWINT)));
|
||||||
|
|
||||||
|
if ((TWSR & 0xF8) != TW_MT_DATA_ACK) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t i2c_send(uint8_t address, uint8_t *data, uint16_t length) {
|
||||||
|
if (i2c_start(address)) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (uint16_t i = 0; i < length; i++) {
|
||||||
|
if (i2c_write(data[i])) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
i2c_stop();
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
27
keyboards/bmini/i2c.h
Normal file
27
keyboards/bmini/i2c.h
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2016 Luiz Ribeiro <luizribeiro@gmail.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 <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// 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
|
@@ -15,7 +15,7 @@ You should have received a copy of the GNU General Public License
|
|||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "bmini_x2.h"
|
#include "bmini.h"
|
||||||
|
|
||||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
[0] = KEYMAP(
|
[0] = KEYMAP(
|
106
keyboards/bmini/matrix.c
Normal file
106
keyboards/bmini/matrix.c
Normal file
@@ -0,0 +1,106 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.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 <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <avr/io.h>
|
||||||
|
#include <util/delay.h>
|
||||||
|
|
||||||
|
#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<<PIND7);
|
||||||
|
// all columns are pulled-up
|
||||||
|
PORTA = 0xFF;
|
||||||
|
PORTC |= (0b111111<<2);
|
||||||
|
PORTD |= (1<<PIND7);
|
||||||
|
|
||||||
|
// initialize matrix state: all keys off
|
||||||
|
for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
|
||||||
|
matrix[row] = 0x00;
|
||||||
|
matrix_debouncing[row] = 0x00;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
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) {
|
||||||
|
}
|
14
keyboards/bmini/readme.md
Normal file
14
keyboards/bmini/readme.md
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
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
|
||||||
|
|
||||||
|
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.
|
50
keyboards/bmini/rules.mk
Normal file
50
keyboards/bmini/rules.mk
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
# Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.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 <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
# 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
|
396
keyboards/bmini/usbconfig.h
Normal file
396
keyboards/bmini/usbconfig.h
Normal file
@@ -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 '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__ */
|
@@ -1,6 +1,5 @@
|
|||||||
|
|
||||||
OPT_DEFS += -DCHIMERA_ORTHO_PROMICRO
|
OPT_DEFS += -DCHIMERA_ORTHO_PROMICRO
|
||||||
OPT_DEFS += -DCATERINA_BOOTLOADER
|
|
||||||
CHIMERA_ORTHO_UPLOAD_COMMAND = while [ ! -r $(USB) ]; do sleep 1; done; \
|
CHIMERA_ORTHO_UPLOAD_COMMAND = while [ ! -r $(USB) ]; do sleep 1; done; \
|
||||||
avrdude -p $(MCU) -c avr109 -U flash:w:$(TARGET).hex -P $(USB)
|
avrdude -p $(MCU) -c avr109 -U flash:w:$(TARGET).hex -P $(USB)
|
||||||
|
|
||||||
@@ -45,19 +44,15 @@ ARCH = AVR8
|
|||||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||||
F_USB = $(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)
|
# Interrupt driven control endpoint task(+60)
|
||||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
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
|
# Build Options
|
||||||
# comment out to disable the options.
|
# comment out to disable the options.
|
||||||
#
|
#
|
||||||
|
@@ -1,4 +1,3 @@
|
|||||||
BLUETOOTH = AdafruitBLE
|
BLUETOOTH = AdafruitBLE
|
||||||
ADAFRUIT_BLE_ENABLE = yes
|
ADAFRUIT_BLE_ENABLE = yes
|
||||||
OPT_DEFS += -DCATERINA_BOOTLOADER
|
|
||||||
F_CPU = 8000000
|
F_CPU = 8000000
|
||||||
|
@@ -43,19 +43,15 @@ ARCH = AVR8
|
|||||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||||
F_USB = $(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
|
# Interrupt driven control endpoint task
|
||||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
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
|
# Build Options
|
||||||
# comment out to disable the options.
|
# comment out to disable the options.
|
||||||
#
|
#
|
||||||
|
52
keyboards/crawlpad/config.h
Executable file
52
keyboards/crawlpad/config.h
Executable file
@@ -0,0 +1,52 @@
|
|||||||
|
#ifndef CONFIG_H
|
||||||
|
#define CONFIG_H
|
||||||
|
|
||||||
|
#include "config_common.h"
|
||||||
|
|
||||||
|
/* USB Device descriptor parameter */
|
||||||
|
#define VENDOR_ID 0xFEED
|
||||||
|
#define PRODUCT_ID 0x6070
|
||||||
|
#define DEVICE_VER 0x0001
|
||||||
|
#define MANUFACTURER WoodKeys.click
|
||||||
|
#define PRODUCT CrawlPad
|
||||||
|
#define DESCRIPTION ATX Keycrawl 2017
|
||||||
|
|
||||||
|
/* key matrix size */
|
||||||
|
#define MATRIX_ROWS 4
|
||||||
|
#define MATRIX_COLS 4
|
||||||
|
|
||||||
|
/* key matrix pins */
|
||||||
|
#define MATRIX_ROW_PINS { F0, F1, F4, F5 }
|
||||||
|
#define MATRIX_COL_PINS { D4, D5, D6, D7 }
|
||||||
|
#define UNUSED_PINS
|
||||||
|
|
||||||
|
/* Pins for custom per-row LEDs. Should be changed to use named pins. */
|
||||||
|
#define LED_ROW_PINS { 8, 9, 10, 11 }
|
||||||
|
|
||||||
|
/* COL2ROW or ROW2COL */
|
||||||
|
#define DIODE_DIRECTION ROW2COL
|
||||||
|
|
||||||
|
/* 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() ( \
|
||||||
|
false \
|
||||||
|
)
|
||||||
|
|
||||||
|
/* prevent stuck modifiers */
|
||||||
|
#define PREVENT_STUCK_MODIFIERS
|
||||||
|
|
||||||
|
#ifdef RGBLIGHT_ENABLE
|
||||||
|
#define RGB_DI_PIN D3
|
||||||
|
#define RGBLIGHT_ANIMATIONS
|
||||||
|
#define RGBLED_NUM 3
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
1
keyboards/crawlpad/crawlpad.c
Executable file
1
keyboards/crawlpad/crawlpad.c
Executable file
@@ -0,0 +1 @@
|
|||||||
|
#include "crawlpad.h"
|
18
keyboards/crawlpad/crawlpad.h
Executable file
18
keyboards/crawlpad/crawlpad.h
Executable file
@@ -0,0 +1,18 @@
|
|||||||
|
#ifndef KB_H
|
||||||
|
#define KB_H
|
||||||
|
|
||||||
|
#include "quantum.h"
|
||||||
|
|
||||||
|
#define KEYMAP( \
|
||||||
|
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 } \
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
1
keyboards/crawlpad/crawlpad.json
Normal file
1
keyboards/crawlpad/crawlpad.json
Normal file
File diff suppressed because one or more lines are too long
117
keyboards/crawlpad/keymaps/default/keymap.c
Executable file
117
keyboards/crawlpad/keymaps/default/keymap.c
Executable file
@@ -0,0 +1,117 @@
|
|||||||
|
#include "../../crawlpad.h"
|
||||||
|
|
||||||
|
enum custom_keycodes {
|
||||||
|
BL1 = SAFE_RANGE,
|
||||||
|
BL2,
|
||||||
|
BL3,
|
||||||
|
BL4
|
||||||
|
};
|
||||||
|
|
||||||
|
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),
|
||||||
|
|
||||||
|
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),
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
void set_led(int idx, bool enable) {
|
||||||
|
uint8_t pin = LED_PINS[idx];
|
||||||
|
if (enable) {
|
||||||
|
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF);
|
||||||
|
} else {
|
||||||
|
/* PORTx &= ~n */
|
||||||
|
_SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
PORTB |= (1 << 4);
|
||||||
|
} else {
|
||||||
|
PORTB &= ~(1 << 4);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
case BL2:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
PORTB |= (1 << 5);
|
||||||
|
} else {
|
||||||
|
PORTB &= ~(1 << 5);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
case BL3:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
PORTB |= (1 << 6);
|
||||||
|
} else {
|
||||||
|
PORTB &= ~(1 << 6);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
case BL4:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
PORTB |= (1 << 7);
|
||||||
|
} else {
|
||||||
|
PORTB &= ~(1 << 7);
|
||||||
|
}
|
||||||
|
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 {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
17
keyboards/crawlpad/readme.md
Normal file
17
keyboards/crawlpad/readme.md
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
# Crawlpad
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
A 4x4 macropad/numpad, exclusively availabe at Keycrawl events.
|
||||||
|
|
||||||
|
Keyboard Maintainer: [Cole Markham](https://github.com/colemarkham)
|
||||||
|
Hardware Supported: Crawlpad
|
||||||
|
Hardware Availability: Exclusive to Keycrawl events, contact [awwwwwwyeaahhhhhh](https://www.reddit.com/user/awwwwwwyeaahhhhhh) for more details.
|
||||||
|
|
||||||
|
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].
|
56
keyboards/crawlpad/rules.mk
Executable file
56
keyboards/crawlpad/rules.mk
Executable file
@@ -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 ?= 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.
|
175
keyboards/daisy/config.h
Normal file
175
keyboards/daisy/config.h
Normal file
@@ -0,0 +1,175 @@
|
|||||||
|
#ifndef CONFIG_H
|
||||||
|
#define CONFIG_H
|
||||||
|
|
||||||
|
#include "config_common.h"
|
||||||
|
|
||||||
|
/* USB Device descriptor parameter */
|
||||||
|
#define VENDOR_ID 0x1209
|
||||||
|
#define PRODUCT_ID 0x2328
|
||||||
|
#define DEVICE_VER 0x501
|
||||||
|
#define MANUFACTURER K.T.E.C.
|
||||||
|
#define PRODUCT Daisy
|
||||||
|
#define DESCRIPTION qmk port for Daisy
|
||||||
|
|
||||||
|
/* 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 { D2, D3, D5, B7 }
|
||||||
|
#define MATRIX_COL_PINS { F0, F1, F4, F5, F6, F7, B6, B5, B4, D7, D6 }
|
||||||
|
#define UNUSED_PINS
|
||||||
|
|
||||||
|
/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */
|
||||||
|
#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 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
|
||||||
|
|
||||||
|
// ws2812 options
|
||||||
|
#define RGB_DI_PIN C7 // pin the DI on the ws2812 is hooked-up to
|
||||||
|
#define RGBLIGHT_ANIMATIONS // run RGB animations
|
||||||
|
#define RGBLED_NUM 8 // 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)
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 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
|
15
keyboards/daisy/daisy.c
Normal file
15
keyboards/daisy/daisy.c
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
#include "daisy.h"
|
||||||
|
|
||||||
|
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)) {
|
||||||
|
// output low
|
||||||
|
DDRC |= (1<<PC6);
|
||||||
|
PORTC &= ~(1<<PC6);
|
||||||
|
} else {
|
||||||
|
// Hi-Z
|
||||||
|
DDRC &= ~(1<<PC6);
|
||||||
|
PORTC &= ~(1<<PC6);
|
||||||
|
}
|
||||||
|
led_set_user(usb_led);
|
||||||
|
}
|
19
keyboards/daisy/daisy.h
Normal file
19
keyboards/daisy/daisy.h
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
#ifndef DAISY_H
|
||||||
|
#define DAISY_H
|
||||||
|
|
||||||
|
#include "quantum.h"
|
||||||
|
|
||||||
|
#define KEYMAP( \
|
||||||
|
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K3A, \
|
||||||
|
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, K34, K35, K37, K38, K39 \
|
||||||
|
) \
|
||||||
|
{ \
|
||||||
|
{ 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, KC_NO, K34, K35, KC_NO, K37, K38, K39, K3A } \
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
99
keyboards/daisy/keymaps/default/keymap.c
Normal file
99
keyboards/daisy/keymaps/default/keymap.c
Normal file
@@ -0,0 +1,99 @@
|
|||||||
|
#include "daisy.h"
|
||||||
|
#include "action_layer.h"
|
||||||
|
|
||||||
|
extern keymap_config_t keymap_config;
|
||||||
|
|
||||||
|
// Layer shorthand
|
||||||
|
#define _BL 0
|
||||||
|
#define _LW 1
|
||||||
|
#define _RS 2
|
||||||
|
|
||||||
|
enum layer_keycodes {
|
||||||
|
QWERTY = SAFE_RANGE, LOWER, RAISE
|
||||||
|
};
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
|
||||||
|
/* Base Layer
|
||||||
|
* .-----------------------------------------------------------------------.
|
||||||
|
* | ESC | Q | W | E | R | T | Y | U | I | O | P | \| |
|
||||||
|
* |-----------------------------------------------------------------------|
|
||||||
|
* | TAB | A | S | D | F | G | H | J | K | L | ENTER |
|
||||||
|
* |-----------------------------------------------------------------------|
|
||||||
|
* | LSHIFT | Z | X | C | V | B | N | M | ,< | .> | /? |
|
||||||
|
* |-----------------------------------------------------------------------|
|
||||||
|
* | LCTRL | LGUI | LALT | SPACE | BACKSPACE | LW | RS | RALT |
|
||||||
|
* '-----------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
|
||||||
|
[_BL] = KEYMAP(
|
||||||
|
GRAVE_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, 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_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, KC_SPC, KC_BSPC, LOWER, RAISE, KC_RALT ),
|
||||||
|
|
||||||
|
|
||||||
|
/* Function Layer
|
||||||
|
* .-----------------------------------------------------------------------.
|
||||||
|
* | GRV | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | -_ |
|
||||||
|
* |-----------------------------------------------------------------------|
|
||||||
|
* | | =+ | UP | | | | [{ | ]} | ;: | '" | |
|
||||||
|
* |-----------------------------------------------------------------------|
|
||||||
|
* | | LEFT| DOWN |RIGHT| | | | | | | |
|
||||||
|
* |-----------------------------------------------------------------------|
|
||||||
|
* | | | | | DELETE | | | |
|
||||||
|
* '-----------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
|
||||||
|
[_LW] = KEYMAP(
|
||||||
|
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_TRNS, KC_EQL, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_LBRC, KC_RBRC, KC_SCLN, KC_QUOT, 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_LCTL, KC_LGUI, KC_LALT, KC_TRNS, KC_DEL, KC_TRNS, KC_TRNS, KC_TRNS ),
|
||||||
|
|
||||||
|
|
||||||
|
/* Second Function Layer
|
||||||
|
* .-----------------------------------------------------------------------.
|
||||||
|
* | RST | F1 | F2 | F3 | F4 | F5 | F6 | | HOME| PGUP| | |
|
||||||
|
* |-----------------------------------------------------------------------|
|
||||||
|
* | | F7 | F8 | F9 | F10 | F11 | F12 | | END | PGDN| |
|
||||||
|
* |-----------------------------------------------------------------------|
|
||||||
|
* | |RGBtog|RGBmod|RGBhud|RGBhui|RGBvad|RGBvai|RGBsad|RGBsai|BL| |
|
||||||
|
* |-----------------------------------------------------------------------|
|
||||||
|
* | | | | | | | | |
|
||||||
|
* '-----------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
|
||||||
|
[_RS] = KEYMAP(
|
||||||
|
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, 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:
|
||||||
|
if(record->event.pressed){
|
||||||
|
layer_on(_LW);
|
||||||
|
} else {
|
||||||
|
layer_off(_LW);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
case RAISE:
|
||||||
|
if(record->event.pressed){
|
||||||
|
layer_on(_RS);
|
||||||
|
} else {
|
||||||
|
layer_off(_RS);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
};
|
5
keyboards/daisy/keymaps/default/readme.md
Normal file
5
keyboards/daisy/keymaps/default/readme.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|

|
||||||
|
|
||||||
|
# Default Daisy Layout
|
||||||
|
|
||||||
|
This is the default layout as offered by KPRepublic's TMK firmware for the Daisy with a few minor tweaks for usability made by me.
|
29
keyboards/daisy/readme.md
Normal file
29
keyboards/daisy/readme.md
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
# Daisy
|
||||||
|
|
||||||
|
A 40% keyboard kit sold by KPRepublic.
|
||||||
|
|
||||||
|
Keyboard Maintainer: westfoxtrot (https://github.com/westfoxtrot)
|
||||||
|
Hardware Supported: Daisy PCB Rev.1, Daisy PCB Rev.2
|
||||||
|
Hardware Availability: http://tinyurl.com/yc26lq22
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
|
||||||
|
# Other Keymaps
|
||||||
|
|
||||||
|
The "default" keymap included is the layout I personally use on the Daisy and the one I have found the most comfortable.
|
||||||
|
|
||||||
|
A printable picture showing this layout is available here: https://imgur.com/9mSF0yf
|
||||||
|
|
||||||
|
|
||||||
|
```
|
||||||
|
$ make daisy:[default|<name>]
|
||||||
|
```
|
||||||
|
|
||||||
|
# Bootloader
|
||||||
|
|
||||||
|
I personally had issues with the bootloader on my Daisy PCB and was unable to flash a firmware to the board after the first time. I replaced the bootloader with the one available in the repository at ../../util/bootloader_atmega32u4_1_0_0.hex
|
66
keyboards/daisy/rules.mk
Normal file
66
keyboards/daisy/rules.mk
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
# 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=4996
|
||||||
|
|
||||||
|
# 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 = 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 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 = 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
|
@@ -39,18 +39,15 @@ ARCH = AVR8
|
|||||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||||
F_USB = $(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)
|
# Interrupt driven control endpoint task(+60)
|
||||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
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
|
# 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
|
# the appropriate keymap folder that will get included automatically
|
||||||
|
@@ -37,8 +37,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#define MATRIX_ROW_PINS { F4, F5, F6, F7, B1, B3, B2 }
|
#define MATRIX_ROW_PINS { F4, F5, F6, F7, B1, B3, B2 }
|
||||||
#define MATRIX_COL_PINS { B6, B5, B4, E6, D7, C6, D4, D1}
|
#define MATRIX_COL_PINS { B6, B5, B4, E6, D7, C6, D4, D1}
|
||||||
|
|
||||||
#define CATERINA_BOOTLOADER
|
|
||||||
|
|
||||||
/* COL2ROW or ROW2COL */
|
/* COL2ROW or ROW2COL */
|
||||||
#define DIODE_DIRECTION COL2ROW
|
#define DIODE_DIRECTION COL2ROW
|
||||||
|
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
|
|
||||||
OPT_DEFS += -DDICHOTEMY_PROMICRO
|
OPT_DEFS += -DDICHOTEMY_PROMICRO
|
||||||
OPT_DEFS += -DCATERINA_BOOTLOADER
|
|
||||||
DICHOTEMY_UPLOAD_COMMAND = while [ ! -r $(USB) ]; do sleep 1; done; \
|
DICHOTEMY_UPLOAD_COMMAND = while [ ! -r $(USB) ]; do sleep 1; done; \
|
||||||
avrdude -p $(MCU) -c avr109 -U flash:w:$(TARGET).hex -P $(USB)
|
avrdude -p $(MCU) -c avr109 -U flash:w:$(TARGET).hex -P $(USB)
|
||||||
|
|
||||||
@@ -25,8 +24,6 @@ MCU = atmega32u4
|
|||||||
# software delays.
|
# software delays.
|
||||||
F_CPU = 16000000
|
F_CPU = 16000000
|
||||||
|
|
||||||
|
|
||||||
#
|
|
||||||
# LUFA specific
|
# LUFA specific
|
||||||
#
|
#
|
||||||
# Target architecture (see library "Board Types" documentation).
|
# Target architecture (see library "Board Types" documentation).
|
||||||
@@ -45,19 +42,15 @@ ARCH = AVR8
|
|||||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||||
F_USB = $(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)
|
# Interrupt driven control endpoint task(+60)
|
||||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
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
|
# Build Options
|
||||||
# comment out to disable the options.
|
# comment out to disable the options.
|
||||||
#
|
#
|
||||||
|
82
keyboards/do60/config.h
Normal file
82
keyboards/do60/config.h
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2012 Doyu Studio <sy_yang@doyustudio.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 <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#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 Shopkey by Doyu Studio
|
||||||
|
#define PRODUCT Do60
|
||||||
|
#define DESCRIPTION Do60 Keyboard PCB by Doyu Studio
|
||||||
|
|
||||||
|
/* 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, B7, B5, B4, D7, D6, B3, B0 }
|
||||||
|
#define UNUSED_PINS
|
||||||
|
|
||||||
|
/* Backlight Setup */
|
||||||
|
#define BACKLIGHT_PIN F4
|
||||||
|
#define BACKLIGHT_LEVELS 6
|
||||||
|
//#define BACKLIGHT_BREATHING
|
||||||
|
|
||||||
|
/* 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
|
||||||
|
* F5 PIN for DO60's pre-soldered WS2812 LEDs
|
||||||
|
*/
|
||||||
|
#define RGB_DI_PIN F5
|
||||||
|
#define RGBLIGHT_ANIMATIONS
|
||||||
|
#define RGBLED_NUM 20 // Number of LEDs
|
||||||
|
#define RGBLIGHT_HUE_STEP 10
|
||||||
|
#define RGBLIGHT_SAT_STEP 15
|
||||||
|
#define RGBLIGHT_VAL_STEP 15
|
||||||
|
|
||||||
|
/* Mechanical 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 TAPPING_TERM 200
|
||||||
|
|
||||||
|
#endif
|
19
keyboards/do60/do60.c
Normal file
19
keyboards/do60/do60.c
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
#include "do60.h"
|
||||||
|
|
||||||
|
|
||||||
|
extern inline void do60_caps_led_on(void);
|
||||||
|
extern inline void do60_bl_led_on(void);
|
||||||
|
|
||||||
|
extern inline void do60_caps_led_off(void);
|
||||||
|
extern inline void do60_bl_led_off(void);
|
||||||
|
|
||||||
|
|
||||||
|
void led_set_kb(uint8_t usb_led) {
|
||||||
|
if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
|
||||||
|
do60_caps_led_on();
|
||||||
|
} else {
|
||||||
|
do60_caps_led_off();
|
||||||
|
}
|
||||||
|
|
||||||
|
led_set_user(usb_led);
|
||||||
|
}
|
41
keyboards/do60/do60.h
Normal file
41
keyboards/do60/do60.h
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
#ifndef DO60_H
|
||||||
|
#define DO60_H
|
||||||
|
|
||||||
|
#include "quantum.h"
|
||||||
|
#include "led.h"
|
||||||
|
|
||||||
|
/* DO60 LEDs
|
||||||
|
* GPIO pads
|
||||||
|
* 0 F7 not connected
|
||||||
|
* 1 F6 RGB PWM Underglow
|
||||||
|
* 2 F5 Backlight LED
|
||||||
|
* 3 F4 not connected
|
||||||
|
* B2 Capslock LED
|
||||||
|
* B0 not connected
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
inline void do60_caps_led_on(void) { DDRB |= (1<<2); PORTB &= ~(1<<2); }
|
||||||
|
inline void do60_bl_led_on(void) { DDRF |= (1<<4); PORTF &= ~(1<<4); }
|
||||||
|
|
||||||
|
inline void do60_caps_led_off(void) { DDRB &= ~(1<<2); PORTB &= ~(1<<2); }
|
||||||
|
inline void do60_bl_led_off(void) { DDRF &= ~(1<<4); PORTF &= ~(1<<4); }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* Do60 Keymap Definition Macro */
|
||||||
|
#define KEYMAP( \
|
||||||
|
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, \
|
||||||
|
K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \
|
||||||
|
K40, K41, K42, K45, K46, 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, KC_NO, 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,K45, K46, K47, KC_NO,KC_NO,K4A, K4B, K4C, K4D, K4E } \
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
47
keyboards/do60/keymaps/default/keymap.c
Normal file
47
keyboards/do60/keymaps/default/keymap.c
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
#include "do60.h"
|
||||||
|
#include "action_layer.h"
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
|
||||||
|
// 0: Base Layer
|
||||||
|
[0] = KEYMAP(
|
||||||
|
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_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_NO, 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),
|
||||||
|
|
||||||
|
// 1: Function Layer
|
||||||
|
[1] = KEYMAP(
|
||||||
|
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_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),
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
// 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
|
||||||
|
};
|
5
keyboards/do60/keymaps/default/readme.md
Normal file
5
keyboards/do60/keymaps/default/readme.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|

|
||||||
|
|
||||||
|
All of the keys which CAN have a function should be assigned one.
|
||||||
|
|
||||||
|
The keys with KC_NO cannot be assigned a value
|
47
keyboards/do60/keymaps/test/keymap.c
Normal file
47
keyboards/do60/keymaps/test/keymap.c
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
#include "do60.h"
|
||||||
|
#include "action_layer.h"
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
|
||||||
|
// 0: Base Layer
|
||||||
|
[0] = KEYMAP(
|
||||||
|
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_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_UP, \
|
||||||
|
KC_LCTL, KC_LGUI, KC_LALT, KC_BSPC,KC_SPC, KC_DEL, KC_RGUI, F(0), KC_LEFT, KC_DOWN, KC_RIGHT),
|
||||||
|
|
||||||
|
// 1: Function Layer
|
||||||
|
[1] = KEYMAP(
|
||||||
|
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_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),
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
// 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
|
||||||
|
};
|
5
keyboards/do60/keymaps/test/readme.md
Normal file
5
keyboards/do60/keymaps/test/readme.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|

|
||||||
|
|
||||||
|
All of the keys which CAN have a function should be assigned one.
|
||||||
|
|
||||||
|
The keys with KC_NO cannot be assigned a value
|
11
keyboards/do60/readme.md
Normal file
11
keyboards/do60/readme.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# QMK Firmware for DoyuStudio DO60 PCB
|
||||||
|
|
||||||
|
|
||||||
|
## Quantum MK Firmware
|
||||||
|
For the full Quantum feature list, see [the parent readme.md](/readme.md).
|
||||||
|
|
||||||
|
Board supports in-switch LEDs (two-pin, single colour)
|
||||||
|
Build-in WS2182 RGB LED for underglow lighting.
|
||||||
|
|
||||||
|
## Build
|
||||||
|
To build the default keymap, simply run `make do60:default`.
|
64
keyboards/do60/rules.mk
Normal file
64
keyboards/do60/rules.mk
Normal file
@@ -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
|
||||||
|
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 = yes # Virtual DIP switch configuration(+1000)
|
||||||
|
COMMAND_ENABLE = no # Commands for debug and configuration
|
||||||
|
CONSOLE_ENABLE = no # Console for debug(+400)
|
||||||
|
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
|
||||||
|
MIDI_ENABLE = no # MIDI controls
|
||||||
|
MOUSEKEY_ENABLE = yes # 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
|
||||||
|
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
|
||||||
|
UNICODE_ENABLE = no # Unicode
|
53
keyboards/dz60/keymaps/n0velty/keymap.c
Normal file
53
keyboards/dz60/keymaps/n0velty/keymap.c
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
#include "dz60.h"
|
||||||
|
#include "action_layer.h"
|
||||||
|
|
||||||
|
#define _______ KC_TRNS //readability
|
||||||
|
|
||||||
|
#define _DL 0 //default
|
||||||
|
#define _F1 1 //function 1
|
||||||
|
#define _F2 2 //function 2
|
||||||
|
|
||||||
|
#define KC_NOPE LALT(KC_F4) //alt+f4
|
||||||
|
|
||||||
|
#define RGB_STA RGB_M_P //rgb static
|
||||||
|
#define RGB_BRE RGB_M_B //rgb breathe
|
||||||
|
#define RGB_RAI RGB_M_R //rgb rainbow
|
||||||
|
#define RGB_SWI RGB_M_SW //rgb swirl
|
||||||
|
#define RGB_SNA RGB_M_SN //rgb snake
|
||||||
|
#define RGB_KNI RGB_M_K //rgb knight
|
||||||
|
#define RGB_GRA RGB_M_G //rgb gradient
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
|
||||||
|
[_DL] = KEYMAP_TRUE_HHKB( //default Layer
|
||||||
|
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_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_LSPO, XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, MO(_F1), \
|
||||||
|
MO(_F1), KC_LALT, KC_SPC, MO(_F2), KC_RGUI),
|
||||||
|
|
||||||
|
[_F1] = KEYMAP_TRUE_HHKB( //function Layer 1
|
||||||
|
KC_NOPE, KC_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_GRV, \
|
||||||
|
KC_BSPC, KC_HOME, KC_UP, KC_END, _______, _______, _______, _______, _______, KC_PAUS, KC_PSCR, KC_UP, KC_HOME, KC_END, \
|
||||||
|
KC_CAPS, KC_LEFT, KC_DOWN, KC_RGHT, KC_VOLU, _______, _______, _______, _______, KC_PGUP, KC_LEFT, KC_RGHT, _______, \
|
||||||
|
_______, XXXXXXX, KC_MPRV, KC_MPLY, KC_MNXT, KC_VOLD, _______, _______, _______, _______, KC_PGDN, KC_DOWN, _______, _______, \
|
||||||
|
_______, KC_MSEL, KC_MUTE, _______, _______),
|
||||||
|
|
||||||
|
[_F2] = KEYMAP_TRUE_HHKB( //function Layer 2
|
||||||
|
RESET, RGB_STA, RGB_BRE, RGB_RAI, RGB_SWI, RGB_SNA, RGB_KNI, RGB_GRA, _______, _______, _______, _______, _______, KC_SLEP, KC_PWR, \
|
||||||
|
RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, _______, _______, _______, KC_ACL2, KC_BTN1, KC_MS_U, KC_BTN2, _______, \
|
||||||
|
RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, _______, _______, _______, KC_ACL1, KC_MS_L, KC_MS_R, _______, \
|
||||||
|
BL_TOGG, XXXXXXX, BL_STEP, BL_INC, BL_DEC, _______, _______, _______, _______, _______, KC_ACL0, KC_MS_D, _______, _______, \
|
||||||
|
_______, _______, _______, _______, M(0)),
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
|
||||||
|
if (record->event.pressed) {
|
||||||
|
switch(id) {
|
||||||
|
case 0:
|
||||||
|
SEND_STRING("https://www.reddit.com/r/MechanicalKeyboards/");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return MACRO_NONE;
|
||||||
|
};
|
@@ -31,8 +31,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#define MATRIX_ROWS 4
|
#define MATRIX_ROWS 4
|
||||||
#define MATRIX_COLS 14
|
#define MATRIX_COLS 14
|
||||||
|
|
||||||
#define CATERINA_BOOTLOADER
|
|
||||||
|
|
||||||
/* COL2ROW or ROW2COL */
|
/* COL2ROW or ROW2COL */
|
||||||
#define DIODE_DIRECTION COL2ROW
|
#define DIODE_DIRECTION COL2ROW
|
||||||
|
|
||||||
|
@@ -34,18 +34,15 @@ ARCH = AVR8
|
|||||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||||
F_USB = $(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)
|
# Interrupt driven control endpoint task(+60)
|
||||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
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
|
# 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
|
# the appropriate keymap folder that will get included automatically
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com>
|
Copyright 2012 Jun Wako <wakojun@gmail.com>
|
||||||
|
Copyright 2015 Jack Humbert
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
@@ -15,13 +16,9 @@ You should have received a copy of the GNU General Public License
|
|||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef BMINI_CONFIG_H
|
#ifndef CONFIG_H
|
||||||
#define BMINI_CONFIG_H
|
#define CONFIG_H
|
||||||
|
|
||||||
#define MANUFACTURER winkeyless.kr
|
#include "config_common.h"
|
||||||
|
|
||||||
/* matrix size */
|
|
||||||
#define MATRIX_ROWS 8
|
|
||||||
#define MATRIX_COLS 15
|
|
||||||
|
|
||||||
#endif
|
#endif
|
16
keyboards/ergo42/ergo42.c
Normal file
16
keyboards/ergo42/ergo42.c
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
#include "ergo42.h"
|
||||||
|
|
||||||
|
#ifdef ONEHAND_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}, {6, 4}},
|
||||||
|
{{0, 5}, {1, 5}, {2, 5}, {3, 5}, {4, 5}, {5, 5}, {6, 5}},
|
||||||
|
{{0, 6}, {1, 6}, {2, 6}, {3, 6}, {4, 6}, {5, 6}, {6, 6}},
|
||||||
|
{{0, 7}, {1, 7}, {2, 7}, {3, 7}, {4, 7}, {5, 7}, {6, 7}},
|
||||||
|
{{0, 0}, {1, 0}, {2, 0}, {3, 0}, {4, 0}, {5, 0}, {6, 0}},
|
||||||
|
{{0, 1}, {1, 1}, {2, 1}, {3, 1}, {4, 1}, {5, 1}, {6, 1}},
|
||||||
|
{{0, 2}, {1, 2}, {2, 2}, {3, 2}, {4, 2}, {5, 2}, {6, 2}},
|
||||||
|
{{0, 3}, {1, 3}, {2, 3}, {3, 3}, {4, 3}, {5, 3}, {6, 3}},
|
||||||
|
};
|
||||||
|
#endif
|
27
keyboards/ergo42/ergo42.h
Normal file
27
keyboards/ergo42/ergo42.h
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
#ifndef ERGO42_H
|
||||||
|
#define ERGO42_H
|
||||||
|
|
||||||
|
#include "quantum.h"
|
||||||
|
|
||||||
|
#ifdef KEYBOARD_ergo42_rev1
|
||||||
|
#include "rev1.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
// Used to create a keymap using only KC_ prefixed keys
|
||||||
|
#define KC_KEYMAP( \
|
||||||
|
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 \
|
||||||
|
) \
|
||||||
|
KEYMAP( \
|
||||||
|
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 \
|
||||||
|
)
|
||||||
|
|
||||||
|
#define KC_LAYOUT_ortho_4x14 KC_KEYMAP
|
||||||
|
|
||||||
|
#endif
|
162
keyboards/ergo42/i2c.c
Normal file
162
keyboards/ergo42/i2c.c
Normal file
@@ -0,0 +1,162 @@
|
|||||||
|
#include <util/twi.h>
|
||||||
|
#include <avr/io.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <avr/interrupt.h>
|
||||||
|
#include <util/twi.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
#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<<TWINT)) && lim < I2C_LOOP_TIMEOUT)
|
||||||
|
lim++;
|
||||||
|
|
||||||
|
// easier way, but will wait slightly longer
|
||||||
|
// _delay_us(100);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Setup twi to run at 100kHz
|
||||||
|
void i2c_master_init(void) {
|
||||||
|
// no prescaler
|
||||||
|
TWSR = 0;
|
||||||
|
// Set TWI clock frequency to SCL_CLOCK. Need TWBR>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<<TWINT) | (1<<TWEN) | (1<<TWSTA);
|
||||||
|
|
||||||
|
i2c_delay();
|
||||||
|
|
||||||
|
// check that we started successfully
|
||||||
|
if ( (TW_STATUS != TW_START) && (TW_STATUS != TW_REP_START))
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
TWDR = address;
|
||||||
|
TWCR = (1<<TWINT) | (1<<TWEN);
|
||||||
|
|
||||||
|
i2c_delay();
|
||||||
|
|
||||||
|
if ( (TW_STATUS != TW_MT_SLA_ACK) && (TW_STATUS != TW_MR_SLA_ACK) )
|
||||||
|
return 1; // slave did not acknowledge
|
||||||
|
else
|
||||||
|
return 0; // success
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Finish the i2c transaction.
|
||||||
|
void i2c_master_stop(void) {
|
||||||
|
TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWSTO);
|
||||||
|
|
||||||
|
uint16_t lim = 0;
|
||||||
|
while(!(TWCR & (1<<TWSTO)) && lim < I2C_LOOP_TIMEOUT)
|
||||||
|
lim++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Write one byte to the i2c slave.
|
||||||
|
// returns 0 => slave ACK
|
||||||
|
// 1 => slave NACK
|
||||||
|
uint8_t i2c_master_write(uint8_t data) {
|
||||||
|
TWDR = data;
|
||||||
|
TWCR = (1<<TWINT) | (1<<TWEN);
|
||||||
|
|
||||||
|
i2c_delay();
|
||||||
|
|
||||||
|
// check if the slave acknowledged us
|
||||||
|
return (TW_STATUS == TW_MT_DATA_ACK) ? 0 : 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Read one byte from the i2c slave. If ack=1 the slave is acknowledged,
|
||||||
|
// if ack=0 the acknowledge bit is not set.
|
||||||
|
// returns: byte read from i2c device
|
||||||
|
uint8_t i2c_master_read(int ack) {
|
||||||
|
TWCR = (1<<TWINT) | (1<<TWEN) | (ack<<TWEA);
|
||||||
|
|
||||||
|
i2c_delay();
|
||||||
|
return TWDR;
|
||||||
|
}
|
||||||
|
|
||||||
|
void i2c_reset_state(void) {
|
||||||
|
TWCR = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void i2c_slave_init(uint8_t address) {
|
||||||
|
TWAR = address << 0; // slave i2c address
|
||||||
|
// TWEN - twi enable
|
||||||
|
// TWEA - enable address acknowledgement
|
||||||
|
// TWINT - twi interrupt flag
|
||||||
|
// TWIE - enable the twi interrupt
|
||||||
|
TWCR = (1<<TWIE) | (1<<TWEA) | (1<<TWINT) | (1<<TWEN);
|
||||||
|
}
|
||||||
|
|
||||||
|
ISR(TWI_vect);
|
||||||
|
|
||||||
|
ISR(TWI_vect) {
|
||||||
|
uint8_t ack = 1;
|
||||||
|
switch(TW_STATUS) {
|
||||||
|
case TW_SR_SLA_ACK:
|
||||||
|
// this device has been addressed as a slave receiver
|
||||||
|
slave_has_register_set = false;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case TW_SR_DATA_ACK:
|
||||||
|
// this device has received data as a slave receiver
|
||||||
|
// The first byte that we receive in this transaction sets the location
|
||||||
|
// of the read/write location of the slaves memory that it exposes over
|
||||||
|
// i2c. After that, bytes will be written at slave_buffer_pos, incrementing
|
||||||
|
// slave_buffer_pos after each write.
|
||||||
|
if(!slave_has_register_set) {
|
||||||
|
slave_buffer_pos = TWDR;
|
||||||
|
// don't acknowledge the master if this memory loctaion is out of bounds
|
||||||
|
if ( slave_buffer_pos >= 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<<TWIE) | (1<<TWINT) | (ack<<TWEA) | (1<<TWEN);
|
||||||
|
}
|
||||||
|
#endif
|
49
keyboards/ergo42/i2c.h
Normal file
49
keyboards/ergo42/i2c.h
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
#ifndef I2C_H
|
||||||
|
#define I2C_H
|
||||||
|
|
||||||
|
#include <stdint.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 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
|
37
keyboards/ergo42/keymaps/default-macOS/config.h
Normal file
37
keyboards/ergo42/keymaps/default-macOS/config.h
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
/*
|
||||||
|
This is the c configuration file for the keymap
|
||||||
|
|
||||||
|
Copyright 2012 Jun Wako <wakojun@gmail.com>
|
||||||
|
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 <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#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
|
98
keyboards/ergo42/keymaps/default-macOS/keymap.c
Normal file
98
keyboards/ergo42/keymaps/default-macOS/keymap.c
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
#include "ergo42.h"
|
||||||
|
#include "action_layer.h"
|
||||||
|
#include "eeconfig.h"
|
||||||
|
|
||||||
|
extern keymap_config_t keymap_config;
|
||||||
|
|
||||||
|
#define BASE 0
|
||||||
|
#define META 1
|
||||||
|
#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
|
||||||
|
* ,------------------------------------------------. ,------------------------------------------------.
|
||||||
|
* | Tab | Q | W | E | R | T | [ | | ] | Y | U | I | O | P | @ |
|
||||||
|
* |------+------+------+------+------+------+------| |-------------+------+------+------+------+------|
|
||||||
|
* | Alt | A | S | D | F | G | ( | | ) | H | J | K | L | ; | : |
|
||||||
|
* |------+------+------+------+------+------+------| |------|------+------+------+------+------+------|
|
||||||
|
* | Sft | Z | X | C | V | B | { | | } | N | M | , | . | / |\/Sft |
|
||||||
|
* |------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
|
||||||
|
* | Ctrl | GUI | App |PrtSc |ESC/ |Space/|Tab/ | |Back |Enter/| Del |PrtSc |=>GAME|=>SYMB| \ |
|
||||||
|
* | | | | |~SYMB |Cmd |Shift | |Space |~META | | | | | |
|
||||||
|
* `------------------------------------------------' `------------------------------------------------'
|
||||||
|
*/
|
||||||
|
|
||||||
|
[BASE] = KEYMAP( \
|
||||||
|
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_RBRC, KC_BSLS, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, \
|
||||||
|
KC_LALT, KC_A, KC_S, KC_D, KC_F, KC_G, S(KC_8), S(KC_9), KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \
|
||||||
|
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, S(KC_RBRC), S(KC_BSLS), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_RO), \
|
||||||
|
KC_LCTRL, KC_LGUI, KC_APP, KC_PSCR, LT(SYMB, KC_ESC), GUI_T(KC_SPC), SFT_T(KC_TAB), KC_BSPC, LT(META, KC_ENT), KC_DELT, KC_PSCR, TG(GAME), TG(SYMB), KC_JYEN \
|
||||||
|
),
|
||||||
|
|
||||||
|
/* META
|
||||||
|
* ,------------------------------------------------. ,------------------------------------------------.
|
||||||
|
* | 1 | 2 | 3 | 4 | 5 | 6 | [ | | ] | 7 | 8 | 9 | 0 | - | ^ |
|
||||||
|
* |------+------+------+------+------+------+------| |-------------+------+------+------+------+------|
|
||||||
|
* | Alt | F1 | |Muhen | Henk | | ( | | ) | Left | Down | Up |Right | | |
|
||||||
|
* |------+------+------+------+------+------+------| |------|------+------+------+------+------+------|
|
||||||
|
* | Sft | F2 | F3 | F4 | F5 | F6 | { | | } | F7 | F8 | F9 | F10 | F11 |\/Sft |
|
||||||
|
* |------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
|
||||||
|
* | Ctrl | GUI | App |PrtSc |ESC/ |Space/|Tab/ | |Back |Enter/| Del |Reset |=>GAME|=>SYMB| \ |
|
||||||
|
* | | | | |~SYMB |Ctrl |Shift | |Space |~META | | | | | |
|
||||||
|
* `------------------------------------------------' `------------------------------------------------'
|
||||||
|
*/
|
||||||
|
|
||||||
|
[META] = KEYMAP( \
|
||||||
|
KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, _______, _______, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, \
|
||||||
|
_______, KC_F1, XXXXXXX, KC_MHEN, KC_HENK, XXXXXXX, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, XXXXXXX, XXXXXXX, \
|
||||||
|
_______, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, _______, _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, SFT_T(KC_RO), \
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, _______, _______, _______ \
|
||||||
|
),
|
||||||
|
|
||||||
|
/* SYMB
|
||||||
|
* ,------------------------------------------------. ,------------------------------------------------.
|
||||||
|
* | ! | " | # | $ | % | & | [ | | ] | ' | ( | ) | ~ | = | ~ |
|
||||||
|
* |------+------+------+------+------+------+------| |-------------+------+------+------+------+------|
|
||||||
|
* | Alt | | | | | | ( | | ) | | | | | + | * |
|
||||||
|
* |------+------+------+------+------+------+------| |------|------+------+------+------+------+------|
|
||||||
|
* | Sft | | | | | | { | | } | | | < | > | ? | \ |
|
||||||
|
* |------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
|
||||||
|
* | Ctrl | GUI | App |PrtSc |ESC/ |Space/|Tab/ | |Back |Enter/| Del |PrtSc |=>GAME|=>SYMB| \ |
|
||||||
|
* | | | | |~SYMB |Ctrl |Shift | |Space |~META | | | | | |
|
||||||
|
* `------------------------------------------------' `------------------------------------------------'
|
||||||
|
*/
|
||||||
|
|
||||||
|
[SYMB] = KEYMAP( \
|
||||||
|
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), S(KC_MINS), S(KC_EQL), \
|
||||||
|
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, S(KC_SCLN), S(KC_QUOT), \
|
||||||
|
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, S(KC_COMM), S(KC_DOT), S(KC_SLSH), S(KC_RO), \
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
|
||||||
|
),
|
||||||
|
|
||||||
|
/* GAME
|
||||||
|
* ,------------------------------------------------. ,------------------------------------------------.
|
||||||
|
* | Tab | Q | W | E | R | T | [ | | ] | Y | U | I | O | P | @ |
|
||||||
|
* |------+------+------+------+------+------+------| |-------------+------+------+------+------+------|
|
||||||
|
* | Alt | A | S | D | F | G | ( | | ) | H | J | K | L | ; | : |
|
||||||
|
* |------+------+------+------+------+------+------| |------|------+------+------+------+------+------|
|
||||||
|
* | Sft | Z | X | C | V | B | { | | } | N | M | , | . | / |\/Sft |
|
||||||
|
* |------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
|
||||||
|
* | Ctrl | GUI | App |PrtSc | ESC |Space |Tab | |Back |Enter | Del |PrtSc |=>GAME|=>SYMB| \ |
|
||||||
|
* | | | | | | | | |Space | | | | | | |
|
||||||
|
* `------------------------------------------------' `------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[GAME] = KEYMAP( \
|
||||||
|
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_RBRC, KC_BSLS, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, \
|
||||||
|
KC_LALT, KC_A, KC_S, KC_D, KC_F, KC_G, S(KC_8), S(KC_9), KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \
|
||||||
|
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, S(KC_RBRC), S(KC_BSLS), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_RO), \
|
||||||
|
KC_LCTRL, KC_LGUI, KC_APP, KC_PSCR, KC_ESC, KC_SPC, KC_TAB, KC_BSPC, KC_ENT, KC_DELT, KC_PSCR, _______, _______, KC_JYEN \
|
||||||
|
)
|
||||||
|
|
||||||
|
};
|
||||||
|
|
37
keyboards/ergo42/keymaps/default/config.h
Normal file
37
keyboards/ergo42/keymaps/default/config.h
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
/*
|
||||||
|
This is the c configuration file for the keymap
|
||||||
|
|
||||||
|
Copyright 2012 Jun Wako <wakojun@gmail.com>
|
||||||
|
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 <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#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
|
98
keyboards/ergo42/keymaps/default/keymap.c
Normal file
98
keyboards/ergo42/keymaps/default/keymap.c
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
#include "ergo42.h"
|
||||||
|
#include "action_layer.h"
|
||||||
|
#include "eeconfig.h"
|
||||||
|
|
||||||
|
extern keymap_config_t keymap_config;
|
||||||
|
|
||||||
|
#define BASE 0
|
||||||
|
#define META 1
|
||||||
|
#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
|
||||||
|
* ,------------------------------------------------. ,------------------------------------------------.
|
||||||
|
* | Tab | Q | W | E | R | T | [ | | ] | Y | U | I | O | P | @ |
|
||||||
|
* |------+------+------+------+------+------+------| |-------------+------+------+------+------+------|
|
||||||
|
* | Alt | A | S | D | F | G | ( | | ) | H | J | K | L | ; | : |
|
||||||
|
* |------+------+------+------+------+------+------| |------|------+------+------+------+------+------|
|
||||||
|
* | Sft | Z | X | C | V | B | { | | } | N | M | , | . | / |\/Sft |
|
||||||
|
* |------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
|
||||||
|
* | Ctrl | GUI | App |PrtSc |ESC/ |Space/|Tab/ | |Back |Enter/| Del |PrtSc |=>GAME|=>SYMB| \ |
|
||||||
|
* | | | | |~SYMB |RCtrl |Shift | |Space |~META | | | | | |
|
||||||
|
* `------------------------------------------------' `------------------------------------------------'
|
||||||
|
*/
|
||||||
|
|
||||||
|
[BASE] = KEYMAP( \
|
||||||
|
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_RBRC, KC_BSLS, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, \
|
||||||
|
KC_LALT, KC_A, KC_S, KC_D, KC_F, KC_G, S(KC_8), S(KC_9), KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \
|
||||||
|
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, S(KC_RBRC), S(KC_BSLS), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_RO), \
|
||||||
|
KC_LCTRL, KC_LGUI, KC_APP, KC_PSCR, LT(SYMB, KC_ESC), RCTL_T(KC_SPC), SFT_T(KC_TAB), KC_BSPC, LT(META, KC_ENT), KC_DELT, KC_PSCR, TG(GAME), TG(SYMB), KC_JYEN \
|
||||||
|
),
|
||||||
|
|
||||||
|
/* META
|
||||||
|
* ,------------------------------------------------. ,------------------------------------------------.
|
||||||
|
* | 1 | 2 | 3 | 4 | 5 | 6 | [ | | ] | 7 | 8 | 9 | 0 | - | ^ |
|
||||||
|
* |------+------+------+------+------+------+------| |-------------+------+------+------+------+------|
|
||||||
|
* | Alt | F1 | |Muhen | Henk | | ( | | ) | Left | Down | Up |Right | | |
|
||||||
|
* |------+------+------+------+------+------+------| |------|------+------+------+------+------+------|
|
||||||
|
* | Sft | F2 | F3 | F4 | F5 | F6 | { | | } | F7 | F8 | F9 | F10 | F11 |\/Sft |
|
||||||
|
* |------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
|
||||||
|
* | Ctrl | GUI | App |PrtSc |ESC/ |Space/|Tab/ | |Back |Enter/| Del |Reset |=>GAME|=>SYMB| \ |
|
||||||
|
* | | | | |~SYMB |RCtrl |Shift | |Space |~META | | | | | |
|
||||||
|
* `------------------------------------------------' `------------------------------------------------'
|
||||||
|
*/
|
||||||
|
|
||||||
|
[META] = KEYMAP( \
|
||||||
|
KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, _______, _______, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, \
|
||||||
|
_______, KC_F1, XXXXXXX, KC_MHEN, KC_HENK, XXXXXXX, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, XXXXXXX, XXXXXXX, \
|
||||||
|
_______, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, _______, _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, SFT_T(KC_RO), \
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, _______, _______, _______ \
|
||||||
|
),
|
||||||
|
|
||||||
|
/* SYMB
|
||||||
|
* ,------------------------------------------------. ,------------------------------------------------.
|
||||||
|
* | ! | " | # | $ | % | & | [ | | ] | ' | ( | ) | ~ | = | ~ |
|
||||||
|
* |------+------+------+------+------+------+------| |-------------+------+------+------+------+------|
|
||||||
|
* | Alt | | | | | | ( | | ) | | | | | + | * |
|
||||||
|
* |------+------+------+------+------+------+------| |------|------+------+------+------+------+------|
|
||||||
|
* | Sft | | | | | | { | | } | | | < | > | ? | \ |
|
||||||
|
* |------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
|
||||||
|
* | Ctrl | GUI | App |PrtSc |ESC/ |Space/|Tab/ | |Back |Enter/| Del |PrtSc |=>GAME|=>SYMB| \ |
|
||||||
|
* | | | | |~SYMB |RCtrl |Shift | |Space |~META | | | | | |
|
||||||
|
* `------------------------------------------------' `------------------------------------------------'
|
||||||
|
*/
|
||||||
|
|
||||||
|
[SYMB] = KEYMAP( \
|
||||||
|
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), S(KC_MINS), S(KC_EQL), \
|
||||||
|
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, S(KC_SCLN), S(KC_QUOT), \
|
||||||
|
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, S(KC_COMM), S(KC_DOT), S(KC_SLSH), S(KC_RO), \
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
|
||||||
|
),
|
||||||
|
|
||||||
|
/* GAME
|
||||||
|
* ,------------------------------------------------. ,------------------------------------------------.
|
||||||
|
* | Tab | Q | W | E | R | T | [ | | ] | Y | U | I | O | P | @ |
|
||||||
|
* |------+------+------+------+------+------+------| |-------------+------+------+------+------+------|
|
||||||
|
* | Alt | A | S | D | F | G | ( | | ) | H | J | K | L | ; | : |
|
||||||
|
* |------+------+------+------+------+------+------| |------|------+------+------+------+------+------|
|
||||||
|
* | Sft | Z | X | C | V | B | { | | } | N | M | , | . | / |\/Sft |
|
||||||
|
* |------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
|
||||||
|
* | Ctrl | GUI | App |PrtSc | ESC |Space |Tab | |Back |Enter | Del |PrtSc |=>GAME|=>SYMB| \ |
|
||||||
|
* | | | | | | | | |Space | | | | | | |
|
||||||
|
* `------------------------------------------------' `------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[GAME] = KEYMAP( \
|
||||||
|
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_RBRC, KC_BSLS, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, \
|
||||||
|
KC_LALT, KC_A, KC_S, KC_D, KC_F, KC_G, S(KC_8), S(KC_9), KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \
|
||||||
|
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, S(KC_RBRC), S(KC_BSLS), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_RO), \
|
||||||
|
KC_LCTRL, KC_LGUI, KC_APP, KC_PSCR, KC_ESC, KC_SPC, KC_TAB, KC_BSPC, KC_ENT, KC_DELT, KC_PSCR, _______, _______, KC_JYEN \
|
||||||
|
)
|
||||||
|
|
||||||
|
};
|
||||||
|
|
3
keyboards/ergo42/keymaps/default/rules.mk
Normal file
3
keyboards/ergo42/keymaps/default/rules.mk
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
ifndef QUANTUM_DIR
|
||||||
|
include ../../../../Makefile
|
||||||
|
endif
|
469
keyboards/ergo42/matrix.c
Normal file
469
keyboards/ergo42/matrix.c
Normal file
@@ -0,0 +1,469 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2012 Jun Wako <wakojun@gmail.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 <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* scan matrix
|
||||||
|
*/
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include <avr/io.h>
|
||||||
|
#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_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)
|
||||||
|
{
|
||||||
|
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;
|
||||||
|
|
||||||
|
// 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<<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;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if (DIODE_DIRECTION == COL2ROW)
|
||||||
|
|
||||||
|
static void init_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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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
|
16
keyboards/ergo42/readme.md
Normal file
16
keyboards/ergo42/readme.md
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# Ergo42
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
__The Answer to the Ultimate Question of Life, the Universe, and at least Keyboards.__
|
||||||
|
A split 7x4 ortholinear keyboard. [Hardware project repo](https://github.com/Biacco42/Ergo42)
|
||||||
|
|
||||||
|
Keyboard Maintainer: [Biacco42](https://github.com/Biacco42) [@Biacco42](https://twitter.com/Biacco42)
|
||||||
|
Hardware Supported: Ergo42 PCB, Pro Micro ATmega32u4
|
||||||
|
Hardware Availability: [Ergo42 PCB and case](https://github.com/Biacco42/Ergo42)
|
||||||
|
|
||||||
|
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.
|
93
keyboards/ergo42/rev1/config.h
Normal file
93
keyboards/ergo42/rev1/config.h
Normal file
@@ -0,0 +1,93 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2012 Jun Wako <wakojun@gmail.com>
|
||||||
|
Copyright 2015 Jack Humbert
|
||||||
|
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 <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef REV1_CONFIG_H
|
||||||
|
#define REV1_CONFIG_H
|
||||||
|
|
||||||
|
#include "config_common.h"
|
||||||
|
|
||||||
|
/* USB Device descriptor parameter */
|
||||||
|
#define VENDOR_ID 0xBC42
|
||||||
|
#define PRODUCT_ID 0x0042
|
||||||
|
#define DEVICE_VER 0x0100
|
||||||
|
#define MANUFACTURER Biacco42
|
||||||
|
#define PRODUCT Ergo42
|
||||||
|
#define DESCRIPTION The Answer to the Ultimate Question of Life, the Universe, and at least Keyboards
|
||||||
|
|
||||||
|
/* key matrix size */
|
||||||
|
// Rows are doubled-up
|
||||||
|
#define MATRIX_ROWS 8
|
||||||
|
#define MATRIX_COLS 7
|
||||||
|
|
||||||
|
// wiring of each half
|
||||||
|
#define MATRIX_ROW_PINS { D7, E6, B4, B5 }
|
||||||
|
#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 CATERINA_BOOTLOADER
|
||||||
|
|
||||||
|
/* define tapping term */
|
||||||
|
#define TAPPING_TERM 120
|
||||||
|
|
||||||
|
/* 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 RGBLIGHT_TIMER
|
||||||
|
#define RGBLED_NUM 12 // Number of LEDs
|
||||||
|
#define ws2812_PORTREG PORTD
|
||||||
|
#define ws2812_DDRREG DDRD
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 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
|
39
keyboards/ergo42/rev1/rev1.c
Normal file
39
keyboards/ergo42/rev1/rev1.c
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
#include "ergo42.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
|
||||||
|
}
|
62
keyboards/ergo42/rev1/rev1.h
Normal file
62
keyboards/ergo42/rev1/rev1.h
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
#ifndef REV1_H
|
||||||
|
#define REV1_H
|
||||||
|
|
||||||
|
#include "ergo42.h"
|
||||||
|
|
||||||
|
//void promicro_bootloader_jmp(bool program);
|
||||||
|
#include "quantum.h"
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef USE_I2C
|
||||||
|
#include <stddef.h>
|
||||||
|
#ifdef __AVR__
|
||||||
|
#include <avr/io.h>
|
||||||
|
#include <avr/interrupt.h>
|
||||||
|
#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 KEYMAP( \
|
||||||
|
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 } \
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
// Keymap with right side flipped
|
||||||
|
// (TRRS jack on both halves are to the right)
|
||||||
|
#define KEYMAP( \
|
||||||
|
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 }, \
|
||||||
|
{ 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 } \
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define LAYOUT_ortho_4x14 KEYMAP
|
||||||
|
|
||||||
|
#endif
|
1
keyboards/ergo42/rev1/rules.mk
Normal file
1
keyboards/ergo42/rev1/rules.mk
Normal file
@@ -0,0 +1 @@
|
|||||||
|
BACKLIGHT_ENABLE = no
|
80
keyboards/ergo42/rules.mk
Normal file
80
keyboards/ergo42/rules.mk
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
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
|
||||||
|
|
||||||
|
|
||||||
|
# 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 = 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 this with audio at the same time.
|
||||||
|
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
|
||||||
|
|
||||||
|
LAYOUTS = ortho_4x14
|
||||||
|
|
||||||
|
DEFAULT_FOLDER = ergo42/rev1
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user