mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-08-09 17:18:40 +00:00
Compare commits
54 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
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 |
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 $(TMK_PATH)/protocol.mk
|
||||
include $(TMK_PATH)/common.mk
|
||||
include bootloader.mk
|
||||
|
||||
SRC += $(TMK_COMMON_SRC)
|
||||
OPT_DEFS += $(TMK_COMMON_DEFS)
|
||||
@@ -266,10 +267,10 @@ $(KEYBOARD_OUTPUT)_INC := $(PROJECT_INC) $(GFXINC)
|
||||
$(KEYBOARD_OUTPUT)_CONFIG := $(PROJECT_CONFIG)
|
||||
|
||||
# Default target.
|
||||
all: build sizeafter
|
||||
all: build check-size
|
||||
|
||||
# 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: lib
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
* [Getting started](README.md)
|
||||
* [QMK Introduction](getting_started_introduction.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)
|
||||
* [Flashing instructions](flashing.md)
|
||||
* [Contributing to QMK](contributing.md)
|
||||
@@ -26,6 +26,7 @@
|
||||
* [Backlight](feature_backlight.md)
|
||||
* [Bootmagic](feature_bootmagic.md)
|
||||
* [Dynamic Macros](feature_dynamic_macros.md)
|
||||
* [Grave Escape](feature_grave_escape.md)
|
||||
* [Key Lock](feature_key_lock.md)
|
||||
* [Layouts](feature_layouts.md)
|
||||
* [Leader Key](feature_leader_key.md)
|
||||
@@ -70,7 +71,6 @@
|
||||
* For Makers and Modders
|
||||
* [Hand Wiring Guide](hand_wire.md)
|
||||
* [ISP flashing guide](isp_flashing_guide.md)
|
||||
* [Modding your keyboard](modding_your_keyboard.md)
|
||||
|
||||
* For a Deeper Understanding
|
||||
* [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
|
||||
|
||||
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
|
||||
|
||||
@@ -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
|
||||
* `#define IGNORE_MOD_TAP_INTERRUPT`
|
||||
* 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
|
||||
|
||||
@@ -170,7 +181,13 @@ This is a [make](https://www.gnu.org/software/make/manual/make.html) file that i
|
||||
* `ARCH = AVR8`
|
||||
* `F_USB = $(F_CPU)`
|
||||
* `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
|
||||
|
||||
|
@@ -122,7 +122,7 @@ We also ask that you follow these guidelines:
|
||||
|
||||
## 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)
|
||||
* [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.
|
||||
|
||||
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
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
# 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
|
||||
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
|
||||
|
||||
|
||||
## 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 `~`.
|
||||
|
||||
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.
|
||||
See the [Grave Escape](feature_grave_escape.md) feature.
|
||||
|
||||
## 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**.
|
||||
|
@@ -15,7 +15,7 @@ This will allow you to use `FN_CAPS` and `ALT_TAB` in your `KEYMAP()`, keeping i
|
||||
|
||||
### 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
|
||||
|
||||
@@ -131,7 +131,7 @@ We've added shortcuts to make common modifier/tap (mod-tap) mappings more compac
|
||||
|
||||
# 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.
|
||||
|
||||
|
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.
|
||||
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
|
||||
|
||||
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:
|
||||
|
||||
* `KEYBOARD_<folder1>_<folder2>`
|
||||
@@ -73,4 +69,4 @@ For example:
|
||||
#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.
|
||||
|
@@ -96,6 +96,7 @@ There's also a couple of mod shortcuts you can use:
|
||||
* `SS_LCTRL(string)`
|
||||
* `SS_LGUI(string)`
|
||||
* `SS_LALT(string)`
|
||||
* `SS_LSFT(string)`
|
||||
|
||||
These press the respective modifier, send the supplied string and then release the modifier.
|
||||
They can be used like this:
|
||||
|
@@ -87,8 +87,8 @@ These control the RGB Lighting functionality.
|
||||
| Long Name | Short Name | Description |
|
||||
|-----------|------------|-------------|
|
||||
||`RGB_TOG`|toggle on/off|
|
||||
||`RGB_MOD`|cycle through modes|
|
||||
||`RGB_SMOD`|cycle through modes, use reverse direction when shift is hold|
|
||||
|`RGB_MODE_FORWARD`|`RGB_MOD`|cycle through modes, use reverse direction when shift is held|
|
||||
|`RGB_MODE_REVERSE`|`RGB_RMOD`|cycle through modes in reverse (also suppost shift to go forward)|
|
||||
||`RGB_HUI`|hue increase|
|
||||
||`RGB_HUD`|hue decrease|
|
||||
||`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_GRADIENT`|`RGB_M_G`| Switch to the static gradient mode |
|
||||
|
||||
note: for backwards compatibility, `RGB_SMOD` is an alias for `RGB_MOD`.
|
||||
|
||||
## Hardware Modification
|
||||
|
||||

|
||||
|
@@ -73,8 +73,15 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
switch (keycode) {
|
||||
case KC_MAKE:
|
||||
if (!record->event.pressed) {
|
||||
SEND_STRING("make " QMK_KEYBOARD ":" QMK_KEYMAP);
|
||||
SEND_STRING(SS_TAP(X_ENTER));
|
||||
SEND_STRING("make " QMK_KEYBOARD ":" QMK_KEYMAP
|
||||
#if (defined(BOOTLOADER_DFU) || defined(BOOTLOADER_LUFA_DFU) || defined(BOOTLOADER_QMK_DFU))
|
||||
":dfu "
|
||||
#elif defined(BOOTLOADER_HALFKAY)
|
||||
":teensy "
|
||||
#elif defined(BOOTLOADER_CATERINA)
|
||||
":avrdude "
|
||||
#endif
|
||||
SS_TAP(X_ENTER));
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
@@ -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.
|
||||
|
||||
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.
|
||||
* [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.
|
||||
* [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.
|
||||
* [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.
|
||||
|
@@ -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.
|
||||
|
||||
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
|
||||
|
||||
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:
|
||||
|
||||
@@ -26,15 +34,32 @@ or:
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
These bootloaders are usually 4096 bytes for the atmega32u4 chip.
|
||||
# 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
|
||||
|
||||
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).
|
||||
|
||||
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:
|
||||
|
||||
|
@@ -13,7 +13,7 @@ The full syntax of the `make` command is `<keyboard_folder>:<keymap>:<target>`,
|
||||
|
||||
The `<target>` means the following
|
||||
* 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.
|
||||
* **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.
|
||||
|
@@ -41,7 +41,7 @@ A macro which has been recorded on the keyboard and which will be lost when the
|
||||
## Eclipse
|
||||
An IDE that is popular with many C developers.
|
||||
|
||||
* [Eclipse Setup Instructions](eclipse.html)
|
||||
* [Eclipse Setup Instructions](eclipse.md)
|
||||
|
||||
## Firmware
|
||||
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)
|
||||
|
||||
## 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
|
||||
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
|
||||
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
|
||||
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
|
||||
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)
|
||||
A term that applies to keyboards that are capable of reporting any number of key-presses at once.
|
||||
|
||||
## 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
|
||||
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
|
||||
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
|
||||
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`
|
||||
|
||||
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:
|
||||
|
||||
|
@@ -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:
|
||||
|
||||
* [QMK Overview](qmk_overview.md)
|
||||
* [Introduction](getting_started_introduction.md)
|
||||
* [How Keyboards Work](how_keyboards_work.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
|
||||
else
|
||||
OPT_DEFS += -DATREUS_ASTAR
|
||||
OPT_DEFS += -DCATERINA_BOOTLOADER
|
||||
ATREUS_UPLOAD_COMMAND = while [ ! -r $(USB) ]; do sleep 1; done; \
|
||||
avrdude -p $(MCU) -c avr109 -U flash:w:$(TARGET).hex -P $(USB)
|
||||
endif
|
||||
@@ -27,7 +26,6 @@ MCU = atmega32u4
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
@@ -47,19 +45,20 @@ ARCH = AVR8
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Bootloader
|
||||
# This definition is optional, and if your keyboard supports multiple bootloaders of
|
||||
# different sizes, comment this out, and the correct address will be loaded
|
||||
# automatically (+60). See bootloader.mk for all options.
|
||||
ifdef TEENSY2
|
||||
BOOTLOADER = halfkay
|
||||
else
|
||||
BOOTLOADER = caterina
|
||||
endif
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
|
||||
|
||||
# Build Options
|
||||
# comment out to disable the options.
|
||||
#
|
||||
|
@@ -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_COL_PINS { F4, F5, F6, F7, B1, B3, B2, B6, B5, B4, E6, D7, C6 }
|
||||
|
||||
#define CATERINA_BOOTLOADER
|
||||
|
||||
/* COL2ROW or 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.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Bootloader
|
||||
# This definition is optional, and if your keyboard supports multiple bootloaders of
|
||||
# different sizes, comment this out, and the correct address will be loaded
|
||||
# automatically (+60). See bootloader.mk for all options.
|
||||
BOOTLOADER = caterina
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# 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
|
||||
|
@@ -41,7 +41,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define RGBLIGHT_ANIMATIONS
|
||||
|
||||
#define NO_UART 1
|
||||
#define BOOTLOADHID_BOOTLOADER 1
|
||||
|
||||
/* key combination for command */
|
||||
#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)))
|
||||
|
@@ -24,6 +24,12 @@ 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
|
||||
@@ -35,7 +41,6 @@ RGBLIGHT_ENABLE = yes
|
||||
RGBLIGHT_CUSTOM_DRIVER = yes
|
||||
|
||||
OPT_DEFS = -DDEBUG_LEVEL=0
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=2048
|
||||
|
||||
# custom matrix setup
|
||||
CUSTOM_MATRIX = yes
|
||||
|
@@ -34,7 +34,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define RGBLIGHT_ANIMATIONS
|
||||
|
||||
#define NO_UART 1
|
||||
#define BOOTLOADHID_BOOTLOADER 1
|
||||
|
||||
/* key combination for command */
|
||||
#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)))
|
||||
|
@@ -24,6 +24,12 @@ 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
|
||||
@@ -35,7 +41,6 @@ RGBLIGHT_ENABLE = yes
|
||||
RGBLIGHT_CUSTOM_DRIVER = yes
|
||||
|
||||
OPT_DEFS = -DDEBUG_LEVEL=0
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=2048
|
||||
|
||||
# custom matrix setup
|
||||
CUSTOM_MATRIX = yes
|
||||
|
@@ -1,6 +1,5 @@
|
||||
|
||||
OPT_DEFS += -DCHIMERA_ORTHO_PROMICRO
|
||||
OPT_DEFS += -DCATERINA_BOOTLOADER
|
||||
CHIMERA_ORTHO_UPLOAD_COMMAND = while [ ! -r $(USB) ]; do sleep 1; done; \
|
||||
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.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Bootloader
|
||||
# This definition is optional, and if your keyboard supports multiple bootloaders of
|
||||
# different sizes, comment this out, and the correct address will be loaded
|
||||
# automatically (+60). See bootloader.mk for all options.
|
||||
BOOTLOADER = caterina
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
|
||||
|
||||
# Build Options
|
||||
# comment out to disable the options.
|
||||
#
|
||||
|
@@ -1,4 +1,3 @@
|
||||
BLUETOOTH = AdafruitBLE
|
||||
ADAFRUIT_BLE_ENABLE = yes
|
||||
OPT_DEFS += -DCATERINA_BOOTLOADER
|
||||
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.
|
||||
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
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
|
||||
|
||||
# Build Options
|
||||
# comment out to disable the options.
|
||||
#
|
||||
|
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.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Bootloader
|
||||
# This definition is optional, and if your keyboard supports multiple bootloaders of
|
||||
# different sizes, comment this out, and the correct address will be loaded
|
||||
# automatically (+60). See bootloader.mk for all options.
|
||||
BOOTLOADER = caterina
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# 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
|
||||
|
@@ -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_COL_PINS { B6, B5, B4, E6, D7, C6, D4, D1}
|
||||
|
||||
#define CATERINA_BOOTLOADER
|
||||
|
||||
/* COL2ROW or ROW2COL */
|
||||
#define DIODE_DIRECTION COL2ROW
|
||||
|
||||
|
@@ -1,6 +1,5 @@
|
||||
|
||||
OPT_DEFS += -DDICHOTEMY_PROMICRO
|
||||
OPT_DEFS += -DCATERINA_BOOTLOADER
|
||||
DICHOTEMY_UPLOAD_COMMAND = while [ ! -r $(USB) ]; do sleep 1; done; \
|
||||
avrdude -p $(MCU) -c avr109 -U flash:w:$(TARGET).hex -P $(USB)
|
||||
|
||||
@@ -25,8 +24,6 @@ MCU = atmega32u4
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# 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.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Bootloader
|
||||
# This definition is optional, and if your keyboard supports multiple bootloaders of
|
||||
# different sizes, comment this out, and the correct address will be loaded
|
||||
# automatically (+60). See bootloader.mk for all options.
|
||||
BOOTLOADER = caterina
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
|
||||
|
||||
# Build Options
|
||||
# comment out to disable the options.
|
||||
#
|
||||
|
@@ -31,8 +31,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define MATRIX_ROWS 4
|
||||
#define MATRIX_COLS 14
|
||||
|
||||
#define CATERINA_BOOTLOADER
|
||||
|
||||
/* COL2ROW or ROW2COL */
|
||||
#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.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Bootloader
|
||||
# This definition is optional, and if your keyboard supports multiple bootloaders of
|
||||
# different sizes, comment this out, and the correct address will be loaded
|
||||
# automatically (+60). See bootloader.mk for all options.
|
||||
BOOTLOADER = caterina
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# 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
|
||||
|
@@ -31,6 +31,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/* key matrix size */
|
||||
#define MATRIX_ROWS 14
|
||||
#define MATRIX_ROWS_PER_SIDE (MATRIX_ROWS / 2)
|
||||
#define MATRIX_COLS 6
|
||||
|
||||
#define MOUSEKEY_INTERVAL 20
|
||||
@@ -61,8 +62,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
/* number of backlight levels */
|
||||
#define BACKLIGHT_LEVELS 3
|
||||
|
||||
#ifndef LED_BRIGHTNESS_LO
|
||||
#define LED_BRIGHTNESS_LO 15
|
||||
#endif
|
||||
#ifndef LED_BRIGHTNESS_HI
|
||||
#define LED_BRIGHTNESS_HI 255
|
||||
#endif
|
||||
#define LED_BRIGHTNESS_DEFAULT (LED_BRIGHTNESS_HI)
|
||||
|
||||
/* ws2812 RGB LED */
|
||||
#define RGB_DI_PIN D7
|
||||
@@ -80,7 +86,16 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#define RGBW 1
|
||||
|
||||
/* Set 0 if debouncing isn't needed */
|
||||
/* "debounce" is measured in keyboard scans. Some users reported
|
||||
* needing values as high as 15, which was at the time around 50ms.
|
||||
* If you don't define it here, the matrix code will default to
|
||||
* 5, which is now closer to 10ms, but still plenty according to
|
||||
* manufacturer specs.
|
||||
*
|
||||
* Default is quite high, because of reports with some production
|
||||
* runs seeming to need it. This may change when configuration for
|
||||
* this is more directly exposed.
|
||||
*/
|
||||
#define DEBOUNCE 15
|
||||
|
||||
#define PREVENT_STUCK_MODIFIERS
|
||||
|
@@ -38,7 +38,7 @@ void matrix_init_kb(void) {
|
||||
PORTB &= ~(1<<4); // set B(4) internal pull-up disabled
|
||||
|
||||
// unused pins - C7, D4, D5, D7, E6
|
||||
// set as input with internal pull-ip enabled
|
||||
// set as input with internal pull-up enabled
|
||||
DDRC &= ~(1<<7);
|
||||
DDRD &= ~(1<<5 | 1<<4);
|
||||
DDRE &= ~(1<<6);
|
||||
@@ -54,7 +54,7 @@ void matrix_init_kb(void) {
|
||||
void ergodox_blink_all_leds(void)
|
||||
{
|
||||
ergodox_led_all_off();
|
||||
ergodox_led_all_set(LED_BRIGHTNESS_HI);
|
||||
ergodox_led_all_set(LED_BRIGHTNESS_DEFAULT);
|
||||
ergodox_right_led_1_on();
|
||||
_delay_ms(50);
|
||||
ergodox_right_led_2_on();
|
||||
|
@@ -30,8 +30,12 @@ void ergodox_blink_all_leds(void);
|
||||
uint8_t init_mcp23018(void);
|
||||
uint8_t ergodox_left_leds_update(void);
|
||||
|
||||
#ifndef LED_BRIGHTNESS_LO
|
||||
#define LED_BRIGHTNESS_LO 15
|
||||
#endif
|
||||
#ifndef LED_BRIGHTNESS_LO
|
||||
#define LED_BRIGHTNESS_HI 255
|
||||
#endif
|
||||
|
||||
|
||||
inline void ergodox_board_led_on(void) { DDRD |= (1<<6); PORTD |= (1<<6); }
|
||||
|
@@ -244,9 +244,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
KC_MAKE, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_GRAVE,
|
||||
KC_RESET, KC_PERC, KC_CIRC, KC_LBRACKET,KC_RBRACKET,KC_TILD, KC_COLEMAK,
|
||||
KC_TRNS, KC_AMPR, KC_ASTR, KC_COLN, KC_SCOLON,
|
||||
KC_TRNS, KC_TRNS,
|
||||
KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
RGB_SMOD, KC_RGB_T,
|
||||
RGB_HUI,
|
||||
RGB_M_R, RGB_M_SW, RGB_HUD,
|
||||
|
||||
KC_QWERTY, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
|
||||
KC_DVORAK, KC_KP_PLUS, KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_ASTERISK, KC_F12,
|
||||
|
@@ -47,7 +47,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* Now it's only 317 scans/second, or about 3.15 msec/scan.
|
||||
* According to Cherry specs, debouncing time is 5 msec.
|
||||
*
|
||||
* And so, there is no sense to have DEBOUNCE higher than 2.
|
||||
* However, some switches seem to have higher debouncing requirements, or
|
||||
* something else might be wrong. (Also, the scan speed has improved since
|
||||
* that comment was written.)
|
||||
*/
|
||||
|
||||
#ifndef DEBOUNCE
|
||||
@@ -203,16 +205,23 @@ uint8_t matrix_scan(void)
|
||||
#endif
|
||||
|
||||
#ifdef LEFT_LEDS
|
||||
mcp23018_status = ergodox_left_leds_update();
|
||||
mcp23018_status = ergodox_left_leds_update();
|
||||
#endif // LEFT_LEDS
|
||||
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
|
||||
for (uint8_t i = 0; i < MATRIX_ROWS_PER_SIDE; i++) {
|
||||
select_row(i);
|
||||
wait_us(30); // without this wait read unstable value.
|
||||
// and select on left hand
|
||||
select_row(i + MATRIX_ROWS_PER_SIDE);
|
||||
// we don't need a 30us delay anymore, because selecting a
|
||||
// left-hand row requires more than 30us for i2c.
|
||||
matrix_row_t mask = debounce_mask(i);
|
||||
matrix_row_t cols = (read_cols(i) & mask) | (matrix[i] & ~mask);
|
||||
debounce_report(cols ^ matrix[i], i);
|
||||
matrix[i] = cols;
|
||||
|
||||
// grab cols from right hand
|
||||
mask = debounce_mask(i + MATRIX_ROWS_PER_SIDE);
|
||||
cols = (read_cols(i + MATRIX_ROWS_PER_SIDE) & mask) | (matrix[i + MATRIX_ROWS_PER_SIDE] & ~mask);
|
||||
debounce_report(cols ^ matrix[i + MATRIX_ROWS_PER_SIDE], i + MATRIX_ROWS_PER_SIDE);
|
||||
matrix[i + MATRIX_ROWS_PER_SIDE] = cols;
|
||||
unselect_rows();
|
||||
}
|
||||
|
||||
@@ -295,14 +304,13 @@ static matrix_row_t read_cols(uint8_t row)
|
||||
return data;
|
||||
}
|
||||
} else {
|
||||
// read from teensy
|
||||
return
|
||||
(PINF&(1<<0) ? 0 : (1<<0)) |
|
||||
(PINF&(1<<1) ? 0 : (1<<1)) |
|
||||
(PINF&(1<<4) ? 0 : (1<<2)) |
|
||||
(PINF&(1<<5) ? 0 : (1<<3)) |
|
||||
(PINF&(1<<6) ? 0 : (1<<4)) |
|
||||
(PINF&(1<<7) ? 0 : (1<<5)) ;
|
||||
/* read from teensy
|
||||
* bitmask is 0b11110011, but we want those all
|
||||
* in the lower six bits.
|
||||
* we'll return 1s for the top two, but that's harmless.
|
||||
*/
|
||||
|
||||
return ~((PINF & 0x03) | ((PINF & 0xF0) >> 2));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -325,9 +333,7 @@ static void unselect_rows(void)
|
||||
// set all rows hi-Z : 1
|
||||
mcp23018_status = i2c_start(I2C_ADDR_WRITE); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_write(GPIOA); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_write( 0xFF
|
||||
& ~(0<<7)
|
||||
); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_write(0xFF); if (mcp23018_status) goto out;
|
||||
out:
|
||||
i2c_stop();
|
||||
}
|
||||
@@ -353,9 +359,7 @@ static void select_row(uint8_t row)
|
||||
// set other rows hi-Z : 1
|
||||
mcp23018_status = i2c_start(I2C_ADDR_WRITE); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_write(GPIOA); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_write( 0xFF & ~(1<<row)
|
||||
& ~(0<<7)
|
||||
); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_write(0xFF & ~(1<<row)); if (mcp23018_status) goto out;
|
||||
out:
|
||||
i2c_stop();
|
||||
}
|
||||
|
@@ -31,3 +31,8 @@ To flash with ´teensy-loader-cli´:
|
||||
|
||||
- Press the Reset button by inserting a paperclip gently into the reset hole
|
||||
in the top right corder.
|
||||
|
||||
## Settings
|
||||
|
||||
You may want to enable QMK_KEYS_PER_SCAN because the Ergodox has a relatively
|
||||
slow scan rate.
|
||||
|
@@ -54,18 +54,15 @@ ARCH = AVR8
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Bootloader
|
||||
# This definition is optional, and if your keyboard supports multiple bootloaders of
|
||||
# different sizes, comment this out, and the correct address will be loaded
|
||||
# automatically (+60). See bootloader.mk for all options.
|
||||
BOOTLOADER = halfkay
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=512
|
||||
|
||||
# If you have Left LEDs (see
|
||||
# https://geekhack.org/index.php?topic=22780.msg873819#msg873819 for
|
||||
# details), include the following define:
|
||||
|
156
keyboards/fc660c/README.md
Normal file
156
keyboards/fc660c/README.md
Normal file
@@ -0,0 +1,156 @@
|
||||
FC660C Alt Controller
|
||||
=================
|
||||
|
||||
This file and the entire QMK port of this board are based on its TMK implementation: https://github.com/tmk/tmk_keyboard/tree/master/keyboard/fc980c
|
||||
|
||||
------------
|
||||
|
||||
- Keyboard Maintainer: [Balz Guenat](https://github.com/BalzGuenat)
|
||||
- Hardware Supported: Hasu's Alt Controller (see below)
|
||||
- Hardware Availability: https://geekhack.org/index.php?topic=90317.0
|
||||
|
||||
Make example for this keyboard (after setting up your build environment):
|
||||
|
||||
make fc660c:default
|
||||
|
||||
See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information.
|
||||
|
||||
To flash the firmware, press the reset button on the controller and run:
|
||||
|
||||
sudo make fc660c:default:dfu
|
||||
|
||||
--------
|
||||
|
||||
Thread on Geekhack: https://geekhack.org/index.php?topic=88439.0
|
||||
|
||||
Also: https://geekhack.org/index.php?topic=88720.0
|
||||
|
||||
Pinouts
|
||||
-------
|
||||
|
||||
|Switch |Controller |
|
||||
| board | board |Description |Schematic |ATmega32u4
|
||||
|--------|-----------|--------------------------------------|-----------|------------
|
||||
| 1 |20 | FG |FG |GND
|
||||
| 2 |19 | GND |GND |GND
|
||||
| 3 |18 | GND |GND |GND
|
||||
| 4 |17 | 3.3V |V33 |3.3V/5V
|
||||
| 5 |16 | 5V |Vcc |5V
|
||||
| 6 |15 |*Z6-TP1684-4-HYS(o) |FBSTB |PC7
|
||||
| 7 |14 |*Z6-TP1684-2-KEY(i) |OUT |PC6
|
||||
| 8 |13 |*Z2-AD5258-5-SCL(I2C) |SCL |PD0(TWI)
|
||||
| 9 |12 |*Z2-AD5258-4-SDA(I2C) |SDA |PD1(TWI)
|
||||
|10 |11 |*Z4-LV4051A-6-~EN(Col 0-7) |INH_1 |PB4
|
||||
|11 |10 |*Z5-LV4051A-6-~EN(Col 8-F) |INH_2 |PB3
|
||||
|12 | 9 |+Z7-LV07A-5 (LV4051A-9-C) |SEL_C |PB2
|
||||
|13 | 8 |+Z7-LV07A-1 (LV4051A-10-B) |SEL_B |PB1
|
||||
|14 | 7 |+Z7-LV07A-3 (LV4051A-11-A) |SEL_A |PB0
|
||||
|15 | 6 |+Z3-LVC138A-3-C |COL4 |PD6
|
||||
|16 | 5 |+Z3-LVC138A-2-B |COL3 |PD5
|
||||
|17 | 4 |+Z3-LVC138A-1-A |COL2 |PD4
|
||||
|18 | 3 |+Z3-LVC138A-4-~G2A Z6-TP1684-5-~EN |COL1 |PD7
|
||||
|19 | 2 |+Z7-LV07A-11-~InsertLED |LED1 |PB5
|
||||
|20 | 1 |+Z7-LV07A-13-~CapsLED |LED2 |PB6
|
||||
|
||||
```
|
||||
* 5V intferface
|
||||
+ 3.3V interface
|
||||
```
|
||||
|
||||
- Connector on Switch board: https://i.imgur.com/Zi89xO5.jpg
|
||||
- Connector on Controller board: https://i.imgur.com/9SZUzYo.jpg
|
||||
|
||||
|
||||
Key Matrix
|
||||
----------
|
||||
Row5-7 have no key, you can omit scaning on those lines. Topre original controller scans those rows for some reason.
|
||||
|
||||
| |0 |1 |2 |3 |4 |5 |6 |7 |8 |9 |A |B |C |D |E |F |
|
||||
|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|
|
||||
| 0|Q |W |E |Tab |R |U |T |Y |O |P |[ |I |] | |\ |Del |
|
||||
| 1|1 |2 |3 |Esc |4 |7 |5 |6 |9 |0 |- |8 |= | |BSpc|Ins |
|
||||
| 2| |LWin|LAlt|LCtl| | | |Spc |RAlt| |RCtl| |Fn |Down|Left|Rght|
|
||||
| 3| |Z |X |LSft|C |N |V |B |, |. |/ |M |RSft|Up | | |
|
||||
| 4|A |S |D |Caps|F |J |G |H |L |; |' |K | | |Entr| |
|
||||
| 5| | | | | | | | | | | | | | | | |
|
||||
| 6| | | | | | | | | | | | | | | | |
|
||||
| 7| | | | | | | | | | | | | | | | |
|
||||
|
||||
Logic analyzer pics:
|
||||
- http://i.imgur.com/9XoNTev.png
|
||||
- https://i.imgur.com/5FCP1Ay.png
|
||||
|
||||
This code emuluates what original cotnroller does for matrix scan.
|
||||
- https://github.com/tmk/tmk_keyboard/blob/master/keyboard/fc660c/fc660c.c
|
||||
|
||||
|
||||
### Row designation
|
||||
LV138A(Z3) selects a row line and gives strobe by enabling with ~G2A(18).
|
||||
|
||||
|Row |A/17|B/16|C/15|
|
||||
|----|----|----|----|
|
||||
|0 |0 |0 |0 |
|
||||
|1 |1 |0 |0 |
|
||||
|2 |0 |1 |0 |
|
||||
|3 |1 |1 |0 |
|
||||
|4 |0 |0 |1 |
|
||||
|5 |1 |0 |1 |
|
||||
|6 |0 |1 |1 |
|
||||
|7 |1 |1 |1 |
|
||||
|
||||
|
||||
### Column designation
|
||||
LV4051A(Z4, Z5) select one of 16 column lines to sense capacitance of switches.
|
||||
|
||||
|Col |A/14|B/13|C/12|Z4-EN/10|Z5-EN/11|
|
||||
|----|----|----|----|--------|--------|
|
||||
|0 |0 |0 |0 |0 |1 |
|
||||
|1 |1 |0 |0 |0 |1 |
|
||||
|2 |0 |1 |0 |0 |1 |
|
||||
|3 |1 |1 |0 |0 |1 |
|
||||
|4 |0 |0 |1 |0 |1 |
|
||||
|5 |1 |0 |1 |0 |1 |
|
||||
|6 |0 |1 |1 |0 |1 |
|
||||
|7 |1 |1 |1 |0 |1 |
|
||||
|8 |0 |0 |0 |1 |0 |
|
||||
|9 |1 |0 |0 |1 |0 |
|
||||
|A |0 |1 |0 |1 |0 |
|
||||
|B |1 |1 |0 |1 |0 |
|
||||
|C |0 |0 |1 |1 |0 |
|
||||
|D |1 |0 |1 |1 |0 |
|
||||
|E |0 |1 |1 |1 |0 |
|
||||
|F |1 |1 |1 |1 |0 |
|
||||
|
||||
|
||||
FCC documents
|
||||
-------------
|
||||
https://fccid.io/RPKFC660C
|
||||
|
||||
- schematic: https://fccid.io/pdf.php?id=1888185
|
||||
- part list: https://fccid.io/pdf.php?id=1888184
|
||||
|
||||
|
||||
Datasheets
|
||||
----------
|
||||
- Hirose DF14A-20P-1.25H: http://www.mouser.com/ds/2/185/DF14_catalog-939195.pdf
|
||||
- LV07A: http://www.ti.com/lit/ds/symlink/sn74lv07a.pdf
|
||||
- LV138A: http://www.ti.com/lit/ds/symlink/sn74lvc138a.pdf
|
||||
- LV4051A: http://www.ti.com/lit/ds/symlink/sn74lv4051a.pdf
|
||||
- AD5258: http://www.analog.com/media/en/technical-documentation/data-sheets/AD5258.pdf
|
||||
|
||||
|
||||
3.3V power supply
|
||||
-----------------
|
||||
LV07A and LVC138A are 5V-tolerant and can be powered with 5V, the keyboard will work only with 5V power supply. It may not be completely safe to operate LV138A with 5V Vcc, its datasheet says:
|
||||
|
||||
> Exposure to absolute-maximum-rated conditions for extended periods may affect device reliability.
|
||||
|
||||
Digipot AD5258
|
||||
--------------
|
||||
Controller can operate AD5258 via I2C to change actuation point of keys. This may make keyboard unusable accidentally and it will be difficult to recovery in some situation. For safety firmware doesn't support it at this point, though.
|
||||
|
||||
Lower value of RDAC register causes shallower actuation point.
|
||||
|
||||
Resources
|
||||
---------
|
||||
- Pics: https://imgur.com/a/UTR8Z
|
80
keyboards/fc660c/config.h
Normal file
80
keyboards/fc660c/config.h
Normal file
@@ -0,0 +1,80 @@
|
||||
/*
|
||||
Copyright 2017 Balz Guenat
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <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 0x660C
|
||||
#define DEVICE_VER 0x0100
|
||||
#define MANUFACTURER QMK
|
||||
#define PRODUCT Leopold FC660C with QMK
|
||||
#define DESCRIPTION Leopold FC660C with Hasu alternative controller using QMK
|
||||
|
||||
/* key matrix size */
|
||||
#define MATRIX_ROWS 8
|
||||
#define MATRIX_COLS 16
|
||||
|
||||
#define DIODE_DIRECTION CUSTOM_MATRIX
|
||||
|
||||
/* define if matrix has ghost */
|
||||
//#define MATRIX_HAS_GHOST
|
||||
|
||||
/* number of backlight levels */
|
||||
// #define BACKLIGHT_LEVELS 1
|
||||
|
||||
/* mapping backlight LEDs to correct Pin */
|
||||
// #define BACKLIGHT_PIN B7
|
||||
|
||||
/* Set 0 if debouncing isn't needed */
|
||||
#define DEBOUNCING_DELAY 0
|
||||
#define TAPPING_TERM 175
|
||||
|
||||
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
||||
// #define LOCKING_SUPPORT_ENABLE
|
||||
/* Locking resynchronize hack */
|
||||
// #define LOCKING_RESYNC_ENABLE
|
||||
|
||||
/* key combination for command */
|
||||
#define IS_COMMAND() ( \
|
||||
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
|
||||
)
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Feature disable options
|
||||
* These options are also useful to firmware size reduction.
|
||||
*/
|
||||
|
||||
/* disable debug print */
|
||||
//#define NO_DEBUG
|
||||
|
||||
/* disable print */
|
||||
//#define NO_PRINT
|
||||
|
||||
/* disable action features */
|
||||
//#define NO_ACTION_LAYER
|
||||
//#define NO_ACTION_TAPPING
|
||||
//#define NO_ACTION_ONESHOT
|
||||
//#define NO_ACTION_MACRO
|
||||
//#define NO_ACTION_FUNCTION
|
||||
|
||||
#endif
|
48
keyboards/fc660c/fc660c.c
Normal file
48
keyboards/fc660c/fc660c.c
Normal file
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
Copyright 2017 Balz Guenat
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "fc660c.h"
|
||||
|
||||
void matrix_init_kb(void) {
|
||||
// put your keyboard start-up code here
|
||||
// runs once when the firmware starts up
|
||||
|
||||
matrix_init_user();
|
||||
}
|
||||
|
||||
void matrix_scan_kb(void) {
|
||||
// put your looping keyboard code here
|
||||
// runs every cycle (a lot)
|
||||
|
||||
matrix_scan_user();
|
||||
}
|
||||
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
// put your per-action keyboard code here
|
||||
// runs for every action, just before processing by the firmware
|
||||
|
||||
return process_record_user(keycode, record);
|
||||
}
|
||||
|
||||
void led_set_kb(uint8_t usb_led) {
|
||||
if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
|
||||
PORTB &= ~(1<<6);
|
||||
} else {
|
||||
PORTB |= (1<<6);
|
||||
}
|
||||
|
||||
led_set_user(usb_led);
|
||||
}
|
57
keyboards/fc660c/fc660c.h
Normal file
57
keyboards/fc660c/fc660c.h
Normal file
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
Copyright 2017 Balz Guenat
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef FC660C_H
|
||||
#define FC660C_H
|
||||
|
||||
#include "quantum.h"
|
||||
|
||||
|
||||
#define KEYMAP( \
|
||||
K13, K10, K11, K12, K14, K16, K17, K15, K1B, K18, K19, K1A, K1C, K1E, K1F, \
|
||||
K03, K00, K01, K02, K04, K06, K07, K05, K0B, K08, K09, K0A, K0C, K0E, K0F, \
|
||||
K43, K40, K41, K42, K44, K46, K47, K45, K4B, K48, K49, K4A, K4E, \
|
||||
K33, K31, K32, K34, K36, K37, K35, K3B, K38, K39, K3A, K3C, K3D, \
|
||||
K23, K21, K22, K27, K28, K2A, K2C, K2E, K2D, K2F \
|
||||
) { \
|
||||
{ K00, K01, K02, K03, K04, K05, K06, K07, \
|
||||
K08, K09, K0A, K0B, K0C, KC_NO, K0E, K0F }, \
|
||||
{ K10, K11, K12, K13, K14, K15, K16, K17, \
|
||||
K18, K19, K1A, K1B, K1C, KC_NO, K1E, K1F }, \
|
||||
{ KC_NO, K21, K22, K23, KC_NO, KC_NO, KC_NO, K27, \
|
||||
K28, KC_NO, K2A, KC_NO, K2C, K2D, K2E, K2F }, \
|
||||
{ KC_NO, K31, K32, K33, K34, K35, K36, K37, \
|
||||
K38, K39, K3A, K3B, K3C, K3D, KC_NO, KC_NO }, \
|
||||
{ K40, K41, K42, K43, K44, K45, K46, K47, \
|
||||
K48, K49, K4A, K4B, KC_NO, KC_NO, K4E, KC_NO }, \
|
||||
{ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \
|
||||
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \
|
||||
{ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \
|
||||
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \
|
||||
{ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \
|
||||
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO } \
|
||||
}
|
||||
/*
|
||||
KEYMAP(
|
||||
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,
|
||||
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,
|
||||
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,
|
||||
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,
|
||||
_______,_______,_______, _______, _______,_______,_______, _______,_______,_______
|
||||
)
|
||||
*/
|
||||
|
||||
#endif
|
5
keyboards/fc660c/keymaps/default/README.md
Normal file
5
keyboards/fc660c/keymaps/default/README.md
Normal file
@@ -0,0 +1,5 @@
|
||||
# The default keymap for the FC660C
|
||||
|
||||
Emulates original keymap.
|
||||
|
||||

|
24
keyboards/fc660c/keymaps/default/config.h
Normal file
24
keyboards/fc660c/keymaps/default/config.h
Normal file
@@ -0,0 +1,24 @@
|
||||
/* Copyright 2017 Balz Guenat
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_USER_H
|
||||
#define CONFIG_USER_H
|
||||
|
||||
#include "config_common.h"
|
||||
|
||||
// place overrides here
|
||||
|
||||
#endif
|
37
keyboards/fc660c/keymaps/default/keymap.c
Normal file
37
keyboards/fc660c/keymaps/default/keymap.c
Normal file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
Copyright 2017 Balz Guenat
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "fc660c.h"
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[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_BSPC, KC_INS,
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,KC_RBRC,KC_BSLS, KC_DEL,
|
||||
KC_CAPS,KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT,
|
||||
KC_LSFT,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,KC_RSFT, KC_UP,
|
||||
KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RCTL,MO(1), KC_LEFT,KC_DOWN,KC_RGHT
|
||||
),
|
||||
[1] = KEYMAP(
|
||||
KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______,
|
||||
_______,_______,_______,_______,_______,_______,_______,_______,KC_PSCR,KC_SLCK,KC_PAUS,_______,_______,_______, _______,
|
||||
_______,_______,_______,_______,_______,_______,_______,_______,KC_HOME,KC_PGUP,_______,_______, _______,
|
||||
_______,_______,_______,_______,_______,_______,_______,_______,KC_END, KC_PGDN,_______,_______, _______,
|
||||
_______,_______,_______, _______, _______,_______,MO(1), _______,_______,_______
|
||||
)
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
};
|
226
keyboards/fc660c/matrix.c
Normal file
226
keyboards/fc660c/matrix.c
Normal file
@@ -0,0 +1,226 @@
|
||||
/*
|
||||
Copyright 2017 Balz Guenat
|
||||
based on work by 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 <util/delay.h>
|
||||
#include "print.h"
|
||||
#include "debug.h"
|
||||
#include "util.h"
|
||||
#include "timer.h"
|
||||
#include "matrix.h"
|
||||
#include "led.h"
|
||||
|
||||
// Timer resolution check
|
||||
#if (1000000/TIMER_RAW_FREQ > 20)
|
||||
# error "Timer resolution(>20us) is not enough for HHKB matrix scan tweak on V-USB."
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Pin configuration for ATMega32U4
|
||||
*
|
||||
* Row: PD4-6, 7(~EN)
|
||||
* Col: PB0-2, 3(Z5 ~EN), 4(Z4 ~EN)
|
||||
* Key: PC6(pull-uped)
|
||||
* Hys: PC7
|
||||
*/
|
||||
static inline void KEY_ENABLE(void) { (PORTD &= ~(1<<7)); }
|
||||
static inline void KEY_UNABLE(void) { (PORTD |= (1<<7)); }
|
||||
static inline bool KEY_STATE(void) { return (PINC & (1<<6)); }
|
||||
static inline void KEY_HYS_ON(void) { (PORTC |= (1<<7)); }
|
||||
static inline void KEY_HYS_OFF(void) { (PORTC &= ~(1<<7)); }
|
||||
static inline void KEY_INIT(void)
|
||||
{
|
||||
/* Col */
|
||||
DDRB |= 0x1F;
|
||||
/* Key: input with pull-up */
|
||||
DDRC &= ~(1<<6);
|
||||
PORTC |= (1<<6);
|
||||
/* Hys */
|
||||
DDRC |= (1<<7);
|
||||
/* Row */
|
||||
DDRD |= 0xF0;
|
||||
|
||||
KEY_UNABLE();
|
||||
KEY_HYS_OFF();
|
||||
}
|
||||
static inline void SET_ROW(uint8_t ROW)
|
||||
{
|
||||
// set row with unabling key
|
||||
PORTD = (PORTD & 0x0F) | (1<<7) | ((ROW & 0x07) << 4);
|
||||
}
|
||||
static inline void SET_COL(uint8_t COL)
|
||||
{
|
||||
// |PB3(Z5 ~EN)|PB4(Z4 ~EN)
|
||||
// --------|-----------|-----------
|
||||
// Col:0-7 |high |low
|
||||
// Col:8-F |low |high
|
||||
PORTB = (PORTB & 0xE0) | ((COL & 0x08) ? 1<<4 : 1<<3) | (COL & 0x07);
|
||||
}
|
||||
|
||||
static uint32_t matrix_last_modified = 0;
|
||||
|
||||
// matrix state buffer(1:on, 0:off)
|
||||
static matrix_row_t *matrix;
|
||||
static matrix_row_t *matrix_prev;
|
||||
static matrix_row_t _matrix0[MATRIX_ROWS];
|
||||
static matrix_row_t _matrix1[MATRIX_ROWS];
|
||||
|
||||
|
||||
__attribute__ ((weak))
|
||||
void matrix_init_quantum(void) {
|
||||
matrix_init_kb();
|
||||
}
|
||||
|
||||
__attribute__ ((weak))
|
||||
void matrix_scan_quantum(void) {
|
||||
matrix_scan_kb();
|
||||
}
|
||||
|
||||
__attribute__ ((weak))
|
||||
void matrix_init_kb(void) {
|
||||
matrix_init_user();
|
||||
}
|
||||
|
||||
__attribute__ ((weak))
|
||||
void matrix_scan_kb(void) {
|
||||
matrix_scan_user();
|
||||
}
|
||||
|
||||
__attribute__ ((weak))
|
||||
void matrix_init_user(void) {
|
||||
}
|
||||
|
||||
__attribute__ ((weak))
|
||||
void matrix_scan_user(void) {
|
||||
}
|
||||
|
||||
|
||||
void matrix_init(void)
|
||||
{
|
||||
KEY_INIT();
|
||||
|
||||
// LEDs on CapsLock and Insert
|
||||
DDRB |= (1<<5) | (1<<6);
|
||||
PORTB |= (1<<5) | (1<<6);
|
||||
|
||||
// initialize matrix state: all keys off
|
||||
for (uint8_t i=0; i < MATRIX_ROWS; i++) _matrix0[i] = 0x00;
|
||||
for (uint8_t i=0; i < MATRIX_ROWS; i++) _matrix1[i] = 0x00;
|
||||
matrix = _matrix0;
|
||||
matrix_prev = _matrix1;
|
||||
matrix_init_quantum();
|
||||
}
|
||||
|
||||
uint8_t matrix_scan(void)
|
||||
{
|
||||
matrix_row_t *tmp;
|
||||
|
||||
tmp = matrix_prev;
|
||||
matrix_prev = matrix;
|
||||
matrix = tmp;
|
||||
|
||||
uint8_t row, col;
|
||||
for (col = 0; col < MATRIX_COLS; col++) {
|
||||
SET_COL(col);
|
||||
for (row = 0; row < MATRIX_ROWS; row++) {
|
||||
//KEY_SELECT(row, col);
|
||||
SET_ROW(row);
|
||||
_delay_us(2);
|
||||
|
||||
// Not sure this is needed. This just emulates HHKB controller's behaviour.
|
||||
if (matrix_prev[row] & (1<<col)) {
|
||||
KEY_HYS_ON();
|
||||
}
|
||||
_delay_us(10);
|
||||
|
||||
// NOTE: KEY_STATE is valid only in 20us after KEY_ENABLE.
|
||||
// If V-USB interrupts in this section we could lose 40us or so
|
||||
// and would read invalid value from KEY_STATE.
|
||||
uint8_t last = TIMER_RAW;
|
||||
|
||||
KEY_ENABLE();
|
||||
|
||||
// Wait for KEY_STATE outputs its value.
|
||||
_delay_us(2);
|
||||
|
||||
if (KEY_STATE()) {
|
||||
matrix[row] &= ~(1<<col);
|
||||
} else {
|
||||
matrix[row] |= (1<<col);
|
||||
}
|
||||
|
||||
// Ignore if this code region execution time elapses more than 20us.
|
||||
// MEMO: 20[us] * (TIMER_RAW_FREQ / 1000000)[count per us]
|
||||
// MEMO: then change above using this rule: a/(b/c) = a*1/(b/c) = a*(c/b)
|
||||
if (TIMER_DIFF_RAW(TIMER_RAW, last) > 20/(1000000/TIMER_RAW_FREQ)) {
|
||||
matrix[row] = matrix_prev[row];
|
||||
}
|
||||
|
||||
_delay_us(5);
|
||||
KEY_HYS_OFF();
|
||||
KEY_UNABLE();
|
||||
|
||||
// NOTE: KEY_STATE keep its state in 20us after KEY_ENABLE.
|
||||
// This takes 25us or more to make sure KEY_STATE returns to idle state.
|
||||
_delay_us(75);
|
||||
}
|
||||
if (matrix[row] ^ matrix_prev[row]) {
|
||||
matrix_last_modified = timer_read32();
|
||||
}
|
||||
}
|
||||
matrix_scan_quantum();
|
||||
return 1;
|
||||
}
|
||||
|
||||
inline
|
||||
matrix_row_t matrix_get_row(uint8_t row) {
|
||||
return matrix[row];
|
||||
}
|
||||
|
||||
void matrix_print(void)
|
||||
{
|
||||
#if (MATRIX_COLS <= 8)
|
||||
print("r/c 01234567\n");
|
||||
#elif (MATRIX_COLS <= 16)
|
||||
print("r/c 0123456789ABCDEF\n");
|
||||
#elif (MATRIX_COLS <= 32)
|
||||
print("r/c 0123456789ABCDEF0123456789ABCDEF\n");
|
||||
#endif
|
||||
|
||||
for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
|
||||
|
||||
#if (MATRIX_COLS <= 8)
|
||||
xprintf("%02X: %08b%s\n", row, bitrev(matrix_get_row(row)),
|
||||
#elif (MATRIX_COLS <= 16)
|
||||
xprintf("%02X: %016b%s\n", row, bitrev16(matrix_get_row(row)),
|
||||
#elif (MATRIX_COLS <= 32)
|
||||
xprintf("%02X: %032b%s\n", row, bitrev32(matrix_get_row(row)),
|
||||
#endif
|
||||
#ifdef MATRIX_HAS_GHOST
|
||||
matrix_has_ghost_in_row(row) ? " <ghost" : ""
|
||||
#else
|
||||
""
|
||||
#endif
|
||||
);
|
||||
}
|
||||
}
|
64
keyboards/fc660c/rules.mk
Normal file
64
keyboards/fc660c/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
|
||||
# comment out to disable the options.
|
||||
#
|
||||
# BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= yes # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
NKRO_ENABLE ?= yes # USB Nkey Rollover - not yet supported in LUFA
|
||||
|
||||
# Optimize size but this may cause error "relocation truncated to fit"
|
||||
#EXTRALDFLAGS = -Wl,--relax
|
||||
|
||||
CUSTOM_MATRIX = yes
|
||||
SRC += matrix.c
|
175
keyboards/fc980c/README.md
Normal file
175
keyboards/fc980c/README.md
Normal file
@@ -0,0 +1,175 @@
|
||||
|
||||
|
||||
FC980C Alt Controller
|
||||
=====================
|
||||
|
||||
This file and the entire QMK port of this board are based on its TMK implementation: https://github.com/tmk/tmk_keyboard/tree/master/keyboard/fc980c
|
||||
|
||||
------------
|
||||
|
||||
- Keyboard Maintainer: [Balz Guenat](https://github.com/BalzGuenat)
|
||||
- Hardware Supported: Hasu's Alt Controller (see below)
|
||||
- Hardware Availability: https://geekhack.org/index.php?topic=90104.0
|
||||
|
||||
Make example for this keyboard (after setting up your build environment):
|
||||
|
||||
make fc980c:default
|
||||
|
||||
See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information.
|
||||
|
||||
To flash the firmware, press the reset button on the controller and run:
|
||||
|
||||
sudo make fc980c:default:dfu
|
||||
|
||||
-----------
|
||||
|
||||
This controller replaces original controller of Leopold FC980C and makes the keyboard programmable.
|
||||
|
||||
Discuss this here: https://geekhack.org/index.php?topic=90681.0
|
||||
|
||||
The keyboard is very similar electronically to its sibling model FC660C you can also refer this.
|
||||
|
||||
FC660C Alt Controller: https://geekhack.org/index.php?topic=88439.0
|
||||
|
||||
|
||||
Hardware
|
||||
--------
|
||||
This project uses common and familiar ATmega32u4 but any microcontroller with 5V I/O will work.
|
||||
|
||||
- Schematic of Alt controller: schematic.pdf
|
||||
|
||||
|
||||
Pin configuration
|
||||
-----------------
|
||||
Connector bridging between switch board and controller is Hirose DF14A-20P-1.25H.
|
||||
|
||||
|Switch |Controller |
|
||||
| board | board |Description |Function |ATmega32u4
|
||||
|--------|-----------|--------------------------------------|-----------|------------
|
||||
| 1 |20 | FG |FG |GND
|
||||
| 2 |19 | GND |GND |GND
|
||||
| 3 |18 | GND |GND |GND
|
||||
| 4 |17 | 3.3V |V33 |3.3V/5V
|
||||
| 5 |16 | 5V |Vcc |5V
|
||||
| 6 |15 |*Z6-TP1684-4-HYS(o) |KEY_HYS |PC7
|
||||
| 7 |14 |*Z6-TP1684-2-KEY(i) |KEY_STATE |PC6
|
||||
| 8 |13 |*Z7-AD5258-5-SCL(I2C) |I2C_SCL |PD0(TWI)
|
||||
| 9 |12 |*Z7-AD5258-4-SDA(I2C) |I2C_SDA |PD1(TWI)
|
||||
|10 |11 |*Z5/4-LV4051A-6-~EN(Lo:Z5 Hi:Z4) |COL_bit3 |PB3
|
||||
|11 |10 |+Z3-LV07A-5 (LV4051A-9-C) |COL_bit2 |PB2
|
||||
|12 | 9 |+Z3-LV07A-1 (LV4051A-10-B) |COL_bit1 |PB1
|
||||
|13 | 8 |+Z3-LV07A-3 (LV4051A-11-A) |COL_bit0 |PB0
|
||||
|14 | 7 |+Z1-LVC138A-3-C |ROW_bit2 |PD6
|
||||
|15 | 6 |+Z1-LVC138A-2-B |ROW_bit1 |PD5
|
||||
|16 | 5 |+Z1-LVC138A-1-A |ROW_bit0 |PD4
|
||||
|17 | 4 |+Z1-LVC138A-4-~G2A Z6-TP1684-5-~EN |KEY_ENABLE |PD7
|
||||
|18 | 3 |+Q4-NPN-B-NumLock_LED(Hi:On) |LED_NUML |PB4
|
||||
|19 | 2 |+Q3-NPN-B-CapsLock_LED(Hi:On) |LED_CAPS |PB5
|
||||
|20 | 1 |+Q2-NPN-B-ScrollLock_LED(Hi:On) |LED_SCRL |PB6
|
||||
|
||||
```
|
||||
* 5V intferface
|
||||
+ 3.3V interface
|
||||
```
|
||||
|
||||
|
||||
Switch matrix
|
||||
-------------
|
||||
|
||||
| |0 |1 |2 |3 |4 |5 |6 |7 |8 |9 |A |B |C |D |E |F |
|
||||
|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|----|
|
||||
| 0|Left|RCtl|RAlt| |Down|P. |Righ|P0 |X |LGui|` |V | |Esc |M |Spc |
|
||||
| 1|Fn |. | | |P1 |PEnt|P2 |P3 |Z |LAlt|LCtl|C |K | |N |B |
|
||||
| 2|' |/ |, | |P4 |P+ |P5 |P6 |D |A |LSft|F |J |F1 |H |G |
|
||||
| 3|RSft|; |L |] |Up | | | |S |Q |Caps|R |I |F3 |U |T |
|
||||
| 4| | | | | | | | | | | | | | | | |
|
||||
| 5|= |- |0 |\ |NLck|BSpc|P/ |P* |3 |2 | |4 |9 |F2 |7 |6 |
|
||||
| 6|[ |P |O |Ent |P7 |P- |P8 |P9 |W |1 |Tab |E |8 |F4 |Y |5 |
|
||||
| 7|F11 |F10 |F9 |F12 |Del |PgDn|Ins |PgUp| | | | |F8 |F5 |F7 |F6 |
|
||||
|
||||
|
||||
Row designation
|
||||
---------------
|
||||
LV138A(Z1) selects one of 8 row lines and gives strobe by enabling with ~G2A(17).
|
||||
|
||||
|ROW |bit0|bit1|bit2|
|
||||
|----|----|----|----|
|
||||
|0 |0 |0 |0 |
|
||||
|1 |1 |0 |0 |
|
||||
|2 |0 |1 |0 |
|
||||
|3 |1 |1 |0 |
|
||||
|4 |0 |0 |1 |
|
||||
|5 |1 |0 |1 |
|
||||
|6 |0 |1 |1 |
|
||||
|7 |1 |1 |1 |
|
||||
|
||||
|
||||
Column designation
|
||||
------------------
|
||||
LV4051A(Z4, Z5) select one of 16 column lines to sense capacitance of switches.
|
||||
|
||||
|COL |bit0|bit1|bit2|bit3|
|
||||
|----|----|----|----|----|
|
||||
|0 |0 |0 |0 |0 |
|
||||
|1 |1 |0 |0 |0 |
|
||||
|2 |0 |1 |0 |0 |
|
||||
|3 |1 |1 |0 |0 |
|
||||
|4 |0 |0 |1 |0 |
|
||||
|5 |1 |0 |1 |0 |
|
||||
|6 |0 |1 |1 |0 |
|
||||
|7 |1 |1 |1 |0 |
|
||||
|8 |0 |0 |0 |1 |
|
||||
|9 |1 |0 |0 |1 |
|
||||
|A |0 |1 |0 |1 |
|
||||
|B |1 |1 |0 |1 |
|
||||
|C |0 |0 |1 |1 |
|
||||
|D |1 |0 |1 |1 |
|
||||
|E |0 |1 |1 |1 |
|
||||
|F |1 |1 |1 |1 |
|
||||
|
||||
|
||||
Firmware
|
||||
--------
|
||||
Just `make` to build firmware. And consult with wiki for further information.
|
||||
|
||||
- https://github.com/tmk/tmk_keyboard/tree/master/keyboard/fc660c
|
||||
- https://github.com/tmk/tmk_keyboard/wiki
|
||||
|
||||
|
||||
Datasheets
|
||||
----------
|
||||
- Hirose DF14A-20P-1.25H: http://www.mouser.com/ds/2/185/DF14_catalog-939195.pdf
|
||||
- LV07A: http://www.ti.com/lit/ds/symlink/sn74lv07a.pdf
|
||||
- LV138A: http://www.ti.com/lit/ds/symlink/sn74lvc138a.pdf
|
||||
- LV4051A: http://www.ti.com/lit/ds/symlink/sn74lv4051a.pdf
|
||||
- AD5258: http://www.analog.com/media/en/technical-documentation/data-sheets/AD5258.pdf
|
||||
- JST S5B-PH-SM4: http://www.jst-mfg.com/product/pdf/eng/ePH.pdf
|
||||
- Hirose UX60SC-MB-5S8: https://www.hirose.com/product/en/products/UX/UX60SC-MB-5S8%2880%29/
|
||||
- TYU TU1252WNR-05S: http://php2.twinner.com.tw/files/tyu/TU1252series.pdf
|
||||
- Tr(E42) for LED?: http://cj-elec.com/txUpfile/2013614923661845.pdf
|
||||
|
||||
|
||||
3.3V power supply
|
||||
-----------------
|
||||
LV07A and LVC138A are 5V-tolerant and can be powered with 5V, the keyboard will work only with 5V power supply. It may not be completely safe to operate LV138A with 5V Vcc, its datasheet says:
|
||||
|
||||
> Exposure to absolute-maximum-rated conditions for extended periods may affect device reliability.
|
||||
|
||||
|
||||
Digipot AD5258
|
||||
--------------
|
||||
Controller can operate AD5258 via I2C to change actuation point of keys. This may make keyboard unusable accidentally and it will be difficult to recovery in some situation. For safety firmware doesn't support it at this point, though.
|
||||
|
||||
Lower value of RDAC register causes shallower actuation point.
|
||||
|
||||
|
||||
USB connector board
|
||||
-------------------
|
||||
The keyboard has USB receptacle on small separate 1.0mm-thick PCB. USB receptacle is Hirose UX60SC-MB-5S8 while wire-to-PCB connector is TYU TU1252WNR-05S.
|
||||
|
||||
http://i.imgur.com/Nucn6h9.jpg
|
||||
|
||||
|
||||
Resources
|
||||
---------
|
||||
- Pics: http://imgur.com/a/HhyIq
|
84
keyboards/fc980c/config.h
Normal file
84
keyboards/fc980c/config.h
Normal file
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
Copyright 2017 Balz Guenat
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <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 0x980C
|
||||
#define DEVICE_VER 0x0100
|
||||
#define MANUFACTURER QMK
|
||||
#define PRODUCT Leopold FC980C with QMK
|
||||
#define DESCRIPTION Leopold FC980C with Hasu alternative controller using QMK
|
||||
|
||||
/* key matrix size */
|
||||
#define MATRIX_ROWS 8
|
||||
#define MATRIX_COLS 16
|
||||
|
||||
// #define MATRIX_ROW_PINS { B0, B2, B4, B5, B6 }
|
||||
// #define MATRIX_COL_PINS { F5, B1, F0, F1, F4, B3, D7, D6, D4, D5, D3, D2, D1, D0 }
|
||||
// #define UNUSED_PINS
|
||||
|
||||
#define DIODE_DIRECTION CUSTOM_MATRIX
|
||||
|
||||
/* define if matrix has ghost */
|
||||
//#define MATRIX_HAS_GHOST
|
||||
|
||||
/* number of backlight levels */
|
||||
// #define BACKLIGHT_LEVELS 1
|
||||
|
||||
/* mapping backlight LEDs to correct Pin */
|
||||
// #define BACKLIGHT_PIN B7
|
||||
|
||||
/* Set 0 if debouncing isn't needed */
|
||||
#define DEBOUNCING_DELAY 0
|
||||
#define TAPPING_TERM 175
|
||||
|
||||
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
||||
// #define LOCKING_SUPPORT_ENABLE
|
||||
/* Locking resynchronize hack */
|
||||
// #define LOCKING_RESYNC_ENABLE
|
||||
|
||||
/* key combination for command */
|
||||
#define IS_COMMAND() ( \
|
||||
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
|
||||
)
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Feature disable options
|
||||
* These options are also useful to firmware size reduction.
|
||||
*/
|
||||
|
||||
/* disable debug print */
|
||||
//#define NO_DEBUG
|
||||
|
||||
/* disable print */
|
||||
//#define NO_PRINT
|
||||
|
||||
/* disable action features */
|
||||
//#define NO_ACTION_LAYER
|
||||
//#define NO_ACTION_TAPPING
|
||||
//#define NO_ACTION_ONESHOT
|
||||
//#define NO_ACTION_MACRO
|
||||
//#define NO_ACTION_FUNCTION
|
||||
|
||||
#endif
|
58
keyboards/fc980c/fc980c.c
Normal file
58
keyboards/fc980c/fc980c.c
Normal file
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
Copyright 2017 Balz Guenat
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "fc980c.h"
|
||||
|
||||
void matrix_init_kb(void) {
|
||||
// put your keyboard start-up code here
|
||||
// runs once when the firmware starts up
|
||||
|
||||
matrix_init_user();
|
||||
}
|
||||
|
||||
void matrix_scan_kb(void) {
|
||||
// put your looping keyboard code here
|
||||
// runs every cycle (a lot)
|
||||
|
||||
matrix_scan_user();
|
||||
}
|
||||
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
// put your per-action keyboard code here
|
||||
// runs for every action, just before processing by the firmware
|
||||
|
||||
return process_record_user(keycode, record);
|
||||
}
|
||||
|
||||
void led_set_kb(uint8_t usb_led) {
|
||||
if (usb_led & (1<<USB_LED_NUM_LOCK)) {
|
||||
PORTB |= (1<<4);
|
||||
} else {
|
||||
PORTB &= ~(1<<4);
|
||||
}
|
||||
if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
|
||||
PORTB |= (1<<5);
|
||||
} else {
|
||||
PORTB &= ~(1<<5);
|
||||
}
|
||||
if (usb_led & (1<<USB_LED_SCROLL_LOCK)) {
|
||||
PORTB |= (1<<6);
|
||||
} else {
|
||||
PORTB &= ~(1<<6);
|
||||
}
|
||||
|
||||
led_set_user(usb_led);
|
||||
}
|
76
keyboards/fc980c/fc980c.h
Normal file
76
keyboards/fc980c/fc980c.h
Normal file
@@ -0,0 +1,76 @@
|
||||
/*
|
||||
Copyright 2017 Balz Guenat
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef FC980C_H
|
||||
#define FC980C_H
|
||||
|
||||
#include "quantum.h"
|
||||
// #include "quantum_keycodes.h"
|
||||
|
||||
/*
|
||||
----------------------------------------------------------------------------------------------------------------------
|
||||
| K0D | | K2D | K5D | K3D | K6D | | K7D | K7F | K7E | K7C | | K72 | K71 | K70 | K73 | | K74 | K76 | K77 | K75 |
|
||||
----------------------------------------------------------------------------------------------------------------------
|
||||
----------------------------------------------------------------------------------------------------------------------
|
||||
| K0A | K69 | K59 | K58 | K5B | K6F | K5F | K5E | K6C | K5C | K52 | K51 | K50 | K55 | | K54 | K56 | K57 | K65 |
|
||||
----------------------------------------------------------------------------------------------------------------------
|
||||
| K6A | K39 | K68 | K6B | K3B | K3F | K6E | K3E | K3C | K62 | K61 | K60 | K33 | K53 | | K64 | K66 | K67 | |
|
||||
---------------------------------------------------------------------------------------------------------------| K25 |
|
||||
| K3A | K29 | K38 | K28 | K2B | K2F | K2E | K2C | K1C | K32 | K31 | K20 | K63 | | K24 | K26 | K27 | |
|
||||
----------------------------------------------------------------------------------------------------------------------
|
||||
| K2A | K18 | K08 | K1B | K0B | K1F | K1E | K0E | K22 | K11 | K21 | K30 || K34 || K14 | K16 | K17 | |
|
||||
---------------------------------------------------------------------------------------------------------------| K15 |
|
||||
| K1A | K09 | K19 | K0F | K02 | K01 | K10 || K00 | K04 | K06 || K07 | K05 | |
|
||||
----------------------------------------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#define KEYMAP( \
|
||||
K0D, K2D,K5D,K3D,K6D,K7D,K7F,K7E,K7C,K72,K71,K70,K73, K74,K76,K77,K75, \
|
||||
K0A,K69,K59,K58,K5B,K6F,K5F,K5E,K6C,K5C,K52,K51,K50,K55, K54,K56,K57,K65, \
|
||||
K6A,K39,K68,K6B,K3B,K3F,K6E,K3E,K3C,K62,K61,K60,K33,K53, K64,K66,K67,K25, \
|
||||
K3A,K29,K38,K28,K2B,K2F,K2E,K2C,K1C,K32,K31,K20, K63, K24,K26,K27, \
|
||||
K2A, K18,K08,K1B,K0B,K1F,K1E,K0E,K22,K11,K21, K30, K34, K14,K16,K17,K15, \
|
||||
K1A,K09,K19, K0F, K02,K01,K10, K00,K04,K06, K07,K05 \
|
||||
) { \
|
||||
{ K00, K01, K02, KC_NO,K04, K05, K06, K07 , \
|
||||
K08, K09, K0A, K0B, KC_NO,K0D, K0E, K0F }, \
|
||||
{ K10, K11, KC_NO,KC_NO,K14, K15, K16, K17 , \
|
||||
K18, K19, K1A, K1B, K1C, KC_NO,K1E, K1F }, \
|
||||
{ K20, K21, K22, KC_NO,K24, K25, K26, K27 , \
|
||||
K28, K29, K2A, K2B, K2C, K2D, K2E, K2F }, \
|
||||
{ K30, K31, K32, K33, K34, KC_NO,KC_NO,KC_NO , \
|
||||
K38, K39, K3A, K3B, K3C, K3D, K3E, K3F }, \
|
||||
{ KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO , \
|
||||
KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO }, \
|
||||
{ K50, K51, K52, K53, K54, K55, K56, K57 , \
|
||||
K58, K59, KC_NO,K5B, K5C, K5D, K5E, K5F }, \
|
||||
{ K60, K61, K62, K63, K64, K65, K66, K67 , \
|
||||
K68, K69, K6A, K6B, K6C, K6D, K6E, K6F }, \
|
||||
{ K70, K71, K72, K73, K74, K75, K76, K77 , \
|
||||
KC_NO,KC_NO,KC_NO,KC_NO,K7C, K7D, K7E, K7F } \
|
||||
}
|
||||
/*
|
||||
KEYMAP(
|
||||
_______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______,_______,
|
||||
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______,_______,
|
||||
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______,_______,
|
||||
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, _______,_______,_______,
|
||||
_______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______,_______,_______,_______,
|
||||
_______,_______,_______, _______, _______,_______,_______, _______,_______,_______, _______,_______
|
||||
)
|
||||
*/
|
||||
|
||||
#endif
|
1
keyboards/fc980c/keymaps/coloneljesus/README.md
Normal file
1
keyboards/fc980c/keymaps/coloneljesus/README.md
Normal file
@@ -0,0 +1 @@
|
||||
# My FC980C keymap
|
24
keyboards/fc980c/keymaps/coloneljesus/config.h
Normal file
24
keyboards/fc980c/keymaps/coloneljesus/config.h
Normal file
@@ -0,0 +1,24 @@
|
||||
/* Copyright 2017 Balz Guenat
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_USER_H
|
||||
#define CONFIG_USER_H
|
||||
|
||||
#include "config_common.h"
|
||||
|
||||
// place overrides here
|
||||
|
||||
#endif
|
39
keyboards/fc980c/keymaps/coloneljesus/keymap.c
Normal file
39
keyboards/fc980c/keymaps/coloneljesus/keymap.c
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
Copyright 2017 Balz Guenat
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "fc980c.h"
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[0] = KEYMAP(
|
||||
KC_ESC, KC_F1,KC_F2,KC_F3,KC_F4,KC_F5,KC_F6,KC_F7,KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_INS, KC_PGUP,KC_PGDN,
|
||||
KC_GRV, KC_1,KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,KC_EQL, KC_BSPC, KC_NLCK,KC_PSLS,KC_PAST,KC_PMNS,
|
||||
KC_TAB, KC_Q,KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,KC_RBRC,KC_BSLS, KC_P7, KC_P8, KC_P9, KC_PPLS,
|
||||
MO(1) , KC_A,KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6,
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT,
|
||||
KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RCTL,MO(1), KC_LEFT,KC_DOWN,KC_RGHT, KC_P0, KC_PDOT
|
||||
),
|
||||
[1] = KEYMAP(
|
||||
_______, _______,_______,_______,_______,_______,_______, _______, _______,_______,_______,_______,_______, _______,_______,KC_HOME,KC_END,
|
||||
_______,_______,_______,_______,_______,_______,_______,_______, _______, _______,_______,_______,_______,_______, _______,_______,_______,_______,
|
||||
KC_CAPS,KC_MPRV,KC_VOLU,KC_MNXT,KC_PGUP,KC_INS,KC_HOME, LCTL(KC_LEFT),LCTL(KC_RGHT),KC_END, KC_PSCR,KC_SLCK,KC_PAUS,_______, _______,_______,_______,_______,
|
||||
_______,KC_MUTE,KC_VOLD,KC_MPLY,KC_PGDN,KC_DEL,KC_LEFT, KC_DOWN, KC_UP, KC_RGHT,_______,_______, _______, _______,_______,_______,
|
||||
_______, _______,_______,_______,_______,_______,LCTL(KC_BSPC),LCTL(KC_DEL), _______,_______,_______, _______, KC_PGUP, _______,_______,_______,_______,
|
||||
_______,_______,_______, _______, _______,KC_APP, _______, KC_HOME,KC_PGDN,KC_END, _______,_______
|
||||
),
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
};
|
5
keyboards/fc980c/keymaps/default/README.md
Normal file
5
keyboards/fc980c/keymaps/default/README.md
Normal file
@@ -0,0 +1,5 @@
|
||||
# The default keymap for the FC980C
|
||||
|
||||
Emulates original keymap.
|
||||
|
||||

|
24
keyboards/fc980c/keymaps/default/config.h
Normal file
24
keyboards/fc980c/keymaps/default/config.h
Normal file
@@ -0,0 +1,24 @@
|
||||
/* Copyright 2017 Balz Guenat
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_USER_H
|
||||
#define CONFIG_USER_H
|
||||
|
||||
#include "config_common.h"
|
||||
|
||||
// place overrides here
|
||||
|
||||
#endif
|
39
keyboards/fc980c/keymaps/default/keymap.c
Normal file
39
keyboards/fc980c/keymaps/default/keymap.c
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
Copyright 2017 Balz Guenat
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "fc980c.h"
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[0] = KEYMAP(
|
||||
KC_ESC, KC_F1,KC_F2,KC_F3,KC_F4,KC_F5,KC_F6,KC_F7,KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_INS, KC_PGUP,KC_PGDN,
|
||||
KC_GRV, KC_1,KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,KC_EQL, KC_BSPC, KC_NLCK,KC_PSLS,KC_PAST,KC_PMNS,
|
||||
KC_TAB, KC_Q,KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,KC_RBRC,KC_BSLS, KC_P7, KC_P8, KC_P9, KC_PPLS,
|
||||
KC_CAPS,KC_A,KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6,
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT,
|
||||
KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RCTL,MO(1), KC_LEFT,KC_DOWN,KC_RGHT, KC_P0, KC_PDOT
|
||||
),
|
||||
[1] = KEYMAP(
|
||||
_______, _______,_______,_______,_______,_______,_______,_______, _______, _______, _______,_______,_______, _______,_______,KC_HOME,KC_END,
|
||||
_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______,_______,_______, _______,_______,_______,_______,
|
||||
_______,_______,_______,_______,_______,_______,_______,_______,KC_PSCR, KC_SLCK, KC_PAUS, _______,_______,_______, _______,_______,_______,_______,
|
||||
_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, _______,_______,_______,
|
||||
_______, _______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, KC_PGUP, _______,_______,_______,_______,
|
||||
_______,_______,_______, _______, _______,KC_APP, _______, KC_HOME,KC_PGDN,KC_END, _______,_______
|
||||
),
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
};
|
228
keyboards/fc980c/matrix.c
Normal file
228
keyboards/fc980c/matrix.c
Normal file
@@ -0,0 +1,228 @@
|
||||
/*
|
||||
Copyright 2017 Balz Guenat
|
||||
based on work by 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 <util/delay.h>
|
||||
#include "print.h"
|
||||
#include "debug.h"
|
||||
#include "util.h"
|
||||
#include "timer.h"
|
||||
#include "matrix.h"
|
||||
#include "led.h"
|
||||
// #include "fc980c.h"
|
||||
|
||||
|
||||
// Timer resolution check
|
||||
#if (1000000/TIMER_RAW_FREQ > 20)
|
||||
# error "Timer resolution(>20us) is not enough for HHKB matrix scan tweak on V-USB."
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Pin configuration for ATMega32U4
|
||||
*
|
||||
* Row: PD4-6, PD7(~EN)
|
||||
* Col: PB0-3
|
||||
* Key: PC6(pull-uped)
|
||||
* Hys: PC7
|
||||
*/
|
||||
static inline void KEY_ENABLE(void) { (PORTD &= ~(1<<7)); }
|
||||
static inline void KEY_UNABLE(void) { (PORTD |= (1<<7)); }
|
||||
static inline bool KEY_STATE(void) { return (PINC & (1<<6)); }
|
||||
static inline void KEY_HYS_ON(void) { (PORTC |= (1<<7)); }
|
||||
static inline void KEY_HYS_OFF(void) { (PORTC &= ~(1<<7)); }
|
||||
static inline void KEY_INIT(void)
|
||||
{
|
||||
/* Col */
|
||||
DDRB |= 0x0F;
|
||||
/* Key: input with pull-up */
|
||||
DDRC &= ~(1<<6);
|
||||
PORTC |= (1<<6);
|
||||
/* Hys */
|
||||
DDRC |= (1<<7);
|
||||
/* Row */
|
||||
DDRD |= 0xF0;
|
||||
|
||||
KEY_UNABLE();
|
||||
KEY_HYS_OFF();
|
||||
}
|
||||
static inline void SET_ROW(uint8_t ROW)
|
||||
{
|
||||
// PD4-6
|
||||
PORTD = (PORTD & 0x8F) | ((ROW & 0x07) << 4);
|
||||
}
|
||||
static inline void SET_COL(uint8_t COL)
|
||||
{
|
||||
// PB0-3
|
||||
PORTB = (PORTB & 0xF0) | (COL & 0x0F);
|
||||
}
|
||||
|
||||
static uint32_t matrix_last_modified = 0;
|
||||
|
||||
// matrix state buffer(1:on, 0:off)
|
||||
static matrix_row_t *matrix;
|
||||
static matrix_row_t *matrix_prev;
|
||||
static matrix_row_t _matrix0[MATRIX_ROWS];
|
||||
static matrix_row_t _matrix1[MATRIX_ROWS];
|
||||
|
||||
|
||||
__attribute__ ((weak))
|
||||
void matrix_init_quantum(void) {
|
||||
matrix_init_kb();
|
||||
}
|
||||
|
||||
__attribute__ ((weak))
|
||||
void matrix_scan_quantum(void) {
|
||||
matrix_scan_kb();
|
||||
}
|
||||
|
||||
__attribute__ ((weak))
|
||||
void matrix_init_kb(void) {
|
||||
matrix_init_user();
|
||||
}
|
||||
|
||||
__attribute__ ((weak))
|
||||
void matrix_scan_kb(void) {
|
||||
matrix_scan_user();
|
||||
}
|
||||
|
||||
__attribute__ ((weak))
|
||||
void matrix_init_user(void) {
|
||||
}
|
||||
|
||||
__attribute__ ((weak))
|
||||
void matrix_scan_user(void) {
|
||||
}
|
||||
|
||||
|
||||
void matrix_init(void)
|
||||
{
|
||||
debug_enable = true;
|
||||
debug_matrix = true;
|
||||
|
||||
KEY_INIT();
|
||||
|
||||
// LEDs on NumLock, CapsLock and ScrollLock(PB4, PB5, PB6)
|
||||
DDRB |= (1<<4) | (1<<5) | (1<<6);
|
||||
PORTB |= (1<<4) | (1<<5) | (1<<6);
|
||||
|
||||
// initialize matrix state: all keys off
|
||||
for (uint8_t i=0; i < MATRIX_ROWS; i++) _matrix0[i] = 0x00;
|
||||
for (uint8_t i=0; i < MATRIX_ROWS; i++) _matrix1[i] = 0x00;
|
||||
matrix = _matrix0;
|
||||
matrix_prev = _matrix1;
|
||||
matrix_init_quantum();
|
||||
}
|
||||
|
||||
uint8_t matrix_scan(void)
|
||||
{
|
||||
matrix_row_t *tmp;
|
||||
|
||||
tmp = matrix_prev;
|
||||
matrix_prev = matrix;
|
||||
matrix = tmp;
|
||||
|
||||
uint8_t row, col;
|
||||
for (col = 0; col < MATRIX_COLS; col++) {
|
||||
SET_COL(col);
|
||||
for (row = 0; row < MATRIX_ROWS; row++) {
|
||||
//KEY_SELECT(row, col);
|
||||
SET_ROW(row);
|
||||
_delay_us(2);
|
||||
|
||||
// Not sure this is needed. This just emulates HHKB controller's behaviour.
|
||||
if (matrix_prev[row] & (1<<col)) {
|
||||
KEY_HYS_ON();
|
||||
}
|
||||
_delay_us(10);
|
||||
|
||||
// NOTE: KEY_STATE is valid only in 20us after KEY_ENABLE.
|
||||
// If V-USB interrupts in this section we could lose 40us or so
|
||||
// and would read invalid value from KEY_STATE.
|
||||
uint8_t last = TIMER_RAW;
|
||||
|
||||
KEY_ENABLE();
|
||||
|
||||
// Wait for KEY_STATE outputs its value.
|
||||
_delay_us(2);
|
||||
|
||||
if (KEY_STATE()) {
|
||||
matrix[row] &= ~(1<<col);
|
||||
} else {
|
||||
matrix[row] |= (1<<col);
|
||||
}
|
||||
|
||||
// Ignore if this code region execution time elapses more than 20us.
|
||||
// MEMO: 20[us] * (TIMER_RAW_FREQ / 1000000)[count per us]
|
||||
// MEMO: then change above using this rule: a/(b/c) = a*1/(b/c) = a*(c/b)
|
||||
if (TIMER_DIFF_RAW(TIMER_RAW, last) > 20/(1000000/TIMER_RAW_FREQ)) {
|
||||
matrix[row] = matrix_prev[row];
|
||||
}
|
||||
|
||||
_delay_us(5);
|
||||
KEY_HYS_OFF();
|
||||
KEY_UNABLE();
|
||||
|
||||
// NOTE: KEY_STATE keep its state in 20us after KEY_ENABLE.
|
||||
// This takes 25us or more to make sure KEY_STATE returns to idle state.
|
||||
_delay_us(75);
|
||||
}
|
||||
if (matrix[row] ^ matrix_prev[row]) {
|
||||
matrix_last_modified = timer_read32();
|
||||
}
|
||||
}
|
||||
matrix_scan_quantum();
|
||||
return 1;
|
||||
}
|
||||
|
||||
inline
|
||||
matrix_row_t matrix_get_row(uint8_t row) {
|
||||
return matrix[row];
|
||||
}
|
||||
|
||||
void matrix_print(void)
|
||||
{
|
||||
#if (MATRIX_COLS <= 8)
|
||||
print("r/c 01234567\n");
|
||||
#elif (MATRIX_COLS <= 16)
|
||||
print("r/c 0123456789ABCDEF\n");
|
||||
#elif (MATRIX_COLS <= 32)
|
||||
print("r/c 0123456789ABCDEF0123456789ABCDEF\n");
|
||||
#endif
|
||||
|
||||
for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
|
||||
|
||||
#if (MATRIX_COLS <= 8)
|
||||
xprintf("%02X: %08b%s\n", row, bitrev(matrix_get_row(row)),
|
||||
#elif (MATRIX_COLS <= 16)
|
||||
xprintf("%02X: %016b%s\n", row, bitrev16(matrix_get_row(row)),
|
||||
#elif (MATRIX_COLS <= 32)
|
||||
xprintf("%02X: %032b%s\n", row, bitrev32(matrix_get_row(row)),
|
||||
#endif
|
||||
#ifdef MATRIX_HAS_GHOST
|
||||
matrix_has_ghost_in_row(row) ? " <ghost" : ""
|
||||
#else
|
||||
""
|
||||
#endif
|
||||
);
|
||||
}
|
||||
}
|
64
keyboards/fc980c/rules.mk
Normal file
64
keyboards/fc980c/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
|
||||
# comment out to disable the options.
|
||||
#
|
||||
# BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE = yes # Console for debug(+400)
|
||||
COMMAND_ENABLE = yes # Commands for debug and configuration
|
||||
NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA
|
||||
|
||||
# Optimize size but this may cause error "relocation truncated to fit"
|
||||
#EXTRALDFLAGS = -Wl,--relax
|
||||
|
||||
CUSTOM_MATRIX = yes
|
||||
SRC += matrix.c
|
@@ -52,8 +52,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define MATRIX_ROW_PINS { F7, B1, B3, B2, B6 }
|
||||
#define MATRIX_COL_PINS { B4, E6, D7, F6, D4, D0 }
|
||||
|
||||
#define CATERINA_BOOTLOADER
|
||||
|
||||
#define UNUSED_PINS
|
||||
|
||||
/* COL2ROW or ROW2COL */
|
||||
|
@@ -33,14 +33,15 @@ ARCH = AVR8
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Bootloader
|
||||
# This definition is optional, and if your keyboard supports multiple bootloaders of
|
||||
# different sizes, comment this out, and the correct address will be loaded
|
||||
# automatically (+60). See bootloader.mk for all options.
|
||||
BOOTLOADER = caterina
|
||||
|
||||
# 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.
|
||||
#
|
||||
|
@@ -5,21 +5,29 @@ SRC= babblePaste.c
|
||||
|
||||
ifdef ASTAR
|
||||
CFLAGS=-D ASTAR
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
MCU = atmega32u4
|
||||
OPT_DEFS += -DCATERINA_BOOTLOADER
|
||||
SCULPT_UPLOAD_COMMAND = while [ ! -r $(USB) ]; do sleep 1; done ; \
|
||||
avrdude -p $(MCU) -c avr109 -U flash:w:$(TARGET).hex -P $(USB)
|
||||
|
||||
else
|
||||
MCU = at90usb1286
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=2048
|
||||
SCULPT_UPLOAD_COMMAND = teensy_loader_cli -w -mmcu=$(MCU) $(TARGET).hex
|
||||
endif
|
||||
|
||||
F_CPU = 16000000
|
||||
ARCH = AVR8
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Bootloader
|
||||
# This definition is optional, and if your keyboard supports multiple bootloaders of
|
||||
# different sizes, comment this out, and the correct address will be loaded
|
||||
# automatically (+60). See bootloader.mk for all options.
|
||||
ifdef ASTAR
|
||||
BOOTLOADER = caterina
|
||||
else
|
||||
BOOTLOADER = atmel-dfu
|
||||
endif
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
67
keyboards/handwired/dactyl/config.h
Normal file
67
keyboards/handwired/dactyl/config.h
Normal file
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
Copyright 2012 Jun Wako <wakojun@gmail.com>
|
||||
Copyright 2013 Oleg Kostyuk <cub.uanic@gmail.com>
|
||||
Copyright 2017 Erin Call <hello@erincall.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 DACTYL_CONFIG_H
|
||||
#define DACTYL_CONFIG_H
|
||||
|
||||
#include "config_common.h"
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define VENDOR_ID 0xFEED
|
||||
#define PRODUCT_ID 0x1308
|
||||
#define DEVICE_VER 0x0001
|
||||
#define MANUFACTURER Adereth
|
||||
#define PRODUCT Dactyl
|
||||
#define DESCRIPTION An ortholinear, split, 3D-curved keyboard with thumb clusters.
|
||||
|
||||
/* key matrix size
|
||||
* At this time, "row" in the dactyl's code actually means "column" on the
|
||||
* physical keyboard. It's confusing. I'm sorry. Blame Jack Humbert :P
|
||||
*/
|
||||
#define MATRIX_ROWS 12
|
||||
#define MATRIX_COLS 6
|
||||
|
||||
#define MOUSEKEY_INTERVAL 20
|
||||
#define MOUSEKEY_DELAY 0
|
||||
#define MOUSEKEY_TIME_TO_MAX 60
|
||||
#define MOUSEKEY_MAX_SPEED 7
|
||||
#define MOUSEKEY_WHEEL_DELAY 0
|
||||
|
||||
#define TAPPING_TOGGLE 1
|
||||
|
||||
#define TAPPING_TERM 200
|
||||
#define IGNORE_MOD_TAP_INTERRUPT // this makes it possible to do rolling combos (zx) with keys that convert to other keys on hold (z becomes ctrl when you hold it, and when this option isn't enabled, z rapidly followed by x actually sends Ctrl-x. That's bad.)
|
||||
|
||||
/* key combination for command */
|
||||
#define IS_COMMAND() ( \
|
||||
keyboard_report->mods == (MOD_BIT(KC_LCTL) | MOD_BIT(KC_RCTL)) || \
|
||||
keyboard_report->mods == (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)) \
|
||||
)
|
||||
|
||||
/* fix space cadet rollover issue */
|
||||
#define DISABLE_SPACE_CADET_ROLLOVER
|
||||
|
||||
/* Set 0 if debouncing isn't needed */
|
||||
#define DEBOUNCE 15
|
||||
|
||||
#define PREVENT_STUCK_MODIFIERS
|
||||
|
||||
#define USB_MAX_POWER_CONSUMPTION 500
|
||||
|
||||
#endif
|
80
keyboards/handwired/dactyl/dactyl.c
Normal file
80
keyboards/handwired/dactyl/dactyl.c
Normal file
@@ -0,0 +1,80 @@
|
||||
#include "dactyl.h"
|
||||
#include "i2cmaster.h"
|
||||
|
||||
|
||||
bool i2c_initialized = 0;
|
||||
uint8_t mcp23018_status = 0x20;
|
||||
|
||||
void matrix_init_kb(void) {
|
||||
DDRB &= ~(1<<4); // set B(4) as input
|
||||
PORTB &= ~(1<<4); // set B(4) internal pull-up disabled
|
||||
|
||||
// unused pins - C7, D4, D5, D7, E6
|
||||
// set as input with internal pull-up enabled
|
||||
DDRC &= ~(1<<7);
|
||||
DDRD &= ~(1<<5 | 1<<4);
|
||||
DDRE &= ~(1<<6);
|
||||
PORTC |= (1<<7);
|
||||
PORTD |= (1<<5 | 1<<4);
|
||||
PORTE |= (1<<6);
|
||||
|
||||
matrix_init_user();
|
||||
}
|
||||
|
||||
uint8_t init_mcp23018(void) {
|
||||
mcp23018_status = 0x20;
|
||||
|
||||
// I2C subsystem
|
||||
|
||||
if (i2c_initialized == 0) {
|
||||
i2c_init(); // on pins D(1,0)
|
||||
i2c_initialized = true;
|
||||
_delay_ms(1000);
|
||||
}
|
||||
|
||||
// set pin direction
|
||||
// - unused : input : 1
|
||||
// - input : input : 1
|
||||
// - driving : output : 0
|
||||
mcp23018_status = i2c_start(I2C_ADDR_WRITE); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_write(IODIRA); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_write(0b00000000); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_write(0b00111111); if (mcp23018_status) goto out;
|
||||
i2c_stop();
|
||||
|
||||
// set pull-up
|
||||
// - unused : on : 1
|
||||
// - input : on : 1
|
||||
// - driving : off : 0
|
||||
mcp23018_status = i2c_start(I2C_ADDR_WRITE); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_write(GPPUA); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_write(0b00000000); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_write(0b00111111); if (mcp23018_status) goto out;
|
||||
|
||||
out:
|
||||
i2c_stop();
|
||||
|
||||
return mcp23018_status;
|
||||
}
|
||||
|
||||
#ifdef ONEHAND_ENABLE
|
||||
__attribute__ ((weak))
|
||||
// swap-hands action needs a matrix to define the swap
|
||||
const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* Left hand, matrix positions */
|
||||
{{0,11}, {1,11}, {2,11}, {3,11}, {4,11}, {5,11}},
|
||||
{{0,10}, {1,10}, {2,10}, {3,10}, {4,10}, {5,10}},
|
||||
{{0,9}, {1,9}, {2,9}, {3,9}, {4,9}, {5,9}},
|
||||
{{0,8}, {1,8}, {2,8}, {3,8}, {4,8}, {5,8}},
|
||||
{{0,7}, {1,7}, {2,7}, {3,7}, {4,7}, {5,7}},
|
||||
{{0,6}, {1,6}, {2,6}, {3,6}, {4,6}, {5,6}},
|
||||
|
||||
/* Right hand, matrix positions */
|
||||
{{0,5}, {1,5}, {2,5}, {3,5}, {4,5}, {5,5}},
|
||||
{{0,4}, {1,4}, {2,4}, {3,4}, {4,4}, {5,4}},
|
||||
{{0,3}, {1,3}, {2,3}, {3,3}, {4,3}, {5,3}},
|
||||
{{0,2}, {1,2}, {2,2}, {3,2}, {4,2}, {5,2}},
|
||||
{{0,1}, {1,1}, {2,1}, {3,1}, {4,1}, {5,1}},
|
||||
{{0,0}, {1,0}, {2,0}, {3,0}, {4,0}, {5,0}},
|
||||
};
|
||||
#endif
|
74
keyboards/handwired/dactyl/dactyl.h
Normal file
74
keyboards/handwired/dactyl/dactyl.h
Normal file
@@ -0,0 +1,74 @@
|
||||
#ifndef DACTYL_H
|
||||
#define DACTYL_H
|
||||
|
||||
#include "quantum.h"
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include "i2cmaster.h"
|
||||
#include <util/delay.h>
|
||||
|
||||
#define CPU_PRESCALE(n) (CLKPR = 0x80, CLKPR = (n))
|
||||
#define CPU_16MHz 0x00
|
||||
|
||||
// I2C aliases and register addresses (see "mcp23018.md")
|
||||
#define I2C_ADDR 0b0100000
|
||||
#define I2C_ADDR_WRITE ( (I2C_ADDR<<1) | I2C_WRITE )
|
||||
#define I2C_ADDR_READ ( (I2C_ADDR<<1) | I2C_READ )
|
||||
#define IODIRA 0x00 // i/o direction register
|
||||
#define IODIRB 0x01
|
||||
#define GPPUA 0x0C // GPIO pull-up resistor register
|
||||
#define GPPUB 0x0D
|
||||
#define GPIOA 0x12 // general purpose i/o port register (write modifies OLAT)
|
||||
#define GPIOB 0x13
|
||||
#define OLATA 0x14 // output latch register
|
||||
#define OLATB 0x15
|
||||
|
||||
extern uint8_t mcp23018_status;
|
||||
|
||||
void init_dactyl(void);
|
||||
uint8_t init_mcp23018(void);
|
||||
|
||||
#define KEYMAP( \
|
||||
\
|
||||
/* left hand, spatial positions */ \
|
||||
k00,k01,k02,k03,k04,k05, \
|
||||
k10,k11,k12,k13,k14,k15, \
|
||||
k20,k21,k22,k23,k24,k25, \
|
||||
k30,k31,k32,k33,k34,k35, \
|
||||
k40,k41,k42,k43,k44, \
|
||||
k55,k50, \
|
||||
k54, \
|
||||
k53,k52,k51, \
|
||||
\
|
||||
/* right hand, spatial positions */ \
|
||||
k06,k07,k08,k09,k0A,k0B, \
|
||||
k16,k17,k18,k19,k1A,k1B, \
|
||||
k26,k27,k28,k29,k2A,k2B, \
|
||||
k36,k37,k38,k39,k3A,k3B, \
|
||||
k47,k48,k49,k4A,k4B, \
|
||||
k5B,k56, \
|
||||
k57, \
|
||||
k5A,k59,k58 ) \
|
||||
\
|
||||
/* matrix positions */ \
|
||||
{ \
|
||||
{ k00, k10, k20, k30, k40, k50 }, \
|
||||
{ k01, k11, k21, k31, k41, k51 }, \
|
||||
{ k02, k12, k22, k32, k42, k52 }, \
|
||||
{ k03, k13, k23, k33, k43, k53 }, \
|
||||
{ k04, k14, k24, k34, k44, k54 }, \
|
||||
{ k05, k15, k25, k35, KC_NO, k55 }, \
|
||||
\
|
||||
{ k06, k16, k26, k36, KC_NO, k56 }, \
|
||||
{ k07, k17, k27, k37, k47, k57 }, \
|
||||
{ k08, k18, k28, k38, k48, k58 }, \
|
||||
{ k09, k19, k29, k39, k49, k59 }, \
|
||||
{ k0A, k1A, k2A, k3A, k4A, k5A }, \
|
||||
{ k0B, k1B, k2B, k3B, k4B, k5B } \
|
||||
}
|
||||
|
||||
|
||||
|
||||
#define LAYOUT_dactyl KEYMAP
|
||||
|
||||
#endif
|
178
keyboards/handwired/dactyl/i2cmaster.h
Normal file
178
keyboards/handwired/dactyl/i2cmaster.h
Normal file
@@ -0,0 +1,178 @@
|
||||
#ifndef _I2CMASTER_H
|
||||
#define _I2CMASTER_H 1
|
||||
/*************************************************************************
|
||||
* Title: C include file for the I2C master interface
|
||||
* (i2cmaster.S or twimaster.c)
|
||||
* Author: Peter Fleury <pfleury@gmx.ch> http://jump.to/fleury
|
||||
* File: $Id: i2cmaster.h,v 1.10 2005/03/06 22:39:57 Peter Exp $
|
||||
* Software: AVR-GCC 3.4.3 / avr-libc 1.2.3
|
||||
* Target: any AVR device
|
||||
* Usage: see Doxygen manual
|
||||
**************************************************************************/
|
||||
|
||||
#ifdef DOXYGEN
|
||||
/**
|
||||
@defgroup pfleury_ic2master I2C Master library
|
||||
@code #include <i2cmaster.h> @endcode
|
||||
|
||||
@brief I2C (TWI) Master Software Library
|
||||
|
||||
Basic routines for communicating with I2C slave devices. This single master
|
||||
implementation is limited to one bus master on the I2C bus.
|
||||
|
||||
This I2c library is implemented as a compact assembler software implementation of the I2C protocol
|
||||
which runs on any AVR (i2cmaster.S) and as a TWI hardware interface for all AVR with built-in TWI hardware (twimaster.c).
|
||||
Since the API for these two implementations is exactly the same, an application can be linked either against the
|
||||
software I2C implementation or the hardware I2C implementation.
|
||||
|
||||
Use 4.7k pull-up resistor on the SDA and SCL pin.
|
||||
|
||||
Adapt the SCL and SDA port and pin definitions and eventually the delay routine in the module
|
||||
i2cmaster.S to your target when using the software I2C implementation !
|
||||
|
||||
Adjust the CPU clock frequence F_CPU in twimaster.c or in the Makfile when using the TWI hardware implementaion.
|
||||
|
||||
@note
|
||||
The module i2cmaster.S is based on the Atmel Application Note AVR300, corrected and adapted
|
||||
to GNU assembler and AVR-GCC C call interface.
|
||||
Replaced the incorrect quarter period delays found in AVR300 with
|
||||
half period delays.
|
||||
|
||||
@author Peter Fleury pfleury@gmx.ch http://jump.to/fleury
|
||||
|
||||
@par API Usage Example
|
||||
The following code shows typical usage of this library, see example test_i2cmaster.c
|
||||
|
||||
@code
|
||||
|
||||
#include <i2cmaster.h>
|
||||
|
||||
|
||||
#define Dev24C02 0xA2 // device address of EEPROM 24C02, see datasheet
|
||||
|
||||
int main(void)
|
||||
{
|
||||
unsigned char ret;
|
||||
|
||||
i2c_init(); // initialize I2C library
|
||||
|
||||
// write 0x75 to EEPROM address 5 (Byte Write)
|
||||
i2c_start_wait(Dev24C02+I2C_WRITE); // set device address and write mode
|
||||
i2c_write(0x05); // write address = 5
|
||||
i2c_write(0x75); // write value 0x75 to EEPROM
|
||||
i2c_stop(); // set stop conditon = release bus
|
||||
|
||||
|
||||
// read previously written value back from EEPROM address 5
|
||||
i2c_start_wait(Dev24C02+I2C_WRITE); // set device address and write mode
|
||||
|
||||
i2c_write(0x05); // write address = 5
|
||||
i2c_rep_start(Dev24C02+I2C_READ); // set device address and read mode
|
||||
|
||||
ret = i2c_readNak(); // read one byte from EEPROM
|
||||
i2c_stop();
|
||||
|
||||
for(;;);
|
||||
}
|
||||
@endcode
|
||||
|
||||
*/
|
||||
#endif /* DOXYGEN */
|
||||
|
||||
/**@{*/
|
||||
|
||||
#if (__GNUC__ * 100 + __GNUC_MINOR__) < 304
|
||||
#error "This library requires AVR-GCC 3.4 or later, update to newer AVR-GCC compiler !"
|
||||
#endif
|
||||
|
||||
#include <avr/io.h>
|
||||
|
||||
/** defines the data direction (reading from I2C device) in i2c_start(),i2c_rep_start() */
|
||||
#define I2C_READ 1
|
||||
|
||||
/** defines the data direction (writing to I2C device) in i2c_start(),i2c_rep_start() */
|
||||
#define I2C_WRITE 0
|
||||
|
||||
|
||||
/**
|
||||
@brief initialize the I2C master interace. Need to be called only once
|
||||
@param void
|
||||
@return none
|
||||
*/
|
||||
extern void i2c_init(void);
|
||||
|
||||
|
||||
/**
|
||||
@brief Terminates the data transfer and releases the I2C bus
|
||||
@param void
|
||||
@return none
|
||||
*/
|
||||
extern void i2c_stop(void);
|
||||
|
||||
|
||||
/**
|
||||
@brief Issues a start condition and sends address and transfer direction
|
||||
|
||||
@param addr address and transfer direction of I2C device
|
||||
@retval 0 device accessible
|
||||
@retval 1 failed to access device
|
||||
*/
|
||||
extern unsigned char i2c_start(unsigned char addr);
|
||||
|
||||
|
||||
/**
|
||||
@brief Issues a repeated start condition and sends address and transfer direction
|
||||
|
||||
@param addr address and transfer direction of I2C device
|
||||
@retval 0 device accessible
|
||||
@retval 1 failed to access device
|
||||
*/
|
||||
extern unsigned char i2c_rep_start(unsigned char addr);
|
||||
|
||||
|
||||
/**
|
||||
@brief Issues a start condition and sends address and transfer direction
|
||||
|
||||
If device is busy, use ack polling to wait until device ready
|
||||
@param addr address and transfer direction of I2C device
|
||||
@return none
|
||||
*/
|
||||
extern void i2c_start_wait(unsigned char addr);
|
||||
|
||||
|
||||
/**
|
||||
@brief Send one byte to I2C device
|
||||
@param data byte to be transfered
|
||||
@retval 0 write successful
|
||||
@retval 1 write failed
|
||||
*/
|
||||
extern unsigned char i2c_write(unsigned char data);
|
||||
|
||||
|
||||
/**
|
||||
@brief read one byte from the I2C device, request more data from device
|
||||
@return byte read from I2C device
|
||||
*/
|
||||
extern unsigned char i2c_readAck(void);
|
||||
|
||||
/**
|
||||
@brief read one byte from the I2C device, read is followed by a stop condition
|
||||
@return byte read from I2C device
|
||||
*/
|
||||
extern unsigned char i2c_readNak(void);
|
||||
|
||||
/**
|
||||
@brief read one byte from the I2C device
|
||||
|
||||
Implemented as a macro, which calls either i2c_readAck or i2c_readNak
|
||||
|
||||
@param ack 1 send ack, request more data from device<br>
|
||||
0 send nak, read is followed by a stop condition
|
||||
@return byte read from I2C device
|
||||
*/
|
||||
extern unsigned char i2c_read(unsigned char ack);
|
||||
#define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak();
|
||||
|
||||
|
||||
/**@}*/
|
||||
#endif
|
183
keyboards/handwired/dactyl/keymaps/default/keymap.c
Normal file
183
keyboards/handwired/dactyl/keymaps/default/keymap.c
Normal file
@@ -0,0 +1,183 @@
|
||||
#include "dactyl.h"
|
||||
#include "debug.h"
|
||||
#include "action_layer.h"
|
||||
#include "version.h"
|
||||
|
||||
#define BASE 0 // default layer
|
||||
#define SYMB 1 // symbols
|
||||
#define MDIA 2 // media keys
|
||||
|
||||
enum custom_keycodes {
|
||||
PLACEHOLDER = SAFE_RANGE, // ensure these codes start after the highest keycode defined in Quantum
|
||||
VRSN,
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* Keymap 0: Basic layer
|
||||
*
|
||||
* ,-----------------------------------------. ,-----------------------------------------.
|
||||
* | = | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | - |
|
||||
* |------+------+------+------+------+------| |------+------+------+------+------+------|
|
||||
* | Del | Q | W | E | R | T | | Y | U | I | O | P | \ |
|
||||
* |------+------+------+------+------+------| |------+------+------+------+------+------|
|
||||
* | BkSp | A | S | D | F | G | | H | J | K | L |; / L2|'/Cmd |
|
||||
* |------+------+------+------+------+------| |------+------+------+------+------+------|
|
||||
* |LShift|Z/Ctrl| X | C | V | B | | N | M | , | . |//Ctrl|RShift|
|
||||
* |------+------+------+------+------+------' `------+------+------+------+------+------|
|
||||
* |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | App | LGui | | Alt | ^/Esc|
|
||||
* ,------|------|------| |------+------+------.
|
||||
* | | | Home | | PgUp | | |
|
||||
* | Space|Backsp|------| |------| Tab |Enter |
|
||||
* | |ace | End | | PgDn | | |
|
||||
* `--------------------' `--------------------'
|
||||
*/
|
||||
[BASE] = LAYOUT_dactyl( // layer 0 : default
|
||||
// left hand
|
||||
KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5,
|
||||
KC_DELT, KC_Q, KC_W, KC_E, KC_R, KC_T,
|
||||
KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G,
|
||||
KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B,
|
||||
LT(SYMB,KC_GRV), KC_QUOT, LALT(KC_LSFT), KC_LEFT, KC_RGHT,
|
||||
ALT_T(KC_APP), KC_LGUI,
|
||||
KC_HOME,
|
||||
KC_SPC, KC_BSPC, KC_END,
|
||||
// right hand
|
||||
KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,
|
||||
KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS,
|
||||
KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN), GUI_T(KC_QUOT),
|
||||
KC_N, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLSH), KC_RSFT,
|
||||
KC_UP, KC_DOWN, KC_LBRC, KC_RBRC, KC_FN1,
|
||||
KC_RALT, CTL_T(KC_ESC),
|
||||
KC_PGUP,
|
||||
KC_PGDN, KC_TAB, KC_ENT
|
||||
),
|
||||
/* Keymap 1: Symbol Layer
|
||||
*
|
||||
* ,-----------------------------------------. ,-----------------------------------------.
|
||||
* |Versn | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | F11 |
|
||||
* |------+------+------+------+------+------| |------+------+------+------+------+------|
|
||||
* | | ! | @ | { | } | | | | Up | 7 | 8 | 9 | * | F12 |
|
||||
* |------+------+------+------+------+------| |------+------+------+------+------+------|
|
||||
* | | # | $ | ( | ) | ` | | Down | 4 | 5 | 6 | + | |
|
||||
* |------+------+------+------+------+------| |------+------+------+------+------+------|
|
||||
* | | % | ^ | [ | ] | ~ | | & | 1 | 2 | 3 | \ | |
|
||||
* |------+------+------+------+------+------' `------+------+------+------+------+------|
|
||||
* |RESET | | | | | | | . | 0 | = | |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | | | | | |
|
||||
* ,------|------|------| |------+------+------.
|
||||
* | | | | | | | |
|
||||
* | | |------| |------| | |
|
||||
* | | | | | | | |
|
||||
* `--------------------' `--------------------'
|
||||
*/
|
||||
// SYMBOLS
|
||||
[SYMB] = LAYOUT_dactyl(
|
||||
// left hand
|
||||
VRSN, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5,
|
||||
KC_TRNS, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE,
|
||||
KC_TRNS, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_GRV,
|
||||
KC_TRNS, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD,
|
||||
RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS,
|
||||
KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
// right hand
|
||||
KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
|
||||
KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12,
|
||||
KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS,
|
||||
KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS,
|
||||
KC_TRNS, KC_DOT, KC_0, KC_EQL, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS,
|
||||
KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS
|
||||
),
|
||||
/* Keymap 2: Media and mouse keys
|
||||
* ,-----------------------------------------. ,-----------------------------------------.
|
||||
* | | | | | | | | | | | | | |
|
||||
* |------+------+------+------+------+------| |------+------+------+------+------+------|
|
||||
* | | | | MsUp | | | | | | | | | |
|
||||
* |------+------+------+------+------+------| |------+------+------+------+------+------|
|
||||
* | | |MsLeft|MsDown|MsRght| | | | | | | | Play |
|
||||
* |------+------+------+------+------+------| |------+------+------+------+------+------|
|
||||
* | | | | | | | | | | Prev | Next | | |
|
||||
* |------+------+------+------+------+------' `------+------+------+------+------+------|
|
||||
* | | | | Lclk | Rclk | | VolUp| VolDn| Mute | | |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | | | | | |
|
||||
* ,------|------|------| |------+------+------.
|
||||
* | | | | | | |Brwser|
|
||||
* | | |------| |------| |Back |
|
||||
* | | | | | | | |
|
||||
* `--------------------' `--------------------'
|
||||
*
|
||||
*/
|
||||
// MEDIA AND MOUSE
|
||||
[MDIA] = LAYOUT_dactyl(
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2,
|
||||
KC_TRNS, KC_TRNS,
|
||||
KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
// right hand
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY,
|
||||
KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS,
|
||||
KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS,
|
||||
KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_WBAK
|
||||
),
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
[1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols)
|
||||
};
|
||||
|
||||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||
{
|
||||
// MACRODOWN only works in this function
|
||||
switch(id) {
|
||||
case 0:
|
||||
if (record->event.pressed) {
|
||||
SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (record->event.pressed) { // For resetting EEPROM
|
||||
eeconfig_init();
|
||||
}
|
||||
break;
|
||||
}
|
||||
return MACRO_NONE;
|
||||
};
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
switch (keycode) {
|
||||
case VRSN:
|
||||
if (record->event.pressed) {
|
||||
SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// Runs just one time when the keyboard initializes.
|
||||
void matrix_init_user(void) {
|
||||
|
||||
};
|
||||
|
||||
|
||||
// Runs constantly in the background, in a loop.
|
||||
void matrix_scan_user(void) {};
|
10
keyboards/handwired/dactyl/keymaps/default/readme.md
Normal file
10
keyboards/handwired/dactyl/keymaps/default/readme.md
Normal file
@@ -0,0 +1,10 @@
|
||||
# Dactyl Default Configuration
|
||||
|
||||
## Changelog
|
||||
|
||||
* Nov 2017:
|
||||
* Copied and adapted from the Ergodox EZ equivalent
|
||||
* Notable differences:
|
||||
- Don't try to have the columns that don't exist, naturally
|
||||
- Removed RGB keys, since there are no RGB LEDs in the Dactyl (as designed, at least)
|
||||
|
183
keyboards/handwired/dactyl/keymaps/dvorak/keymap.c
Normal file
183
keyboards/handwired/dactyl/keymaps/dvorak/keymap.c
Normal file
@@ -0,0 +1,183 @@
|
||||
#include "dactyl.h"
|
||||
#include "debug.h"
|
||||
#include "action_layer.h"
|
||||
#include "version.h"
|
||||
|
||||
#define BASE 0 // default layer
|
||||
#define SYMB 1 // symbols
|
||||
#define MDIA 2 // media keys
|
||||
|
||||
enum custom_keycodes {
|
||||
PLACEHOLDER = SAFE_RANGE, // ensure these codes start after the highest keycode defined in Quantum
|
||||
VRSN,
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* Keymap 0: Basic layer
|
||||
*
|
||||
* ,-----------------------------------------. ,-----------------------------------------.
|
||||
* | = | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | - |
|
||||
* |------+------+------+------+------+------| |------+------+------+------+------+------|
|
||||
* | Del | '" | , | . | P | Y | | F | G | C | R | L | \ |
|
||||
* |------+------+------+------+------+------| |------+------+------+------+------+------|
|
||||
* | BkSp | A | O | E | U | I | | D | H | T | N | S/L2 |//Cmd |
|
||||
* |------+------+------+------+------+------| |------+------+------+------+------+------|
|
||||
* |LShift|;/Ctrl| Q | J | K | X | | B | M | W | V |Z/Ctrl|RShift|
|
||||
* |------+------+------+------+------+------' `------+------+------+------+------+------|
|
||||
* |Grv/L1| = |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | App | LGui | | Alt | ^/Esc|
|
||||
* ,------|------|------| |------+------+------.
|
||||
* | | | Home | | PgUp | | |
|
||||
* | Space|Backsp|------| |------| Tab |Enter |
|
||||
* | |ace | End | | PgDn | | |
|
||||
* `--------------------' `--------------------'
|
||||
*/
|
||||
[BASE] = LAYOUT_dactyl( // layer 0 : default
|
||||
// left hand
|
||||
KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5,
|
||||
KC_DELT, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y,
|
||||
KC_BSPC, KC_A, KC_O, KC_E, KC_U, KC_I,
|
||||
KC_LSFT, CTL_T(KC_SCLN), KC_Q, KC_J, KC_K, KC_X,
|
||||
LT(SYMB,KC_GRV), KC_EQL, LALT(KC_LSFT), KC_LEFT, KC_RGHT,
|
||||
ALT_T(KC_APP), KC_LGUI,
|
||||
KC_HOME,
|
||||
KC_SPC, KC_BSPC, KC_END,
|
||||
// right hand
|
||||
KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,
|
||||
KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSLS,
|
||||
KC_D, KC_H, KC_T, KC_N, LT(MDIA, KC_S), GUI_T(KC_SLSH),
|
||||
KC_B, KC_M, KC_W, KC_V, CTL_T(KC_Z), KC_RSFT,
|
||||
KC_UP, KC_DOWN, KC_LBRC, KC_RBRC, KC_FN1,
|
||||
KC_RALT, CTL_T(KC_ESC),
|
||||
KC_PGUP,
|
||||
KC_PGDN, KC_TAB, KC_ENT
|
||||
),
|
||||
/* Keymap 1: Symbol Layer
|
||||
*
|
||||
* ,-----------------------------------------. ,-----------------------------------------.
|
||||
* |Versn | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | F11 |
|
||||
* |------+------+------+------+------+------| |------+------+------+------+------+------|
|
||||
* | | ! | @ | { | } | | | | Up | 7 | 8 | 9 | * | F12 |
|
||||
* |------+------+------+------+------+------| |------+------+------+------+------+------|
|
||||
* | | # | $ | ( | ) | ` | | Down | 4 | 5 | 6 | + | |
|
||||
* |------+------+------+------+------+------| |------+------+------+------+------+------|
|
||||
* | | % | ^ | [ | ] | ~ | | & | 1 | 2 | 3 | \ | |
|
||||
* |------+------+------+------+------+------' `------+------+------+------+------+------|
|
||||
* |RESET | | | | | | | . | 0 | = | |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | | | | | |
|
||||
* ,------|------|------| |------+------+------.
|
||||
* | | | | | | | |
|
||||
* | | |------| |------| | |
|
||||
* | | | | | | | |
|
||||
* `--------------------' `--------------------'
|
||||
*/
|
||||
// SYMBOLS
|
||||
[SYMB] = LAYOUT_dactyl(
|
||||
// left hand
|
||||
VRSN, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5,
|
||||
KC_TRNS, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE,
|
||||
KC_TRNS, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_GRV,
|
||||
KC_TRNS, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD,
|
||||
RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS,
|
||||
KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
// right hand
|
||||
KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
|
||||
KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12,
|
||||
KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS,
|
||||
KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS,
|
||||
KC_TRNS, KC_DOT, KC_0, KC_EQL, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS,
|
||||
KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS
|
||||
),
|
||||
/* Keymap 2: Media and mouse keys
|
||||
* ,-----------------------------------------. ,-----------------------------------------.
|
||||
* | | | | | | | | | | | | | |
|
||||
* |------+------+------+------+------+------| |------+------+------+------+------+------|
|
||||
* | | | | MsUp | | | | | | | | | |
|
||||
* |------+------+------+------+------+------| |------+------+------+------+------+------|
|
||||
* | | |MsLeft|MsDown|MsRght| | | | | | | | Play |
|
||||
* |------+------+------+------+------+------| |------+------+------+------+------+------|
|
||||
* | | | | | | | | | | Prev | Next | | |
|
||||
* |------+------+------+------+------+------' `------+------+------+------+------+------|
|
||||
* | | | | Lclk | Rclk | | VolUp| VolDn| Mute | | |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | | | | | |
|
||||
* ,------|------|------| |------+------+------.
|
||||
* | | | | | | |Brwser|
|
||||
* | | |------| |------| |Back |
|
||||
* | | | | | | | |
|
||||
* `--------------------' `--------------------'
|
||||
*
|
||||
*/
|
||||
// MEDIA AND MOUSE
|
||||
[MDIA] = LAYOUT_dactyl(
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2,
|
||||
KC_TRNS, KC_TRNS,
|
||||
KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
// right hand
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY,
|
||||
KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS,
|
||||
KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS,
|
||||
KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_WBAK
|
||||
),
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
[1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols)
|
||||
};
|
||||
|
||||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||
{
|
||||
// MACRODOWN only works in this function
|
||||
switch(id) {
|
||||
case 0:
|
||||
if (record->event.pressed) {
|
||||
SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (record->event.pressed) { // For resetting EEPROM
|
||||
eeconfig_init();
|
||||
}
|
||||
break;
|
||||
}
|
||||
return MACRO_NONE;
|
||||
};
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
switch (keycode) {
|
||||
case VRSN:
|
||||
if (record->event.pressed) {
|
||||
SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// Runs just one time when the keyboard initializes.
|
||||
void matrix_init_user(void) {
|
||||
|
||||
};
|
||||
|
||||
|
||||
// Runs constantly in the background, in a loop.
|
||||
void matrix_scan_user(void) {};
|
9
keyboards/handwired/dactyl/keymaps/dvorak/readme.md
Normal file
9
keyboards/handwired/dactyl/keymaps/dvorak/readme.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# Dactyl Dvorak keymap
|
||||
|
||||
Modifiers and layers 1+ are the same as in the default layout.
|
||||
Only the layer-0 dvorak-relevant keys are different.
|
||||
|
||||
## Changelog
|
||||
|
||||
* Nov 2017:
|
||||
* Copied and adapted from the default keymap.
|
162
keyboards/handwired/dactyl/keymaps/erincalling/keymap.c
Normal file
162
keyboards/handwired/dactyl/keymaps/erincalling/keymap.c
Normal file
@@ -0,0 +1,162 @@
|
||||
#include "dactyl.h"
|
||||
#include "debug.h"
|
||||
#include "action_layer.h"
|
||||
#include "version.h"
|
||||
|
||||
#define BASE 0 // default layer
|
||||
#define CONT 1 // control layer
|
||||
#define QWER 2 // qwerty layer
|
||||
|
||||
enum custom_keycodes {
|
||||
PLACEHOLDER = SAFE_RANGE, // ensure these codes start after the highest keycode defined in Quantum
|
||||
COLON_EQ,
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* Keymap 0: Basic layer
|
||||
*
|
||||
* ,-----------------------------------------. ,-----------------------------------------.
|
||||
* | Esc | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | \ |
|
||||
* |------+------+------+------+------+------| |------+------+------+------+------+------|
|
||||
* | Tab | '" | , | . | P | Y | | F | G | C | R | L | / |
|
||||
* |------+------+------+------+------+------| |------+------+------+------+------+------|
|
||||
* | := | A | O | E | U | I | | D | H | T | N | S | - |
|
||||
* |------+------+------+------+------+------| |------+------+------+------+------+------|
|
||||
* |LShift| ; | Q | J | K | X | | B | M | W | V | Z |RShift|
|
||||
* |------+------+------+------+------+------' `------+------+------+------+------+------|
|
||||
* | Home | ` | = | Left | Right| | Up | Down | [ | ] | End |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | LCtl | LAlt | | RCtl | Ralt |
|
||||
* ,------|------|------| |------+------+------.
|
||||
* | | | L1 | | L1 | | |
|
||||
* | Back |Delete|------| |------|Enter |Space |
|
||||
* |Space | | LGui | | RGui | | |
|
||||
* `--------------------' `--------------------'
|
||||
*/
|
||||
[BASE] = LAYOUT_dactyl( // layer 0 : default
|
||||
// left hand
|
||||
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5,
|
||||
KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y,
|
||||
COLON_EQ, KC_A, KC_O, KC_E, KC_U, KC_I,
|
||||
KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X,
|
||||
KC_HOME, KC_GRV, KC_EQL, KC_LEFT, KC_RGHT,
|
||||
KC_LCTRL, KC_LALT,
|
||||
MO(CONT),
|
||||
KC_BSPC, KC_DEL, KC_LGUI,
|
||||
// right hand
|
||||
KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS,
|
||||
KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH,
|
||||
KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS,
|
||||
KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT,
|
||||
KC_UP, KC_DOWN, KC_LBRC, KC_RBRC, KC_END,
|
||||
KC_RALT, KC_RCTL,
|
||||
MO(CONT),
|
||||
KC_RGUI, KC_ENT, KC_SPACE
|
||||
),
|
||||
/* Keymap 1: Control layer (media keys, Fkeys, numpad)
|
||||
*
|
||||
* ,-----------------------------------------. ,-----------------------------------------.
|
||||
* | | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | RESET|
|
||||
* |------+------+------+------+------+------| |------+------+------+------+------+------|
|
||||
* | | | Mute | VolD | VolU | | | | 7 | 8 | 9 | + | |
|
||||
* |------+------+------+------+------+------| |------+------+------+------+------+------|
|
||||
* | | | Prev |PPause| Next | | | | 4 | 5 | 6 | = | |
|
||||
* |------+------+------+------+------+------| |------+------+------+------+------+------|
|
||||
* | | | | | | | | | 1 | 2 | 3 | , | |
|
||||
* |------+------+------+------+------+------' `------+------+------+------+------+------|
|
||||
* |PageUp| | | | | | 0 | 0 | . | |PageDn|
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | | | | | |
|
||||
* ,------|------|------| |------+------+------.
|
||||
* | | | | | | | |
|
||||
* | | |------| |------| | |
|
||||
* | | | | | | | |
|
||||
* `--------------------' `--------------------'
|
||||
*/
|
||||
// SYMBOLS
|
||||
[CONT] = LAYOUT_dactyl(
|
||||
// left hand
|
||||
KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5,
|
||||
KC_TRNS, KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS,
|
||||
TG(QWER), KC_TRNS, KC_MPRV, KC_MPLY, KC_MNXT, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_PGUP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS,
|
||||
KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
// right hand
|
||||
KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, RESET,
|
||||
KC_TRNS, KC_7, KC_8, KC_9, KC_KP_PLUS, KC_TRNS,
|
||||
KC_TRNS, KC_4, KC_5, KC_6, KC_EQL, KC_TRNS,
|
||||
KC_TRNS, KC_1, KC_2, KC_3, KC_COMM, KC_TRNS,
|
||||
KC_0, KC_0, KC_DOT, KC_TRNS, KC_PGDN,
|
||||
KC_TRNS, KC_TRNS,
|
||||
KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS
|
||||
),
|
||||
/* Keymap 2: QWERTY overlay
|
||||
* ,-----------------------------------------. ,-----------------------------------------.
|
||||
* | | | | | | | | | | | | | [ |
|
||||
* |------+------+------+------+------+------| |------+------+------+------+------+------|
|
||||
* | | Q | W | E | R | T | | Y | U | I | O | P | ] |
|
||||
* |------+------+------+------+------+------| |------+------+------+------+------+------|
|
||||
* | | A | S | D | F | G | | H | J | K | L | ; | '" |
|
||||
* |------+------+------+------+------+------| |------+------+------+------+------+------|
|
||||
* | | Z | X | C | V | B | | N | M | , | . | / | |
|
||||
* |------+------+------+------+------+------' `------+------+------+------+------+------|
|
||||
* | | | | | | | | | - | \ | |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | | | | | |
|
||||
* ,------|------|------| |------+------+------.
|
||||
* | | | | | | | |
|
||||
* | | |------| |------| | |
|
||||
* | | | | | | | |
|
||||
* `--------------------' `--------------------'
|
||||
*
|
||||
*/
|
||||
// QWERTY
|
||||
[QWER] = LAYOUT_dactyl(
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_Q, KC_W, KC_E, KC_R, KC_T,
|
||||
KC_TRNS, KC_A, KC_S, KC_D, KC_F, KC_G,
|
||||
KC_TRNS, KC_Z, KC_X, KC_C, KC_V, KC_B,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS,
|
||||
KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
// right hand
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LBRC,
|
||||
KC_Y, KC_U, KC_I, KC_O, KC_P, KC_RBRC,
|
||||
KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
|
||||
KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_MINS, KC_BSLS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS,
|
||||
KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS
|
||||
),
|
||||
};
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
if (record->event.pressed) {
|
||||
switch(keycode) {
|
||||
case COLON_EQ:
|
||||
SEND_STRING(":=");
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Runs just one time when the keyboard initializes.
|
||||
void matrix_init_user(void) {
|
||||
|
||||
};
|
||||
|
||||
|
||||
// Runs constantly in the background, in a loop.
|
||||
void matrix_scan_user(void) {};
|
6
keyboards/handwired/dactyl/keymaps/erincalling/readme.md
Normal file
6
keyboards/handwired/dactyl/keymaps/erincalling/readme.md
Normal file
@@ -0,0 +1,6 @@
|
||||
# Erincalling Dactyl keymap
|
||||
|
||||
## Changelog
|
||||
|
||||
* Nov 2017:
|
||||
* Ported and adapted from the ergodox-firmware layout I'd been using
|
393
keyboards/handwired/dactyl/matrix.c
Normal file
393
keyboards/handwired/dactyl/matrix.c
Normal file
@@ -0,0 +1,393 @@
|
||||
/*
|
||||
|
||||
Copyright 2013 Oleg Kostyuk <cub.uanic@gmail.com>
|
||||
Copyright 2017 Erin Call <hello@erincall.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 "action_layer.h"
|
||||
#include "print.h"
|
||||
#include "debug.h"
|
||||
#include "util.h"
|
||||
#include "matrix.h"
|
||||
#include "dactyl.h"
|
||||
#include "i2cmaster.h"
|
||||
#ifdef DEBUG_MATRIX_SCAN_RATE
|
||||
#include "timer.h"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* This constant define not debouncing time in msecs, but amount of matrix
|
||||
* scan loops which should be made to get stable debounced results.
|
||||
*
|
||||
* On the Dactyl, the matrix scan rate is relatively low, because
|
||||
* communicating with the left hand's I/O expander is slower than simply
|
||||
* selecting local pins.
|
||||
* Now it's only 317 scans/second, or about 3.15 msec/scan.
|
||||
* According to Cherry specs, debouncing time is 5 msec.
|
||||
*
|
||||
* And so, there is no sense to have DEBOUNCE higher than 2.
|
||||
*/
|
||||
|
||||
#ifndef DEBOUNCE
|
||||
# define DEBOUNCE 5
|
||||
#endif
|
||||
|
||||
/* matrix state(1:on, 0:off) */
|
||||
static matrix_row_t matrix[MATRIX_ROWS];
|
||||
|
||||
// Debouncing: store for each key the number of scans until it's eligible to
|
||||
// change. When scanning the matrix, ignore any changes in keys that have
|
||||
// already changed in the last DEBOUNCE scans.
|
||||
static uint8_t debounce_matrix[MATRIX_ROWS * MATRIX_COLS];
|
||||
|
||||
static matrix_row_t read_cols(uint8_t row);
|
||||
static void init_cols(void);
|
||||
static void unselect_rows(void);
|
||||
static void select_row(uint8_t row);
|
||||
|
||||
static uint8_t mcp23018_reset_loop;
|
||||
|
||||
#ifdef DEBUG_MATRIX_SCAN_RATE
|
||||
uint32_t matrix_timer;
|
||||
uint32_t matrix_scan_count;
|
||||
#endif
|
||||
|
||||
|
||||
__attribute__ ((weak))
|
||||
void matrix_init_user(void) {}
|
||||
|
||||
__attribute__ ((weak))
|
||||
void matrix_scan_user(void) {}
|
||||
|
||||
__attribute__ ((weak))
|
||||
void matrix_init_kb(void) {
|
||||
matrix_init_user();
|
||||
}
|
||||
|
||||
__attribute__ ((weak))
|
||||
void matrix_scan_kb(void) {
|
||||
matrix_scan_user();
|
||||
}
|
||||
|
||||
inline
|
||||
uint8_t matrix_rows(void)
|
||||
{
|
||||
return MATRIX_ROWS;
|
||||
}
|
||||
|
||||
inline
|
||||
uint8_t matrix_cols(void)
|
||||
{
|
||||
return MATRIX_COLS;
|
||||
}
|
||||
|
||||
void matrix_init(void)
|
||||
{
|
||||
// initialize row and col
|
||||
|
||||
mcp23018_status = init_mcp23018();
|
||||
|
||||
|
||||
unselect_rows();
|
||||
init_cols();
|
||||
|
||||
// initialize matrix state: all keys off
|
||||
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
|
||||
matrix[i] = 0;
|
||||
for (uint8_t j=0; j < MATRIX_COLS; ++j) {
|
||||
debounce_matrix[i * MATRIX_COLS + j] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef DEBUG_MATRIX_SCAN_RATE
|
||||
matrix_timer = timer_read32();
|
||||
matrix_scan_count = 0;
|
||||
#endif
|
||||
|
||||
matrix_init_quantum();
|
||||
|
||||
}
|
||||
|
||||
void matrix_power_up(void) {
|
||||
mcp23018_status = init_mcp23018();
|
||||
|
||||
unselect_rows();
|
||||
init_cols();
|
||||
|
||||
// initialize matrix state: all keys off
|
||||
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
|
||||
matrix[i] = 0;
|
||||
}
|
||||
|
||||
#ifdef DEBUG_MATRIX_SCAN_RATE
|
||||
matrix_timer = timer_read32();
|
||||
matrix_scan_count = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
// Returns a matrix_row_t whose bits are set if the corresponding key should be
|
||||
// eligible to change in this scan.
|
||||
matrix_row_t debounce_mask(uint8_t row) {
|
||||
matrix_row_t result = 0;
|
||||
for (uint8_t j=0; j < MATRIX_COLS; ++j) {
|
||||
if (debounce_matrix[row * MATRIX_COLS + j]) {
|
||||
--debounce_matrix[row * MATRIX_COLS + j];
|
||||
} else {
|
||||
result |= (1 << j);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
// Report changed keys in the given row. Resets the debounce countdowns
|
||||
// corresponding to each set bit in 'change' to DEBOUNCE.
|
||||
void debounce_report(matrix_row_t change, uint8_t row) {
|
||||
for (uint8_t i = 0; i < MATRIX_COLS; ++i) {
|
||||
if (change & (1 << i)) {
|
||||
debounce_matrix[row * MATRIX_COLS + i] = DEBOUNCE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t matrix_scan(void)
|
||||
{
|
||||
if (mcp23018_status) { // if there was an error
|
||||
if (++mcp23018_reset_loop == 0) {
|
||||
// since mcp23018_reset_loop is 8 bit - we'll try to reset once in 255 matrix scans
|
||||
// this will be approx bit more frequent than once per second
|
||||
print("trying to reset mcp23018\n");
|
||||
mcp23018_status = init_mcp23018();
|
||||
if (mcp23018_status) {
|
||||
print("left side not responding\n");
|
||||
} else {
|
||||
print("left side attached\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef DEBUG_MATRIX_SCAN_RATE
|
||||
matrix_scan_count++;
|
||||
|
||||
uint32_t timer_now = timer_read32();
|
||||
if (TIMER_DIFF_32(timer_now, matrix_timer)>1000) {
|
||||
print("matrix scan frequency: ");
|
||||
pdec(matrix_scan_count);
|
||||
print("\n");
|
||||
|
||||
matrix_timer = timer_now;
|
||||
matrix_scan_count = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
|
||||
select_row(i);
|
||||
wait_us(30); // without this wait read unstable value.
|
||||
matrix_row_t mask = debounce_mask(i);
|
||||
matrix_row_t cols = (read_cols(i) & mask) | (matrix[i] & ~mask);
|
||||
debounce_report(cols ^ matrix[i], i);
|
||||
matrix[i] = cols;
|
||||
|
||||
unselect_rows();
|
||||
}
|
||||
|
||||
matrix_scan_quantum();
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
bool matrix_is_modified(void) // deprecated and evidently not called.
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
inline
|
||||
bool matrix_is_on(uint8_t row, uint8_t col)
|
||||
{
|
||||
return (matrix[row] & ((matrix_row_t)1<<col));
|
||||
}
|
||||
|
||||
inline
|
||||
matrix_row_t matrix_get_row(uint8_t row)
|
||||
{
|
||||
return matrix[row];
|
||||
}
|
||||
|
||||
void matrix_print(void)
|
||||
{
|
||||
print("\nr/c 0123456789ABCDEF\n");
|
||||
for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
|
||||
phex(row); print(": ");
|
||||
pbin_reverse16(matrix_get_row(row));
|
||||
print("\n");
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t matrix_key_count(void)
|
||||
{
|
||||
uint8_t count = 0;
|
||||
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
|
||||
count += bitpop16(matrix[i]);
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
/* Column pin configuration
|
||||
*
|
||||
* Teensy
|
||||
* col: 0 1 2 3 4 5
|
||||
* pin: F0 F1 F4 F5 F6 F7
|
||||
*
|
||||
* MCP23018
|
||||
* col: 0 1 2 3 4 5
|
||||
* pin: B5 B4 B3 B2 B1 B0
|
||||
*/
|
||||
static void init_cols(void)
|
||||
{
|
||||
// init on mcp23018
|
||||
// not needed, already done as part of init_mcp23018()
|
||||
|
||||
// init on teensy
|
||||
// Input with pull-up(DDR:0, PORT:1)
|
||||
DDRF &= ~(1<<7 | 1<<6 | 1<<5 | 1<<4 | 1<<1 | 1<<0);
|
||||
PORTF |= (1<<7 | 1<<6 | 1<<5 | 1<<4 | 1<<1 | 1<<0);
|
||||
}
|
||||
|
||||
static matrix_row_t read_cols(uint8_t row)
|
||||
{
|
||||
if (row < 6) {
|
||||
if (mcp23018_status) { // if there was an error
|
||||
return 0;
|
||||
} else {
|
||||
uint8_t data = 0;
|
||||
mcp23018_status = i2c_start(I2C_ADDR_WRITE); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_write(GPIOB); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_start(I2C_ADDR_READ); if (mcp23018_status) goto out;
|
||||
data = i2c_readNak();
|
||||
data = ~data;
|
||||
out:
|
||||
i2c_stop();
|
||||
return data;
|
||||
}
|
||||
} else {
|
||||
// read from teensy
|
||||
return
|
||||
(PINF&(1<<0) ? 0 : (1<<0)) |
|
||||
(PINF&(1<<1) ? 0 : (1<<1)) |
|
||||
(PINF&(1<<4) ? 0 : (1<<2)) |
|
||||
(PINF&(1<<5) ? 0 : (1<<3)) |
|
||||
(PINF&(1<<6) ? 0 : (1<<4)) |
|
||||
(PINF&(1<<7) ? 0 : (1<<5)) ;
|
||||
}
|
||||
}
|
||||
|
||||
/* Row pin configuration
|
||||
*
|
||||
* Teensy
|
||||
* row: 6 7 8 9 10 11
|
||||
* pin: B1 B2 B3 D2 D3 C6
|
||||
*
|
||||
* MCP23018
|
||||
* row: 0 1 2 3 4 5
|
||||
* pin: A0 A1 A2 A3 A4 A5
|
||||
*/
|
||||
static void unselect_rows(void)
|
||||
{
|
||||
// unselect on mcp23018
|
||||
if (mcp23018_status) { // if there was an error
|
||||
// do nothing
|
||||
} else {
|
||||
// set all rows hi-Z : 1
|
||||
mcp23018_status = i2c_start(I2C_ADDR_WRITE); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_write(GPIOA); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_write(0xFF); if (mcp23018_status) goto out;
|
||||
out:
|
||||
i2c_stop();
|
||||
}
|
||||
|
||||
// unselect on teensy
|
||||
// Hi-Z(DDR:0, PORT:0) to unselect
|
||||
DDRB &= ~(1<<1 | 1<<2 | 1<<3);
|
||||
PORTB &= ~(1<<1 | 1<<2 | 1<<3);
|
||||
DDRD &= ~(1<<2 | 1<<3);
|
||||
PORTD &= ~(1<<2 | 1<<3);
|
||||
DDRC &= ~(1<<6);
|
||||
PORTC &= ~(1<<6);
|
||||
}
|
||||
|
||||
/* Row pin configuration
|
||||
*
|
||||
* Teensy
|
||||
* row: 6 7 8 9 10 11
|
||||
* pin: B1 B2 B3 D2 D3 C6
|
||||
*
|
||||
* MCP23018
|
||||
* row: 0 1 2 3 4 5
|
||||
* pin: A0 A1 A2 A3 A4 A5
|
||||
*/
|
||||
static void select_row(uint8_t row)
|
||||
{
|
||||
if (row < 6) {
|
||||
// select on mcp23018
|
||||
if (mcp23018_status) { // if there was an error
|
||||
// do nothing
|
||||
} else {
|
||||
// set active row low : 0
|
||||
// set other rows hi-Z : 1
|
||||
mcp23018_status = i2c_start(I2C_ADDR_WRITE); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_write(GPIOA); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_write(0xFF & ~(1<<row)); if (mcp23018_status) goto out;
|
||||
out:
|
||||
i2c_stop();
|
||||
}
|
||||
} else {
|
||||
// select on teensy
|
||||
// Output low(DDR:1, PORT:0) to select
|
||||
switch (row) {
|
||||
case 6:
|
||||
DDRB |= (1<<1);
|
||||
PORTB &= ~(1<<1);
|
||||
break;
|
||||
case 7:
|
||||
DDRB |= (1<<2);
|
||||
PORTB &= ~(1<<2);
|
||||
break;
|
||||
case 8:
|
||||
DDRB |= (1<<3);
|
||||
PORTB &= ~(1<<3);
|
||||
break;
|
||||
case 9:
|
||||
DDRD |= (1<<2);
|
||||
PORTD &= ~(1<<3);
|
||||
break;
|
||||
case 10:
|
||||
DDRD |= (1<<3);
|
||||
PORTD &= ~(1<<3);
|
||||
break;
|
||||
case 11:
|
||||
DDRC |= (1<<6);
|
||||
PORTC &= ~(1<<6);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
39
keyboards/handwired/dactyl/readme.md
Normal file
39
keyboards/handwired/dactyl/readme.md
Normal file
@@ -0,0 +1,39 @@
|
||||
# Dactyl
|
||||
|
||||
See https://github.com/adereth/dactyl-keyboard
|
||||
|
||||
The Dactyl uses the [Teensy Loader](https://www.pjrc.com/teensy/loader.html).
|
||||
|
||||
Linux users need to modify udev rules as described on the [Teensy
|
||||
Linux page]. Some distributions provide a binary, maybe called
|
||||
`teensy-loader-cli`.
|
||||
|
||||
[Teensy Linux page]: https://www.pjrc.com/teensy/loader_linux.html
|
||||
|
||||
To flash the firmware:
|
||||
|
||||
- Build the firmware with `make handwired/dactyl:<keymapname>`, for example `make handwired/dactyl:default`
|
||||
- This will result in a hex file called `handwired_dactyl_<keymapname>.hex`, e.g.
|
||||
`handwired_dactyl_default.hex`
|
||||
|
||||
- Start the teensy loader.
|
||||
|
||||
- Load the .hex file into it.
|
||||
|
||||
- Put the Teensy in firmware-loading mode:
|
||||
* If your current layout has a RESET key, press it.
|
||||
* If you lack a RESET key, press the reset button on the Teensy board itself.
|
||||
|
||||
- Click the button in the Teensy app to download the firmware.
|
||||
|
||||
To flash with ´teensy-loader-cli´:
|
||||
|
||||
- Build the firmware as above
|
||||
|
||||
- Run `<path/to/>teensy_loader_cli -mmcu=atmega32u4 -w handwired_dactyl_<keymapname>.hex`
|
||||
|
||||
- If you like, you can do both at once: `make handwired/dactyl:<keymapname>:teensy`
|
||||
|
||||
- Put the Teensy in firmware-loading mode:
|
||||
* If your current layout has a RESET key, press it.
|
||||
* If you lack a RESET key, press the reset button on the Teensy board itself.
|
86
keyboards/handwired/dactyl/rules.mk
Normal file
86
keyboards/handwired/dactyl/rules.mk
Normal file
@@ -0,0 +1,86 @@
|
||||
#----------------------------------------------------------------------------
|
||||
# On command line:
|
||||
#
|
||||
# make = Make software.
|
||||
#
|
||||
# make clean = Clean out built project files.
|
||||
#
|
||||
# That's pretty much all you need. To compile, always go make clean,
|
||||
# followed by make.
|
||||
#
|
||||
# For advanced users only:
|
||||
# make teensy = Download the hex file to the device, using teensy_loader_cli.
|
||||
# (must have teensy_loader_cli installed).
|
||||
#
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
# # project specific files
|
||||
SRC = twimaster.c \
|
||||
matrix.c
|
||||
|
||||
# MCU name
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=512
|
||||
|
||||
|
||||
# Build Options
|
||||
# comment out to disable the options.
|
||||
#
|
||||
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
|
||||
MIDI_ENABLE = no # MIDI support (+2400 to 4200)
|
||||
POINTING_DEVICE_ENABLE = no
|
||||
MOUSEKEY_ENABLE = no # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE = no # Console for debug(+8000)
|
||||
COMMAND_ENABLE = no # Commands for debug and configuration
|
||||
CUSTOM_MATRIX = yes # Custom matrix file for the Dactyl
|
||||
NKRO_ENABLE = yes # USB Nkey Rollover
|
||||
UNICODE_ENABLE = yes # Unicode
|
||||
ONEHAND_ENABLE = yes # Allow swapping hands of keyboard
|
||||
SLEEP_LED_ENABLE = no
|
||||
API_SYSEX_ENABLE = no
|
||||
RGBLIGHT_ENABLE = no
|
207
keyboards/handwired/dactyl/twimaster.c
Normal file
207
keyboards/handwired/dactyl/twimaster.c
Normal file
@@ -0,0 +1,207 @@
|
||||
/*************************************************************************
|
||||
* Title: I2C master library using hardware TWI interface
|
||||
* Author: Peter Fleury <pfleury@gmx.ch> http://jump.to/fleury
|
||||
* File: $Id: twimaster.c,v 1.3 2005/07/02 11:14:21 Peter Exp $
|
||||
* Software: AVR-GCC 3.4.3 / avr-libc 1.2.3
|
||||
* Target: any AVR device with hardware TWI
|
||||
* Usage: API compatible with I2C Software Library i2cmaster.h
|
||||
**************************************************************************/
|
||||
#include <inttypes.h>
|
||||
#include <compat/twi.h>
|
||||
|
||||
#include <i2cmaster.h>
|
||||
|
||||
/* define CPU frequency in Hz here if not defined in Makefile */
|
||||
#ifndef F_CPU
|
||||
#define F_CPU 16000000UL
|
||||
#endif
|
||||
|
||||
/* I2C clock in Hz */
|
||||
#define SCL_CLOCK 400000L
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
Initialization of the I2C bus interface. Need to be called only once
|
||||
*************************************************************************/
|
||||
void i2c_init(void)
|
||||
{
|
||||
/* initialize TWI clock
|
||||
* minimal values in Bit Rate Register (TWBR) and minimal Prescaler
|
||||
* bits in the TWI Status Register should give us maximal possible
|
||||
* I2C bus speed - about 444 kHz
|
||||
*
|
||||
* for more details, see 20.5.2 in ATmega16/32 secification
|
||||
*/
|
||||
|
||||
TWSR = 0; /* no prescaler */
|
||||
TWBR = 10; /* must be >= 10 for stable operation */
|
||||
|
||||
}/* i2c_init */
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
Issues a start condition and sends address and transfer direction.
|
||||
return 0 = device accessible, 1= failed to access device
|
||||
*************************************************************************/
|
||||
unsigned char i2c_start(unsigned char address)
|
||||
{
|
||||
uint8_t twst;
|
||||
|
||||
// send START condition
|
||||
TWCR = (1<<TWINT) | (1<<TWSTA) | (1<<TWEN);
|
||||
|
||||
// wait until transmission completed
|
||||
while(!(TWCR & (1<<TWINT)));
|
||||
|
||||
// check value of TWI Status Register. Mask prescaler bits.
|
||||
twst = TW_STATUS & 0xF8;
|
||||
if ( (twst != TW_START) && (twst != TW_REP_START)) return 1;
|
||||
|
||||
// send device address
|
||||
TWDR = address;
|
||||
TWCR = (1<<TWINT) | (1<<TWEN);
|
||||
|
||||
// wail until transmission completed and ACK/NACK has been received
|
||||
while(!(TWCR & (1<<TWINT)));
|
||||
|
||||
// check value of TWI Status Register. Mask prescaler bits.
|
||||
twst = TW_STATUS & 0xF8;
|
||||
if ( (twst != TW_MT_SLA_ACK) && (twst != TW_MR_SLA_ACK) ) return 1;
|
||||
|
||||
return 0;
|
||||
|
||||
}/* i2c_start */
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
Issues a start condition and sends address and transfer direction.
|
||||
If device is busy, use ack polling to wait until device is ready
|
||||
|
||||
Input: address and transfer direction of I2C device
|
||||
*************************************************************************/
|
||||
void i2c_start_wait(unsigned char address)
|
||||
{
|
||||
uint8_t twst;
|
||||
|
||||
|
||||
while ( 1 )
|
||||
{
|
||||
// send START condition
|
||||
TWCR = (1<<TWINT) | (1<<TWSTA) | (1<<TWEN);
|
||||
|
||||
// wait until transmission completed
|
||||
while(!(TWCR & (1<<TWINT)));
|
||||
|
||||
// check value of TWI Status Register. Mask prescaler bits.
|
||||
twst = TW_STATUS & 0xF8;
|
||||
if ( (twst != TW_START) && (twst != TW_REP_START)) continue;
|
||||
|
||||
// send device address
|
||||
TWDR = address;
|
||||
TWCR = (1<<TWINT) | (1<<TWEN);
|
||||
|
||||
// wail until transmission completed
|
||||
while(!(TWCR & (1<<TWINT)));
|
||||
|
||||
// check value of TWI Status Register. Mask prescaler bits.
|
||||
twst = TW_STATUS & 0xF8;
|
||||
if ( (twst == TW_MT_SLA_NACK )||(twst ==TW_MR_DATA_NACK) )
|
||||
{
|
||||
/* device busy, send stop condition to terminate write operation */
|
||||
TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWSTO);
|
||||
|
||||
// wait until stop condition is executed and bus released
|
||||
while(TWCR & (1<<TWSTO));
|
||||
|
||||
continue;
|
||||
}
|
||||
//if( twst != TW_MT_SLA_ACK) return 1;
|
||||
break;
|
||||
}
|
||||
|
||||
}/* i2c_start_wait */
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
Issues a repeated start condition and sends address and transfer direction
|
||||
|
||||
Input: address and transfer direction of I2C device
|
||||
|
||||
Return: 0 device accessible
|
||||
1 failed to access device
|
||||
*************************************************************************/
|
||||
unsigned char i2c_rep_start(unsigned char address)
|
||||
{
|
||||
return i2c_start( address );
|
||||
|
||||
}/* i2c_rep_start */
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
Terminates the data transfer and releases the I2C bus
|
||||
*************************************************************************/
|
||||
void i2c_stop(void)
|
||||
{
|
||||
/* send stop condition */
|
||||
TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWSTO);
|
||||
|
||||
// wait until stop condition is executed and bus released
|
||||
while(TWCR & (1<<TWSTO));
|
||||
|
||||
}/* i2c_stop */
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
Send one byte to I2C device
|
||||
|
||||
Input: byte to be transfered
|
||||
Return: 0 write successful
|
||||
1 write failed
|
||||
*************************************************************************/
|
||||
unsigned char i2c_write( unsigned char data )
|
||||
{
|
||||
uint8_t twst;
|
||||
|
||||
// send data to the previously addressed device
|
||||
TWDR = data;
|
||||
TWCR = (1<<TWINT) | (1<<TWEN);
|
||||
|
||||
// wait until transmission completed
|
||||
while(!(TWCR & (1<<TWINT)));
|
||||
|
||||
// check value of TWI Status Register. Mask prescaler bits
|
||||
twst = TW_STATUS & 0xF8;
|
||||
if( twst != TW_MT_DATA_ACK) return 1;
|
||||
return 0;
|
||||
|
||||
}/* i2c_write */
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
Read one byte from the I2C device, request more data from device
|
||||
|
||||
Return: byte read from I2C device
|
||||
*************************************************************************/
|
||||
unsigned char i2c_readAck(void)
|
||||
{
|
||||
TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWEA);
|
||||
while(!(TWCR & (1<<TWINT)));
|
||||
|
||||
return TWDR;
|
||||
|
||||
}/* i2c_readAck */
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
Read one byte from the I2C device, read is followed by a stop condition
|
||||
|
||||
Return: byte read from I2C device
|
||||
*************************************************************************/
|
||||
unsigned char i2c_readNak(void)
|
||||
{
|
||||
TWCR = (1<<TWINT) | (1<<TWEN);
|
||||
while(!(TWCR & (1<<TWINT)));
|
||||
|
||||
return TWDR;
|
||||
|
||||
}/* i2c_readNak */
|
45
keyboards/handwired/maartenwut/config.h
Executable file
45
keyboards/handwired/maartenwut/config.h
Executable file
@@ -0,0 +1,45 @@
|
||||
#ifndef CONFIG_H
|
||||
#define CONFIG_H
|
||||
|
||||
#include "config_common.h"
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define VENDOR_ID 0xBB80
|
||||
#define PRODUCT_ID 0x050D
|
||||
#define DEVICE_VER 0x0001
|
||||
#define MANUFACTURER Maartenwut
|
||||
#define PRODUCT Ortho
|
||||
#define DESCRIPTION Handwired ortholinear keyboard
|
||||
|
||||
/* key matrix size */
|
||||
#define MATRIX_ROWS 5
|
||||
#define MATRIX_COLS 14
|
||||
/*
|
||||
* Keyboard Matrix Assignments
|
||||
*
|
||||
* Change this to how you wired your keyboard
|
||||
* COLS: AVR pins used for columns, left to right
|
||||
* ROWS: AVR pins used for rows, top to bottom
|
||||
* DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
|
||||
* ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
|
||||
*
|
||||
*/
|
||||
#define MATRIX_ROW_PINS { D4, D0, D1, D2, D3 }
|
||||
#define MATRIX_COL_PINS { C6, D7, E6, B4, B5, B6, B7, D6, F0, F1, F4, F5, F6, F7 }
|
||||
#define UNUSED_PINS
|
||||
|
||||
/* COL2ROW or ROW2COL */
|
||||
#define DIODE_DIRECTION COL2ROW
|
||||
|
||||
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
|
||||
#define DEBOUNCING_DELAY 5
|
||||
|
||||
/* key combination for magic key command */
|
||||
#define IS_COMMAND() ( \
|
||||
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
|
||||
)
|
||||
|
||||
#define QMK_ESC_OUTPUT C6 // usually COL
|
||||
#define QMK_ESC_INPUT D0 // usually ROW
|
||||
|
||||
#endif
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user