mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-08-05 14:08:39 +00:00
Compare commits
130 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
73e92ef0c0 | ||
![]() |
d210ac7a3e | ||
![]() |
f16b5cc92b | ||
![]() |
5632552558 | ||
![]() |
d3a6296199 | ||
![]() |
b1bf0879ad | ||
![]() |
b11a776cef | ||
![]() |
6fa3cfbf53 | ||
![]() |
24b3556e84 | ||
![]() |
85688e5b52 | ||
![]() |
e22c399245 | ||
![]() |
cc87445481 | ||
![]() |
ca02863b56 | ||
![]() |
db8454ca99 | ||
![]() |
357c1bb657 | ||
![]() |
8cf15bffa0 | ||
![]() |
340dd09758 | ||
![]() |
899731679d | ||
![]() |
39addf8bc9 | ||
![]() |
fa1ac4d724 | ||
![]() |
fc1e22ea94 | ||
![]() |
3c95de3c69 | ||
![]() |
ffb2557a3a | ||
![]() |
a5b10e5da2 | ||
![]() |
bef554d18b | ||
![]() |
9ed0c2d57b | ||
![]() |
b0a021c07a | ||
![]() |
c8267d9fea | ||
![]() |
6539426f61 | ||
![]() |
03d16db942 | ||
![]() |
572c316e7d | ||
![]() |
cb1e45b4ef | ||
![]() |
95619bdaca | ||
![]() |
8421a89820 | ||
![]() |
5dc41446aa | ||
![]() |
e26a7b0ed8 | ||
![]() |
418a886ae4 | ||
![]() |
552b1cccec | ||
![]() |
11c4c71131 | ||
![]() |
79d495f51d | ||
![]() |
ca56c2145f | ||
![]() |
704a2e8d3c | ||
![]() |
e745144836 | ||
![]() |
352bef99a9 | ||
![]() |
6d7745a110 | ||
![]() |
bf57587e62 | ||
![]() |
47dcda1087 | ||
![]() |
a2b650df47 | ||
![]() |
9374c0c9db | ||
![]() |
ab3fbfdb3b | ||
![]() |
7e99d869de | ||
![]() |
00b6f14821 | ||
![]() |
5694e7b6a6 | ||
![]() |
cf19cb0dbe | ||
![]() |
387bd555c7 | ||
![]() |
f69333a0e5 | ||
![]() |
4665e4ffff | ||
![]() |
fbc6bd8266 | ||
![]() |
91bfbb6256 | ||
![]() |
dedbc37196 | ||
![]() |
8e3330bbf6 | ||
![]() |
877c285ec8 | ||
![]() |
4fffef8853 | ||
![]() |
ea17e363a6 | ||
![]() |
26d2ef2ad1 | ||
![]() |
f775168c4f | ||
![]() |
6c086f2b6d | ||
![]() |
0d1e0a0d97 | ||
![]() |
6f6d28fa8d | ||
![]() |
9ca73a9edc | ||
![]() |
78b48371aa | ||
![]() |
efc88a0b16 | ||
![]() |
6c6897f778 | ||
![]() |
ae31eb564a | ||
![]() |
7222e3691b | ||
![]() |
7e1b57add4 | ||
![]() |
f4094930a3 | ||
![]() |
8efe8b498d | ||
![]() |
fc1c692f71 | ||
![]() |
480651cf9d | ||
![]() |
53a43dbe99 | ||
![]() |
db03b76910 | ||
![]() |
14bdd5ed2a | ||
![]() |
f45bc9b362 | ||
![]() |
4a7baaaf50 | ||
![]() |
dad79cafcd | ||
![]() |
d08f9cb6e4 | ||
![]() |
397d404ce0 | ||
![]() |
9de4ace6f2 | ||
![]() |
1f13254460 | ||
![]() |
1d03af876c | ||
![]() |
8ce9e3255e | ||
![]() |
1dc1e12fec | ||
![]() |
6cf9402cbc | ||
![]() |
76aa2baf3e | ||
![]() |
423b419138 | ||
![]() |
4e2817eff1 | ||
![]() |
31d12662bd | ||
![]() |
44a348d56f | ||
![]() |
85f315ad65 | ||
![]() |
2c3e617fba | ||
![]() |
088b476343 | ||
![]() |
4c9372a081 | ||
![]() |
4930e22dda | ||
![]() |
0beb945554 | ||
![]() |
bf0bb1a4db | ||
![]() |
64459fedbf | ||
![]() |
47e29754c2 | ||
![]() |
ec86141a4a | ||
![]() |
f0f9283d02 | ||
![]() |
9fbd7eb7a5 | ||
![]() |
d7dea0e6d9 | ||
![]() |
533f684887 | ||
![]() |
d81d216d72 | ||
![]() |
e5c315f961 | ||
![]() |
0793abfd19 | ||
![]() |
52ecc76e28 | ||
![]() |
4bb0fb2ffc | ||
![]() |
ec59556cd7 | ||
![]() |
661e304033 | ||
![]() |
ae489efee4 | ||
![]() |
8a778d656d | ||
![]() |
a7d05820a6 | ||
![]() |
43757cd985 | ||
![]() |
0e4374042c | ||
![]() |
6c55e8cab5 | ||
![]() |
0e142138aa | ||
![]() |
d17421d074 | ||
![]() |
7d156263ab | ||
![]() |
79bff50247 |
2
Vagrantfile
vendored
2
Vagrantfile
vendored
@@ -59,7 +59,7 @@ Vagrant.configure(2) do |config|
|
||||
# add a # before ,args: and run 'vagrant up' to get a working
|
||||
# non-updated box and then attempt to troubleshoot or open a Github issue
|
||||
|
||||
config.vm.provision "shell", run: "always", path: "./util/install_dependencies.sh", args: "-update"
|
||||
config.vm.provision "shell", run: "always", path: "./util/qmk_install.sh", args: "-update"
|
||||
|
||||
config.vm.post_up_message = <<-EOT
|
||||
|
||||
|
@@ -110,8 +110,28 @@ ifneq ("$(wildcard $(KEYBOARD_C_1))","")
|
||||
KEYBOARD_SRC += $(KEYBOARD_C_1)
|
||||
endif
|
||||
|
||||
OPT_DEFS += -DKEYBOARD_$(KEYBOARD_FILESAFE)
|
||||
# Generate KEYBOARD_name_subname for all levels of the keyboard folder
|
||||
KEYBOARD_FILESAFE_1 := $(subst .,,$(subst /,_,$(KEYBOARD_FOLDER_PATH_1)))
|
||||
KEYBOARD_FILESAFE_2 := $(subst .,,$(subst /,_,$(KEYBOARD_FOLDER_PATH_2)))
|
||||
KEYBOARD_FILESAFE_3 := $(subst .,,$(subst /,_,$(KEYBOARD_FOLDER_PATH_3)))
|
||||
KEYBOARD_FILESAFE_4 := $(subst .,,$(subst /,_,$(KEYBOARD_FOLDER_PATH_4)))
|
||||
KEYBOARD_FILESAFE_5 := $(subst .,,$(subst /,_,$(KEYBOARD_FOLDER_PATH_5)))
|
||||
|
||||
ifneq ("$(wildcard $(KEYBOARD_PATH_5)/)","")
|
||||
OPT_DEFS += -DKEYBOARD_$(KEYBOARD_FILESAFE_5)
|
||||
endif
|
||||
ifneq ("$(wildcard $(KEYBOARD_PATH_4)/)","")
|
||||
OPT_DEFS += -DKEYBOARD_$(KEYBOARD_FILESAFE_4)
|
||||
endif
|
||||
ifneq ("$(wildcard $(KEYBOARD_PATH_3)/)","")
|
||||
OPT_DEFS += -DKEYBOARD_$(KEYBOARD_FILESAFE_3)
|
||||
endif
|
||||
ifneq ("$(wildcard $(KEYBOARD_PATH_2)/)","")
|
||||
OPT_DEFS += -DKEYBOARD_$(KEYBOARD_FILESAFE_2)
|
||||
endif
|
||||
ifneq ("$(wildcard $(KEYBOARD_PATH_1)/)","")
|
||||
OPT_DEFS += -DKEYBOARD_$(KEYBOARD_FILESAFE_1)
|
||||
endif
|
||||
|
||||
# Setup the define for QMK_KEYBOARD_H. This is used inside of keymaps so
|
||||
# that the same keymap may be used on multiple keyboards.
|
||||
|
@@ -219,6 +219,11 @@ ifeq ($(strip $(USB_HID_ENABLE)), yes)
|
||||
include $(TMK_DIR)/protocol/usb_hid.mk
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(ENCODER_ENABLE)), yes)
|
||||
SRC += $(QUANTUM_DIR)/encoder.c
|
||||
OPT_DEFS += -DENCODER_ENABLE
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(HD44780_ENABLE)), yes)
|
||||
SRC += drivers/avr/hd44780.c
|
||||
OPT_DEFS += -DHD44780_ENABLE
|
||||
|
@@ -3,6 +3,8 @@
|
||||
* [Building Your First Firmware](newbs_building_firmware.md)
|
||||
* [Flashing Firmware](newbs_flashing.md)
|
||||
* [Testing and Debugging](newbs_testing_debugging.md)
|
||||
* [Best Practices](newbs_best_practices.md)
|
||||
* [Learning Resources](newbs_learn_more_resources.md)
|
||||
|
||||
* [QMK Basics](README.md)
|
||||
* [QMK Introduction](getting_started_introduction.md)
|
||||
@@ -47,8 +49,10 @@
|
||||
* [Backlight](feature_backlight.md)
|
||||
* [Bluetooth](feature_bluetooth.md)
|
||||
* [Bootmagic](feature_bootmagic.md)
|
||||
* [Combos](feature_combo)
|
||||
* [Command](feature_command.md)
|
||||
* [Dynamic Macros](feature_dynamic_macros.md)
|
||||
* [Encoders](feature_encoders.md)
|
||||
* [Grave Escape](feature_grave_esc.md)
|
||||
* [Key Lock](feature_key_lock.md)
|
||||
* [Layouts](feature_layouts.md)
|
||||
|
@@ -3,6 +3,8 @@
|
||||
* [Building Your First Firmware](newbs_building_firmware.md)
|
||||
* [Flashing Firmware](newbs_flashing.md)
|
||||
* [Testing and Debugging](newbs_testing_debugging.md)
|
||||
* [Best Practices](newbs_best_practices.md)
|
||||
* [Learning Resources](newbs_learn_more_resources.md)
|
||||
|
||||
* [QMK Basics](README.md)
|
||||
* [QMK Introduction](getting_started_introduction.md)
|
||||
@@ -47,8 +49,10 @@
|
||||
* [Backlight](feature_backlight.md)
|
||||
* [Bluetooth](feature_bluetooth.md)
|
||||
* [Bootmagic](feature_bootmagic.md)
|
||||
* [Combos](feature_combo)
|
||||
* [Command](feature_command.md)
|
||||
* [Dynamic Macros](feature_dynamic_macros.md)
|
||||
* [Encoders](feature_encoders.md)
|
||||
* [Grave Escape](feature_grave_esc.md)
|
||||
* [Key Lock](feature_key_lock.md)
|
||||
* [Layouts](feature_layouts.md)
|
||||
|
@@ -155,6 +155,10 @@ If you define these options you will enable the associated feature, which may in
|
||||
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.
|
||||
* `#define COMBO_COUNT 2`
|
||||
* Set this to the number of combos that you're using in the [Combo](feature_combo.md) feature.
|
||||
* `#define COMBO_TERM 200`
|
||||
* how long for the Combo keys to be detected. Defaults to `TAPPING_TERM` if not defined.
|
||||
|
||||
## RGB Light Configuration
|
||||
|
||||
@@ -234,6 +238,8 @@ Use these to enable or disable building certain features. The more you have enab
|
||||
* Console for debug(+400)
|
||||
* `COMMAND_ENABLE`
|
||||
* Commands for debug and configuration
|
||||
* `COMBO_ENABLE`
|
||||
* Key combo feature
|
||||
* `NKRO_ENABLE`
|
||||
* USB N-Key Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
* `AUDIO_ENABLE`
|
||||
|
@@ -117,12 +117,12 @@ void led_set_user(uint8_t usb_led) {
|
||||
} else {
|
||||
PORTB &= ~(1<<2);
|
||||
}
|
||||
if (usb_led & (1<<USB_LED_COMPOSE_LOCK)) {
|
||||
if (usb_led & (1<<USB_LED_COMPOSE)) {
|
||||
PORTB |= (1<<3);
|
||||
} else {
|
||||
PORTB &= ~(1<<3);
|
||||
}
|
||||
if (usb_led & (1<<USB_LED_KANA_LOCK)) {
|
||||
if (usb_led & (1<<USB_LED_KANA)) {
|
||||
PORTB |= (1<<4);
|
||||
} else {
|
||||
PORTB &= ~(1<<4);
|
||||
|
@@ -17,7 +17,7 @@ or just:
|
||||
|
||||
Note that running `make` with `sudo` is generally *not* a good idea, and you should use one of the former methods, if possible.
|
||||
|
||||
## Linux `udev` Rules
|
||||
### Linux `udev` Rules
|
||||
On Linux, you'll need proper privileges to access the MCU. You can either use
|
||||
`sudo` when flashing firmware, or place these files in `/etc/udev/rules.d/`.
|
||||
|
||||
@@ -37,6 +37,14 @@ SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2ff0", MODE:="066
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="feed", MODE:="0666"
|
||||
```
|
||||
|
||||
## Unknown Device for DFU Bootloader
|
||||
|
||||
If you're using Windows to flash your keyboard, and you are running into issues, check the Device Manager. If you see an "Unknown Device" when the keyboard is in "bootloader mode", then you may have a driver issue.
|
||||
|
||||
Re-running the installation script for MSYS2 may help (eg run `./util/qmk_install.sh` from MSYS2/WSL) or reinstalling the QMK Toolbox may fix the issue.
|
||||
|
||||
If that doesn't work, then you may need to grab the [Zadig Utility](https://zadig.akeo.ie/). Download this, find the device in question, and select the `WinUS(libusb-1.0)` option, and hit "Reinstall driver". Once you've done that, try flashing your board, again.
|
||||
|
||||
## WINAVR is Obsolete
|
||||
It is no longer recommended and may cause some problem.
|
||||
See [TMK Issue #99](https://github.com/tmk/tmk_keyboard/issues/99).
|
||||
@@ -97,10 +105,12 @@ The solution is to remove and reinstall all affected modules.
|
||||
```
|
||||
brew rm avr-gcc
|
||||
brew rm dfu-programmer
|
||||
brew rm dfu-util
|
||||
brew rm gcc-arm-none-eabi
|
||||
brew rm avrdude
|
||||
brew install avr-gcc
|
||||
brew install dfu-programmer
|
||||
brew install dfu-util
|
||||
brew install gcc-arm-none-eabi
|
||||
brew install avrdude
|
||||
```
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
Your keymap can include keycodes that are more advanced than normal, for example keys that switch layers or send modifiers when held, but send regular keycodes when tapped. This page documents the functions that are available to you.
|
||||
|
||||
### Assigning Custom Names
|
||||
## Assigning Custom Names
|
||||
|
||||
People often define custom names using `#define`. For example:
|
||||
|
||||
@@ -13,7 +13,7 @@ People often define custom names using `#define`. For example:
|
||||
|
||||
This will allow you to use `FN_CAPS` and `ALT_TAB` in your `KEYMAP()`, keeping it more readable.
|
||||
|
||||
### Caveats
|
||||
## Caveats
|
||||
|
||||
Currently, `LT()` and `MT()` are limited to the [Basic Keycode set](keycodes_basic.md), meaning you can't use keycodes like `LCTL()`, `KC_TILD`, or anything greater than `0xFF`. Modifiers specified as part of a Layer Tap or Mod Tap's keycode will be ignored.
|
||||
|
||||
@@ -36,7 +36,7 @@ These functions allow you to activate layers in various ways. Note that layers a
|
||||
|
||||
Care must be taken when switching layers, it's possible to lock yourself into a layer with no way to deactivate that layer (without unplugging your keyboard.) We've created some guidelines to help users avoid the most common problems.
|
||||
|
||||
### Beginners
|
||||
## Beginners
|
||||
|
||||
If you are just getting started with QMK you will want to keep everything simple. Follow these guidelines when setting up your layers:
|
||||
|
||||
@@ -44,11 +44,11 @@ If you are just getting started with QMK you will want to keep everything simple
|
||||
* Arrange your layers in a "tree" layout, with layer 0 as the root. Do not try to enter the same layer from more than one other layer.
|
||||
* In a layer's keymap, only reference higher-numbered layers. Because layers are processed from the highest-numbered (topmost) active layer down, modifying the state of lower layers can be tricky and error-prone.
|
||||
|
||||
### Intermediate Users
|
||||
## Intermediate Users
|
||||
|
||||
Sometimes you need more than one base layer. For example, if you want to switch between QWERTY and Dvorak, switch between layouts for different countries, or switch your layout for different videogames. Your base layers should always be the lowest numbered layers. When you have multiple base layers you should always treat them as mutually exclusive. When one base layer is on the others are off.
|
||||
|
||||
### Advanced Users
|
||||
## Advanced Users
|
||||
|
||||
Once you have a good feel for how layers work and what you can do, you can get more creative. The rules listed in the beginner section will help you be successful by avoiding some of the tricker details but they can be constraining, especially for ultra-compact keyboard users. Understanding how layers work will allow you to use them in more advanced ways.
|
||||
|
||||
@@ -126,6 +126,14 @@ For convenience, QMK includes some Mod-Tap shortcuts to make common combinations
|
||||
|`SGUI_T(kc)`|`SCMD_T(kc)`, `SWIN_T(kc)` |Left Shift and GUI when held, `kc` when tapped |
|
||||
|`LCA_T(kc)` | |Left Control and Alt when held, `kc` when tapped |
|
||||
|
||||
## Caveats
|
||||
|
||||
Unfortunately, these keycodes cannot be used in Mod-Taps or Layer-Taps, since any modifiers specified in the keycode are ignored.
|
||||
|
||||
Additionally, you may run into issues when using Remote Desktop Connection on Windows. Because these codes send shift very fast, Remote Desktop may miss the codes.
|
||||
|
||||
To fix this, open Remote Desktop Connection, click on "Show Options", open the the "Local Resources" tab. In the keyboard section, change the drop down to "On this Computer". This will fix the issue, and allow the characters to work correctly.
|
||||
|
||||
# One Shot Keys
|
||||
|
||||
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".
|
||||
@@ -134,6 +142,8 @@ For example, if you define a key as `OSM(MOD_LSFT)`, you can type a capital A ch
|
||||
|
||||
One shot keys also work as normal modifiers. If you hold down a one shot key and type other keys, your one shot will be released immediately after you let go of the key.
|
||||
|
||||
Additionally, hitting keys five times in a short period will lock that key. This applies for both One Shot Modifiers and One Shot Layers, and is controlled by the `ONESHOT_TAP_TOGGLE` define.
|
||||
|
||||
You can control the behavior of one shot keys by defining these in `config.h`:
|
||||
|
||||
```c
|
||||
@@ -144,15 +154,20 @@ You can control the behavior of one shot keys by defining these in `config.h`:
|
||||
* `OSM(mod)` - Momentarily hold down *mod*. You must use the `MOD_*` keycodes as shown in [Mod Tap](#mod-tap), not the `KC_*` codes.
|
||||
* `OSL(layer)` - momentary switch to *layer*.
|
||||
|
||||
Sometimes, you want to activate a one-shot layer as part of a macro or tap dance routine. To do this, you need to call `set_oneshot_layer(LAYER, ONESHOT_START)` on key down, and `set_oneshot_layer(ONESHOT_PRESSED)` on key up. If you want to cancel the oneshot, call `reset_oneshot_layer()`. For more complicated actions, take a look at the oneshot implementation in [`process_record`](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/common/action.c#L429).
|
||||
Sometimes, you want to activate a one-shot key as part of a macro or tap dance routine.
|
||||
|
||||
For one shot layers, you need to call `set_oneshot_layer(LAYER, ONESHOT_START)` on key down, and `set_oneshot_layer(ONESHOT_PRESSED)` on key up. If you want to cancel the oneshot, call `reset_oneshot_layer()`.
|
||||
|
||||
For one shot mods, you need to call `set_oneshot_mods(MOD)` to set it, or `clear_oneshot_mods()` to cancel it.
|
||||
|
||||
!> If you're having issues with OSM translating over Remote Desktop Connection, this can be fixed by opening the settings, going to the "Local Resources" tap, and in the keyboard section, change the drop down to "On this Computer". This will fix the issue and allow OSM to function properly over Remote Desktop.
|
||||
|
||||
If you're having issues with OSM translating over Remote Desktop Connection, this can be fixed by opening the settings, going to the "Local Resources" tap, and in the keyboard section, change the drop down to "On this Computer". This will fix the issue and allow OSM to function properly over Remote Desktop.
|
||||
|
||||
# Permissive Hold
|
||||
|
||||
As of [PR#1359](https://github.com/qmk/qmk_firmware/pull/1359/), there is a new `config.h` option:
|
||||
|
||||
```
|
||||
```c
|
||||
#define PERMISSIVE_HOLD
|
||||
```
|
||||
|
||||
@@ -197,6 +212,6 @@ With `TAPPING_FORCE_HOLD`, the second press will be interpreted as a Shift, allo
|
||||
|
||||
# Retro Tapping
|
||||
|
||||
When you hold a dual function key, and haven't pressed anything when you release the key, normally nothing happens. However, if you enable this, if you release the key without pressing another key, it will send the original key, even if it is outside of the tapping term.
|
||||
Holding and releasing a dual function key without pressing another key will result in nothing happening. With retro tapping enabled, releasing the key without pressing another will send the original keycode even if it is outside the tapping term.
|
||||
|
||||
For instance, if you're using `LT(2, KC_SPACE)`, if you hold the key, don't hit anything else and then release it, normally, nothing happens. But with `RETRO_TAPPING` defined in your `config.h`, it will send `KC_SPACE`.
|
||||
For instance, holding and releasing `LT(2, KC_SPACE)` without hitting another key will result in nothing happening. With `RETRO_TAPPING` defined in your `config.h`, it will send `KC_SPACE`.
|
||||
|
@@ -61,7 +61,7 @@ In this handler, the value of an incrementing counter is mapped onto a precomput
|
||||
|`backlight_increase()` |Increase the backlight level |
|
||||
|`backlight_decrease()` |Decrease the backlight level |
|
||||
|`backlight_level(x)` |Sets the backlight level to specified level |
|
||||
|`get_backlight_level()`|Toggle backlight breathing |
|
||||
|`get_backlight_level()`|Return the current backlight level |
|
||||
|
||||
### Backlight Breathing Functions
|
||||
|
||||
|
89
docs/feature_combo.md
Normal file
89
docs/feature_combo.md
Normal file
@@ -0,0 +1,89 @@
|
||||
# Combos
|
||||
|
||||
The Combo feature is a chording type solution for adding custom actions. It lets you hit multiple keys at once and produce a different effect. For instance, hitting `A` and `S` within the tapping term would hit `ESC` instead, or have it perform even more complex tasks.
|
||||
|
||||
To enable this feature, yu need to add `COMBO_ENABLE = yes` to your `rules.mk`.
|
||||
|
||||
Additionally, in your `config.h`, you'll need to specify the number of combos that you'll be using, by adding `#define COMBO_COUNT 1` (replacing 1 with the number that you're using).
|
||||
<!-- At this time, this is necessary -->
|
||||
|
||||
Also, by default, the tapping term for the Combos is set to the same value as `TAPPING_TERM` (200 by default on most boards). But you can specify a different value by defining it in your `config.h`. For instance: `#define COMBO_TERM 300` would set the time out period for combos to 300ms.
|
||||
|
||||
Then, your `keymap.c` file, you'll need to define a sequence of keys, terminated with `COMBO_END`, and a structure to list the combination of keys, and it's resulting action.
|
||||
|
||||
```c
|
||||
const uint16_t PROGMEM test_combo[] = {KC_A, KC_B, COMBO_END};
|
||||
combo_t key_combos[COMBO_COUNT] = {COMBO(test_combo, KC_ESC)};
|
||||
```
|
||||
|
||||
This will send "Escape" if you hit the A and B keys.
|
||||
|
||||
!> This method only supports [basic keycodes](keycodes_basic.md). See the examples for more control.
|
||||
!> You cannot reuse (share) keys in combos. Each key should only belong to a single combo.
|
||||
|
||||
## Examples
|
||||
|
||||
If you want to add a list, then you'd use something like this:
|
||||
|
||||
```c
|
||||
enum combos {
|
||||
AB_ESC,
|
||||
JK_TAB
|
||||
}
|
||||
const uint16_t PROGMEM ab_combo[] = {KC_A, KC_B, COMBO_END};
|
||||
const uint16_t PROGMEM jk_combo[] = {KC_J, KC_K, COMBO_END};
|
||||
|
||||
combo_t key_combos[COMBO_COUNT] = {
|
||||
[AB_ESC] = COMBO(ab_combo, KC_ESC),
|
||||
[JK_TAB] = COMBO(jk_combo, KC_TAB)
|
||||
};
|
||||
```
|
||||
|
||||
For a more complicated implementation, you can use the `process_combo_event` function to add custom handling.
|
||||
|
||||
```c
|
||||
enum combo_events {
|
||||
ZC_COPY,
|
||||
ZV_PASTE
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM copy_combo[] = {KC_Z, KC_C, COMBO_END};
|
||||
const uint16_t PROGMEM paste_combo[] = {KC_Z, KC_V, COMBO_END};
|
||||
|
||||
combo_t key_combos[COMBO_COUNT] = {
|
||||
[ZC_COPY] = COMBO_ACTION(copy_combo),
|
||||
[ZV_PASTE] = COMBO_ACTION(paste_combo),
|
||||
};
|
||||
|
||||
void process_combo_event(uint8_t combo_index, bool pressed) {
|
||||
switch(combo_index) {
|
||||
case ZC_COPY:
|
||||
if (pressed) {
|
||||
register_code(KC_LCTL);
|
||||
register_code(KC_C);
|
||||
unregister_code(KC_C);
|
||||
unregister_code(KC_LCTL);
|
||||
}
|
||||
break;
|
||||
|
||||
case ZV_PASTE:
|
||||
if (pressed) {
|
||||
register_code(KC_LCTL);
|
||||
register_code(KC_V);
|
||||
unregister_code(KC_V);
|
||||
unregister_code(KC_LCTL);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
This will send Ctrl+C if you hit Z and C, and Ctrl+V if you hit Z and V. But you could change this to do stuff like change layers, play sounds, or change settings.
|
||||
|
||||
## Additional Configuration
|
||||
|
||||
If you're using long combos, or even longer combos, you may run into issues with this, as the structure may not be large enough to accommodate what you're doing.
|
||||
|
||||
In this case, you can add either `#define EXTRA_LONG_COMBOS` or `#define EXTRA_EXTRA_LONG_COMBOS` in your `config.h` file.
|
||||
|
||||
You may also be able to enable action keys by defining `COMBO_ALLOW_ACTION_KEYS`.
|
48
docs/feature_encoders.md
Normal file
48
docs/feature_encoders.md
Normal file
@@ -0,0 +1,48 @@
|
||||
# Encoders
|
||||
|
||||
Basic encoders are supported by adding this to your `rules.mk`:
|
||||
|
||||
ENCODER_ENABLE = yes
|
||||
|
||||
and this to your `config.h`:
|
||||
|
||||
#define NUMBER_OF_ENCODERS 1
|
||||
#define ENCODERS_PAD_A { B12 }
|
||||
#define ENCODERS_PAD_B { B13 }
|
||||
|
||||
Each PAD_A/B variable defines an array so multiple encoders can be defined, e.g.:
|
||||
|
||||
#define ENCODERS_PAD_A { encoder1a, encoder2a }
|
||||
#define ENCODERS_PAD_B { encoder1a, encoder2b }
|
||||
|
||||
If your encoder's clockwise directions are incorrect, you can swap the A & B pad definitions.
|
||||
|
||||
Additionally, the resolution can be specified in the same file (the default & suggested is 4):
|
||||
|
||||
#define ENCODER_RESOLUTION 4
|
||||
|
||||
## Callbacks
|
||||
|
||||
The callback functions can be inserted into your `<keyboard>.c`:
|
||||
|
||||
void encoder_update_kb(uint8_t index, bool clockwise) {
|
||||
encoder_update_user(index, clockwise);
|
||||
}
|
||||
|
||||
or `keymap.c`:
|
||||
|
||||
void encoder_update_user(uint8_t index, bool clockwise) {
|
||||
if (index == 0) {
|
||||
if (clockwise) {
|
||||
register_code(KC_PGDN);
|
||||
unregister_code(KC_PGDN);
|
||||
} else {
|
||||
register_code(KC_PGUP);
|
||||
unregister_code(KC_PGUP);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
## Hardware
|
||||
|
||||
The A an B lines of the encoders should be wired directly to the MCU, and the C/common lines should be wired to ground.
|
@@ -96,9 +96,10 @@ if `RGBLIGHT_EFFECT_xxxx` or `RGBLIGHT_ANIMATIONS` is defined, you also have a n
|
||||
|`RGBLIGHT_MODE_RGB_TEST` | *None* |RGB Test |
|
||||
|`RGBLIGHT_MODE_ALTERNATING` | *None* |Alternating |
|
||||
|
||||
|
||||
Check out [this video](https://youtube.com/watch?v=VKrpPAHlisY) for a demonstration.
|
||||
|
||||
Note: For versions older than 0.6.117, The mode numbers were written directly. In `quantum/rgblight.h` there is a contrast table between the old mode number and the current symbol.
|
||||
|
||||
The following options can be used to tweak the various animations:
|
||||
|
||||
|Define |Default |Description |
|
||||
|
@@ -26,6 +26,8 @@ This array specifies what actions shall be taken when a tap-dance key is in acti
|
||||
|
||||
The first option is enough for a lot of cases, that just want dual roles. For example, `ACTION_TAP_DANCE_DOUBLE(KC_SPC, KC_ENT)` will result in `Space` being sent on single-tap, `Enter` otherwise.
|
||||
|
||||
!> Keep in mind that only [basic keycodes](keycodes_basic.md) are supported here. Custom keycodes are not supported.
|
||||
|
||||
And that's the bulk of it!
|
||||
|
||||
And now, on to the explanation of how it works!
|
||||
|
@@ -8,7 +8,7 @@ Note: If it is your first time here, Check out the "Complete Newbs guide" instea
|
||||
|
||||
## Linux
|
||||
|
||||
To ensure you are always up to date, you can just run `sudo util/install_dependencies.sh`. That should always install all the dependencies needed. **This will run `apt-get upgrade`.**
|
||||
To ensure you are always up to date, you can just run `sudo util/qmk_install.sh`. That should always install all the dependencies needed. **This will run `apt-get upgrade`.**
|
||||
|
||||
You can also install things manually, but this documentation might not be always up to date with all requirements.
|
||||
|
||||
@@ -58,10 +58,11 @@ If you're using [homebrew,](http://brew.sh/) you can use the following commands:
|
||||
brew update
|
||||
brew install avr-gcc@7
|
||||
brew install dfu-programmer
|
||||
brew install dfu-util
|
||||
brew install gcc-arm-none-eabi
|
||||
brew install avrdude
|
||||
|
||||
This is the recommended method. If you don't have homebrew, [install it!](http://brew.sh/) It's very much worth it for anyone who works in the command line. Note that the `make` and `make install` portion during the homebrew installation of avr-libc can take over 20 minutes and exhibit high CPU usage.
|
||||
This is the recommended method. If you don't have homebrew, [install it!](http://brew.sh/) It's very much worth it for anyone who works in the command line. Note that the `make` and `make install` portion during the homebrew installation of `avr-gcc@7` can take over 20 minutes and exhibit high CPU usage.
|
||||
|
||||
## Windows with msys2 (recommended)
|
||||
|
||||
@@ -69,9 +70,9 @@ The best environment to use, for Windows Vista through any later version (tested
|
||||
|
||||
* Install msys2 by downloading it and following the instructions here: http://www.msys2.org
|
||||
* Open the ``MSYS2 MingGW 64-bit`` shortcut
|
||||
* Navigate to your qmk checkout. For example, if it's in the root of your c drive:
|
||||
* Navigate to your QMK repository. For example, if it's in the root of your c drive:
|
||||
* `$ cd /c/qmk_firmware`
|
||||
* Run `util/msys2_install.sh` and follow the prompts
|
||||
* Run `util/qmk_install.sh` and follow the prompts
|
||||
|
||||
## Windows 10 (deprecated)
|
||||
These are the old instructions for Windows 10. We recommend you use [MSYS2 as outlined above](#windows-with-msys2-recommended).
|
||||
|
@@ -8,7 +8,7 @@ Start on the [QMK Github page](https://github.com/qmk/qmk_firmware), and you'll
|
||||
|
||||

|
||||
|
||||
If you're apart of an organization, you'll need to choose which account to fork it to. In most circumstances, you'll want to fork it to your personal account. Once your fork is completed (sometimes this takes a little while), click the "Clone or Download" button:
|
||||
If you're a part of an organization, you'll need to choose which account to fork it to. In most circumstances, you'll want to fork it to your personal account. Once your fork is completed (sometimes this takes a little while), click the "Clone or Download" button:
|
||||
|
||||

|
||||
|
||||
|
@@ -8,7 +8,7 @@ If you have not yet you should read the [Keyboard Guidelines](hardware_keyboard_
|
||||
|
||||
QMK has a number of features to simplify working with AVR keyboards. For most keyboards you don't have to write a single line of code. To get started run the `util/new_project.sh` script:
|
||||
|
||||
```
|
||||
```bash
|
||||
$ util/new_project.sh my_awesome_keyboard
|
||||
######################################################
|
||||
# /keyboards/my_awesome_keyboard project created. To start
|
||||
@@ -30,7 +30,7 @@ This is where all the custom logic for your keyboard goes. Many keyboards do not
|
||||
|
||||
This is the file you define your [Layout Macro(s)](feature_layouts.md) in. At minimum you should have a `#define LAYOUT` for your keyboard that looks something like this:
|
||||
|
||||
```
|
||||
```c
|
||||
#define LAYOUT( \
|
||||
k00, k01, k02, \
|
||||
k10, k11 \
|
||||
@@ -57,7 +57,7 @@ At the top of the `config.h` you'll find USB related settings. These control how
|
||||
|
||||
Do change the `MANUFACTURER`, `PRODUCT`, and `DESCRIPTION` lines to accurately reflect your keyboard.
|
||||
|
||||
```
|
||||
```c
|
||||
#define VENDOR_ID 0xFEED
|
||||
#define PRODUCT_ID 0x6060
|
||||
#define DEVICE_VER 0x0001
|
||||
@@ -66,20 +66,20 @@ Do change the `MANUFACTURER`, `PRODUCT`, and `DESCRIPTION` lines to accurately r
|
||||
#define DESCRIPTION A custom keyboard
|
||||
```
|
||||
|
||||
?> Note: On Windows and macOS the `MANUFACTURER`, `PRODUCT`, and `DESCRIPTION` fields will be displayed in the list of USB devices. On Linux these values will not be visible in `lsusb`, since Linux takes that information from the list published by the USB-IF.
|
||||
?> Note: On Windows and macOS the `MANUFACTURER`, `PRODUCT`, and `DESCRIPTION` fields will be displayed in the list of USB devices. ?> On Linux these values will not be visible in lsusb by default, since Linux takes the information from the list maintained by [USB ID Repository](http://www.linux-usb.org/usb-ids.html) by default. lsusb will show the information reported by the device when executed with -v option. It is also present in kernel logs after plugging in the device.
|
||||
|
||||
### Keyboard Matrix Configuration
|
||||
|
||||
The next section of the `config.h` file deals with your keyboard's matrix. The first thing you should set is the matrix's size. This is usually, but not always, the same number of rows and columns as the physical key arrangement.
|
||||
|
||||
```
|
||||
```c
|
||||
#define MATRIX_ROWS 2
|
||||
#define MATRIX_COLS 3
|
||||
```
|
||||
|
||||
Once you've defined the size of your matrix you need to define which pins on your MCU are connected to rows and columns. To do so simply specify the names of those pins:
|
||||
|
||||
```
|
||||
```c
|
||||
#define MATRIX_ROW_PINS { D0, D5 }
|
||||
#define MATRIX_COL_PINS { F1, F0, B0 }
|
||||
#define UNUSED_PINS
|
||||
@@ -89,7 +89,7 @@ The number of `MATRIX_ROW_PINS` entries must be the same as the number you assig
|
||||
|
||||
Finally, you can specify the direction your diodes point. This can be `COL2ROW`, `ROW2COL`, or `CUSTOM_MATRIX`.
|
||||
|
||||
```
|
||||
```c
|
||||
#define DIODE_DIRECTION COL2ROW
|
||||
```
|
||||
|
||||
@@ -97,16 +97,14 @@ Finally, you can specify the direction your diodes point. This can be `COL2ROW`,
|
||||
|
||||
By default QMK supports backlighting on pins `B5`, `B6`, and `B7`. If you are using one of those you can simply enable it here. For more details see the [Backlight Documentation](feature_backlight.md).
|
||||
|
||||
```
|
||||
```c
|
||||
#define BACKLIGHT_PIN B7
|
||||
#define BACKLIGHT_LEVELS 3
|
||||
#define BACKLIGHT_BREATHING
|
||||
#define BREATHING_PERIOD 6
|
||||
```
|
||||
|
||||
{% hint style='info' %}
|
||||
You can use backlighting on any pin you like, but you will have to do more work to support that. See the [Backlight Documentation](feature_backlight.md) for more details.
|
||||
{% endhint %}
|
||||
?> You can use backlighting on any pin you like, but you will have to do more work to support that. See the [Backlight Documentation](feature_backlight.md) for more details.
|
||||
|
||||
### Other Configuration Options
|
||||
|
||||
@@ -120,7 +118,7 @@ You use the `rules.mk` file to tell QMK what files to build and what features to
|
||||
|
||||
These options tell the build system what CPU to build for. Be very careful if you change any of these settings, you can render your keyboard inoperable.
|
||||
|
||||
```
|
||||
```make
|
||||
MCU = atmega32u4
|
||||
F_CPU = 16000000
|
||||
ARCH = AVR8
|
||||
@@ -128,26 +126,26 @@ F_USB = $(F_CPU)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
```
|
||||
|
||||
### Bootloader Size
|
||||
### Bootloaders
|
||||
|
||||
The bootloader is a special section of your MCU that allows you to upgrade the code stored on the MCU. Think of it like a Rescue Partition for your keyboard. If you are using a teensy 2.0, or a device like the Ergodox EZ that uses the teensy bootloader you should set this to `512`. Most other bootloaders should be set to `4096`, but `1024` and `2048` are other possible values you may encounter.
|
||||
The bootloader is a special section of your MCU that allows you to upgrade the code stored on the MCU. Think of it like a Rescue Partition for your keyboard.
|
||||
|
||||
#### Teensy 2.0 Bootloader Example
|
||||
#### Teensy Bootloader Example
|
||||
|
||||
```
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=512
|
||||
```
|
||||
|
||||
#### Teensy 2.0++ Bootloader Example
|
||||
|
||||
```
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=1024
|
||||
```make
|
||||
BOOTLOADER = halfkay
|
||||
```
|
||||
|
||||
#### Atmel DFU Loader Example
|
||||
|
||||
```make
|
||||
BOOTLOADER = atmel-dfu
|
||||
```
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
|
||||
#### Pro Micro Bootloader Example
|
||||
|
||||
```make
|
||||
BOOTLOADER = caterina
|
||||
```
|
||||
|
||||
### Build Options
|
||||
|
@@ -27,17 +27,17 @@ This usually happens with a periodic scan of key presses. This speed often is li
|
||||
|
||||
## 2. What the Firmware Sends
|
||||
|
||||
The [HID specification](http://www.usb.org/developers/hidpage/Hut1_12v2.pdf) tells what a keyboard can actually send through USB to have a chance to be properly recognised. This includes a pre-defined list of scancodes which are simple numbers from `0x00` to `0xE7`. The firmware assigns a scancode to each key of the keyboard.
|
||||
The [HID specification](https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf) tells what a keyboard can actually send through USB to have a chance to be properly recognised. This includes a pre-defined list of scancodes which are simple numbers from `0x00` to `0xE7`. The firmware assigns a scancode to each key of the keyboard.
|
||||
|
||||
The firmware does not send actually letters or characters, but only scancodes.
|
||||
Thus, by modifying the firmware, you only can modify what scancode is sent over
|
||||
The firmware does not send actual letters or characters, but only scancodes.
|
||||
Thus, by modifying the firmware, you can only modify what scancode is sent over
|
||||
USB for a given key.
|
||||
|
||||
## 3. What the Operating System Does
|
||||
|
||||
Once the keycode reaches the operating system, a piece of software has to have
|
||||
it match an actual character thanks to a keyboard layout. For example, if your
|
||||
layout is set to QWERTY, a sample of the matching table is as follow:
|
||||
layout is set to QWERTY, a sample of the matching table is as follows:
|
||||
|
||||
| keycode | character |
|
||||
|---------|-----------|
|
||||
@@ -55,11 +55,11 @@ As the layout is generally fixed (unless you create your own), the firmware can
|
||||
|
||||
## List of Characters You Can Send
|
||||
|
||||
Putting aside shortcuts, having a limited set of keycodes mapped to a limited layout means that **the list of characters you can assign to a given key only is the ones present in the layout**.
|
||||
Putting aside shortcuts, having a limited set of keycodes mapped to a limited layout means that **the list of characters you can assign to a given key are only the ones present in the layout**.
|
||||
|
||||
For example, this means that if you have a QWERTY US layout, and you want to assign 1 key to produce `€` (euro currency symbol), you are unable to do so, because the QWERTY US layout does not have such mapping. You could fix that by using a QWERTY UK layout, or a QWERTY US International.
|
||||
For example, this means that if you have a QWERTY US layout, and you want to assign one key to produce `€` (euro currency symbol), you are unable to do so, because the QWERTY US layout does not have such mapping. You could fix that by using a QWERTY UK layout, or a QWERTY US International.
|
||||
|
||||
You may wonder why a keyboard layout containing all of Unicode is not devised then? The limited number of keycode available through USB simply disallow such a thing.
|
||||
You may wonder why a keyboard layout containing all of Unicode is not devised then? The limited number of keycodes available through USB simply disallows such a thing.
|
||||
|
||||
## How to (Maybe) Enter Unicode Characters
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
# Basic Keycodes
|
||||
|
||||
The basic set of keycodes are based on the [HID Keyboard/Keypad Usage Page (0x07)](http://www.usb.org/developers/hidpage/Hut1_12v2.pdf) with the exception of `KC_NO`, `KC_TRNS` and keycodes in the `0xA5-DF` range. See below for more details.
|
||||
The basic set of keycodes are based on the [HID Keyboard/Keypad Usage Page (0x07)](https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf) with the exception of `KC_NO`, `KC_TRNS` and keycodes in the `0xA5-DF` range. See below for more details.
|
||||
|
||||
## Letters and Numbers
|
||||
|
||||
|
@@ -6,6 +6,10 @@ These keycodes correspond to characters that are "shifted" on a standard US ANSI
|
||||
|
||||
Unfortunately, these keycodes cannot be used in Mod-Taps or Layer-Taps, since any modifiers specified in the keycode are ignored.
|
||||
|
||||
Additionally, you may run into issues when using Remote Desktop Connection on Windows. Because these codes send shift very fast, Remote Desktop may miss the codes.
|
||||
|
||||
To fix this, open Remote Desktop Connection, click on "Show Options", open the the "Local Resources" tab. In the keyboard section, change the drop down to "On this Computer". This will fix the issue, and allow the characters to work correctly.
|
||||
|
||||
## Keycodes
|
||||
|
||||
|Key |Aliases |Description |
|
||||
|
@@ -6,13 +6,13 @@ Not sure if your keyboard can run QMK? If it's a mechanical keyboard you built y
|
||||
|
||||
## Overview
|
||||
|
||||
There are 4 main sections to this guide:
|
||||
There are 5 main sections to this guide:
|
||||
|
||||
* [Getting Started](newbs_getting_started.md)
|
||||
* [Building Your First Firmware](newbs_building_firmware.md)
|
||||
* [Flashing Firmware](newbs_flashing.md)
|
||||
* [Testing and Debugging](newbs_testing_debugging.md)
|
||||
* [Best Practices](newbs_best_practices.md)
|
||||
* [Learn More with these Resources](newbs_learn_more_resources.md)
|
||||
|
||||
This guide is focused on helping someone who has never compiled software before. It makes choices and recommendations based on that viewpoint. There are alternative methods for many of these procedures, and we support most of those alternatives. If you have any doubt about how to accomplish a task you can [ask us for guidance](getting_started_getting_help.md).
|
||||
|
||||
|
163
docs/newbs_best_practices.md
Normal file
163
docs/newbs_best_practices.md
Normal file
@@ -0,0 +1,163 @@
|
||||
# Best Practices
|
||||
|
||||
## Or, "How I Learned to Stop Worrying and Love Git."
|
||||
|
||||
This document aims to instruct novices in the best ways to have a smooth experience in contributing to QMK. We will walk through the process of contributing to QMK, detailing some ways to make this task easier, and then later we'll break some things in order to teach you how to fix them.
|
||||
|
||||
This document assumes a few things:
|
||||
|
||||
1. You have a GitHub account, and have [forked the qmk_firmware repository](getting_started_github.md) to your account.
|
||||
2. You've [set up your build environment](newbs_getting_started.md?id=environment-setup).
|
||||
|
||||
|
||||
## Your fork's master: Update Often, Commit Never
|
||||
|
||||
It is highly recommended for QMK development, regardless of what is being done or where, to keep your `master` branch updated, but ***never*** commit to it. Instead, do all your changes in a development branch and issue pull requests from your branches when you're developing.
|
||||
|
||||
To reduce the chances of merge conflicts — instances where two or more users have edited the same part of a file concurrently — keep your `master` branch relatively up-to-date, and start any new developments by creating a new branch.
|
||||
|
||||
### Updating your master branch
|
||||
|
||||
To keep your `master` branch updated, it is recommended to add the QMK Firmware repository ("repo") as a remote repository in git. To do this, open your Git command line interface and enter:
|
||||
|
||||
```
|
||||
git remote add upstream https://github.com/qmk/qmk_firmware.git
|
||||
```
|
||||
|
||||
To verify that the repository has been added, run `git remote -v`, which should return the following:
|
||||
|
||||
```
|
||||
$ git remote -v
|
||||
origin https://github.com/<your_username>/qmk_firmware.git (fetch)
|
||||
origin https://github.com/<your_username>/qmk_firmware.git (push)
|
||||
upstream https://github.com/qmk/qmk_firmware.git (fetch)
|
||||
upstream https://github.com/qmk/qmk_firmware.git (push)
|
||||
```
|
||||
|
||||
Now that this is done, you can check for updates to the repo by running `git fetch upstream`. This retrieves the branches and tags — collectively referred to as "refs" — from the QMK repo, which now has the nickname `upstream`. We can now compare the data on our fork `origin` to that held by QMK.
|
||||
|
||||
To update your fork's master, run the following, hitting the Enter key after each line:
|
||||
|
||||
```
|
||||
git checkout master
|
||||
git fetch upstream
|
||||
git pull upstream master
|
||||
git push origin master
|
||||
```
|
||||
|
||||
This switches you to your `master` branch, retrieves the refs from the QMK repo, downloads the current QMK `master` branch to your computer, and then uploads it to your fork.
|
||||
|
||||
### Making Changes
|
||||
|
||||
To make changes, create a new branch by entering:
|
||||
|
||||
```
|
||||
git checkout -b dev_branch
|
||||
git push --set-upstream origin dev_branch
|
||||
```
|
||||
|
||||
This creates a new branch named `dev_branch`, checks it out, and then saves the new branch to your fork. The `--set-upstream` argument tells git to use your fork and the `dev_branch` branch every time you use `git push` or `git pull` from this branch. It only needs to be used on the first push; after that, you can safely use `git push` or `git pull`, without the rest of the arguments.
|
||||
|
||||
!> With `git push`, you can use `-u` in place of `--set-upstream` — `-u` is an alias for `--set-upstream`.
|
||||
|
||||
You can name your branch nearly anything you want, though it is recommended to name it something related to the changes you are going to make.
|
||||
|
||||
By default `git checkout -b` will base your new branch on the branch that is checked out. You can base your new branch on an existing branch that is not checked out by adding the name of the existing branch to the command:
|
||||
|
||||
```
|
||||
git checkout -b dev_branch master
|
||||
```
|
||||
|
||||
Now that you have a development branch, open your text editor and make whatever changes you need to make. It is recommended to make many small commits to your branch; that way, any change that causes issues can be more easily traced and undone if needed. To make your changes, edit and save any files that need to be updated, add them to Git's *staging area*, and then commit them to your branch:
|
||||
|
||||
```
|
||||
git add path/to/updated_file
|
||||
git commit -m "My commit message."
|
||||
```
|
||||
|
||||
`git add` adds files that have been changed to Git's *staging area*, which is Git's "loading zone." This contains the changes that are going to be *committed* by `git commit`, which saves the changes to the repo. Use descriptive commit messages so you can know what was changed at a glance.
|
||||
|
||||
!> If you've changed a lot of files, but all the files are part of the same change, you can use `git add .` to add all the changed files that are in your current directory, rather than having to add each file individually.
|
||||
|
||||
### Publishing Your Changes
|
||||
|
||||
The last step is to push your changes to your fork. To do this, enter `git push`. Git now publishes the current state of `dev_branch` to your fork.
|
||||
|
||||
|
||||
## Resolving Merge Conflicts
|
||||
|
||||
Sometimes when your work in a branch takes a long time to complete, changes that have been made by others conflict with changes you have made to your branch when you open a pull request. This is called a *merge conflict*, and is what happens when multiple people edit the same parts of the same files.
|
||||
|
||||
### Rebasing Your Changes
|
||||
|
||||
A *rebase* is Git's way of taking changes that were applied at one point, reversing them, and then applying the same changes to another point. In the case of a merge conflict, you can rebase your branch to grab the changes that were made between when you created your branch and the present time.
|
||||
|
||||
To start, run the following:
|
||||
|
||||
```
|
||||
git fetch upstream
|
||||
git rev-list --left-right --count HEAD...upstream/master
|
||||
```
|
||||
|
||||
The `git rev-list` command entered here returns the number of commits that differ between the current branch and QMK's master branch. We run `git fetch` first to make sure we have the refs that represent the current state of the upstream repo. The output of the `git rev-list` command entered returns two numbers:
|
||||
|
||||
```
|
||||
$ git rev-list --left-right --count HEAD...upstream/master
|
||||
7 35
|
||||
```
|
||||
|
||||
The first number represents the number of commits on the current branch since it was created, and the second number is the number of commits made to `upstream/master` since the current branch was created, and thus, the changes that are not recorded in the current branch.
|
||||
|
||||
Now that the current states of both the current branch and the upstream repo are known, we can start a rebase operation:
|
||||
|
||||
```
|
||||
git rebase upstream/master
|
||||
```
|
||||
|
||||
This tells Git to undo the commits on the current branch, and then reapply them against QMK's master branch.
|
||||
|
||||
```
|
||||
$ git rebase upstream/master
|
||||
First, rewinding head to replay your work on top of it...
|
||||
Applying: Commit #1
|
||||
Using index info to reconstruct a base tree...
|
||||
M conflicting_file_1.txt
|
||||
Falling back to patching base and 3-way merge...
|
||||
Auto-merging conflicting_file_1.txt
|
||||
CONFLICT (content): Merge conflict in conflicting_file_1.txt
|
||||
error: Failed to merge in the changes.
|
||||
hint: Use 'git am --show-current-patch' to see the failed patch
|
||||
Patch failed at 0001 Commit #1
|
||||
|
||||
Resolve all conflicts manually, mark them as resolved with
|
||||
"git add/rm <conflicted_files>", then run "git rebase --continue".
|
||||
You can instead skip this commit: run "git rebase --skip".
|
||||
To abort and get back to the state before "git rebase", run "git rebase --abort".
|
||||
```
|
||||
|
||||
This tells us that we have a merge conflict, and gives the name of the file with the conflict. Open the conflicting file in your text editor, and somewhere in the file, you'll find something like this:
|
||||
|
||||
```
|
||||
<<<<<<< HEAD
|
||||
<p>For help with any issues, email us at support@webhost.us.</p>
|
||||
=======
|
||||
<p>Need help? Email support@webhost.us.</p>
|
||||
>>>>>>> Commit #1
|
||||
```
|
||||
|
||||
The line `<<<<<<< HEAD` marks the beginning of a merge conflict, and the `>>>>>>> Commit #1` line marks the end, with the conflicting sections separated by `=======`. The part on the `HEAD` side is from the QMK master version of the file, and the part marked with the commit message is from the current branch and commit.
|
||||
|
||||
Because Git tracks *changes to files* rather than the contents of the files directly, if Git can't find the text that was in the file previous to the commit that was made, it won't know how to edit the file. Re-editing the file will solve the conflict. Make your changes, and then save the file.
|
||||
|
||||
```
|
||||
<p>Need help? Email support@webhost.us.</p>
|
||||
```
|
||||
|
||||
Now run:
|
||||
|
||||
```
|
||||
git add conflicting_file_1.txt
|
||||
git rebase --continue
|
||||
```
|
||||
|
||||
Git logs the changes to the conflicting file, and continues applying the commits from our branch until it reaches the end.
|
@@ -16,7 +16,7 @@ Start by navigating to the `keymaps` folder for your keyboard.
|
||||
|
||||
?> Windows:
|
||||
|
||||
start keyboards/<keyboard_folder>/keymaps
|
||||
start .\\keyboards\\<keyboard_folder>\\keymaps
|
||||
|
||||
## Create a Copy Of The `default` Keymap
|
||||
|
||||
|
@@ -1,13 +1,15 @@
|
||||
# Learning Resources
|
||||
These resources are aimed at giving new members in the qmk community more understanding to the information provided in the newbs docs.
|
||||
|
||||
These resources are aimed at giving new members in the QMK community more understanding to the information provided in the Newbs docs.
|
||||
|
||||
Git resources:
|
||||
*
|
||||
*[Great General Tutorial](https://www.codecademy.com/learn/learn-git)
|
||||
*[Git Game To Learn From Examples](https://learngitbranching.js.org/)
|
||||
*[Git Resources to Learn More About Github](getting_started_github.md)
|
||||
*[Git Resources Aimed Specificly toward QMK](contributing.md)
|
||||
|
||||
* [Great General Tutorial](https://www.codecademy.com/learn/learn-git)
|
||||
* [Git Game To Learn From Examples](https://learngitbranching.js.org/)
|
||||
* [Git Resources to Learn More About Github](getting_started_github.md)
|
||||
* [Git Resources Aimed Specifically toward QMK](contributing.md)
|
||||
|
||||
|
||||
Command Line resources:
|
||||
*[Good General Tutorial on Command Line](https://www.codecademy.com/learn/learn-the-command-line)
|
||||
|
||||
* [Good General Tutorial on Command Line](https://www.codecademy.com/learn/learn-the-command-line)
|
||||
|
@@ -1,28 +1,79 @@
|
||||
# List of Useful Core Functions To Make Your Keyboard Better
|
||||
|
||||
There are a lot of hidden functions in QMK that are incredible useful, or may add a bit of functionality that you've been wanting. Functions that are specific to certain features are not included here, as those will be on their respective feature page.
|
||||
There are a lot of hidden functions in QMK that are incredible useful, or may add a bit of functionality that you've been wanting. Functions that are specific to certain features are not included here, as those will be on their respective feature page.
|
||||
|
||||
## (OLKB) Tri Layers
|
||||
|
||||
There are actually separate functions that you can use there, depending on what you're after.
|
||||
There are actually separate functions that you can use there, depending on what you're after.
|
||||
|
||||
The first is the `update_tri_layer(x, y, z)` function. This function check to see if layers `x` and `y` are both on. If they are both on, then it runs on layer `z`. Otherwise, if both `x` and `y` are not both on (either only one is, or neither is), then it runs off layer `z`.
|
||||
### `update_tri_layer(x, y, z)`
|
||||
|
||||
This function is useful if you want to create specific keys that have this functionality, but other layer keycodes won't do this.
|
||||
The first is the `update_tri_layer(x, y, z)` function. This function check to see if layers `x` and `y` are both on. If they are both on, then it runs on layer `z`. Otherwise, if both `x` and `y` are not both on (either only one is, or neither is), then it runs off layer `z`.
|
||||
|
||||
The other function is `update_tri_layer_state(state, x, y, z)`. This function is meant to be called from they [`layer_state_set_*` functions](custom_quantum_functions.md#layer-change-code). This means that any time that you use a keycode to change the layer, this will be checked. So you could use `LT(layer, kc)` to change the layer and it will trigger the same layer check.
|
||||
This function is useful if you want to create specific keys that have this functionality, but other layer keycodes won't do this.
|
||||
|
||||
The caveat to this method is that you cannot access the `z` layer without having `x` and `y` layers on, since if you try to activate just layer `z`, it will run this code and turn off layer `z` before you could use it.
|
||||
#### Example
|
||||
|
||||
```c
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
switch (keycode) {
|
||||
case LOWER:
|
||||
if (record->event.pressed) {
|
||||
layer_on(_LOWER);
|
||||
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
||||
} else {
|
||||
layer_off(_LOWER);
|
||||
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case RAISE:
|
||||
if (record->event.pressed) {
|
||||
layer_on(_RAISE);
|
||||
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
||||
} else {
|
||||
layer_off(_RAISE);
|
||||
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
```
|
||||
|
||||
### `update_tri_layer_state(state, x, y, z)`
|
||||
The other function is `update_tri_layer_state(state, x, y, z)`. This function is meant to be called from they [`layer_state_set_*` functions](custom_quantum_functions.md#layer-change-code). This means that any time that you use a keycode to change the layer, this will be checked. So you could use `LT(layer, kc)` to change the layer and it will trigger the same layer check.
|
||||
|
||||
The caveat to this method is that you cannot access the `z` layer without having `x` and `y` layers on, since if you try to activate just layer `z`, it will run this code and turn off layer `z` before you could use it.
|
||||
|
||||
#### Example
|
||||
|
||||
```c
|
||||
uint32_t layer_state_set_user(uint32_t state) {
|
||||
return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST);
|
||||
}
|
||||
```
|
||||
|
||||
Alternatively, you don't have to immediately "return" the value. This is useful if you want to add multiple tri layers, or if you want to add additional effects.
|
||||
|
||||
```c
|
||||
uint32_t layer_state_set_user(uint32_t state) {
|
||||
state = update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST);
|
||||
state = update_tri_layer_state(state, _RAISE, _SYMB, _SPECIAL);
|
||||
return state;
|
||||
}
|
||||
```
|
||||
|
||||
## Setting the Persistent Default Layer
|
||||
|
||||
Do you want to set the default layer, so that it's retained even after you unplug the board? If so, this is the function for you.
|
||||
Do you want to set the default layer, so that it's retained even after you unplug the board? If so, this is the function for you.
|
||||
|
||||
To use this, you would use `set_single_persistent_default_layer(layer)`. If you have a name defined for your layer, you can use that instead (such as _QWERTY, _DVORAK or _COLEMAK).
|
||||
To use this, you would use `set_single_persistent_default_layer(layer)`. If you have a name defined for your layer, you can use that instead (such as _QWERTY, _DVORAK or _COLEMAK).
|
||||
|
||||
This will set the default layer, update the persistent settings, and play a tune if you have [Audio](feature_audio.md) enabled on your board, and the default layer sounds set.
|
||||
This will set the default layer, update the persistent settings, and play a tune if you have [Audio](feature_audio.md) enabled on your board, and the default layer sounds set.
|
||||
|
||||
To configure the default layer sounds, you would want to define this in your `config.h` file, like this:
|
||||
To configure the default layer sounds, you would want to define this in your `config.h` file, like this:
|
||||
|
||||
```c
|
||||
#define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \
|
||||
@@ -36,13 +87,12 @@ To configure the default layer sounds, you would want to define this in your `co
|
||||
|
||||
## Reseting the keyboard
|
||||
|
||||
There is the `RESET` quantum keycode that you can use. But if you want to reset the board as part of a macro, rather than hitting a key separately, you can do that.
|
||||
There is the `RESET` quantum keycode that you can use. But if you want to reset the board as part of a macro, rather than hitting a key separately, you can do that.
|
||||
|
||||
And to do so, add `reset_keyboard()` to your function or macro, and this will reset to bootloader.
|
||||
|
||||
## Wiping the EEPROM (Persistent Storage)
|
||||
|
||||
If you're having issues with Audio, RGB Underglow, backlighting or keys acting weird, then you can reset the EEPROM (persistent setting storage). Bootmagic is one way to do this, but if that isn't enabled, then you can use a custom macro to do so.
|
||||
|
||||
To wipe the EEPROM, run `eeconfig_init()` from your function or macro to reset most of the settings to default.
|
||||
If you're having issues with Audio, RGB Underglow, backlighting or keys acting weird, then you can reset the EEPROM (persistent setting storage). Bootmagic is one way to do this, but if that isn't enabled, then you can use a custom macro to do so.
|
||||
|
||||
To wipe the EEPROM, run `eeconfig_init()` from your function or macro to reset most of the settings to default.
|
||||
|
@@ -128,7 +128,7 @@ The standard Deutsche (German) keyboard layout. Named for the first 6 letters on
|
||||
The term for pressing a key while a key is already held down. Variants include 2KRO, 6KRO, and NKRO.
|
||||
|
||||
## Scancode
|
||||
A 1 byte number that is sent as part of a HID report over USB that represents a single key. These numbers are documented in the [HID Usage Tables](http://www.usb.org/developers/hidpage/Hut1_12v2.pdf) published by the [USB-IF](http://www.usb.org/).
|
||||
A 1 byte number that is sent as part of a HID report over USB that represents a single key. These numbers are documented in the [HID Usage Tables](https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf) published by the [USB-IF](http://www.usb.org/).
|
||||
|
||||
## 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.
|
||||
|
@@ -69,7 +69,4 @@ void ws2812_sendarray_mask(uint8_t *array,uint16_t length, uint8_t pinmask);
|
||||
#define CONCAT_EXP(a, b) CONCAT(a, b)
|
||||
#endif
|
||||
|
||||
// #define ws2812_PORTREG CONCAT_EXP(PORT,ws2812_port)
|
||||
// #define ws2812_DDRREG CONCAT_EXP(DDR,ws2812_port)
|
||||
|
||||
#endif /* LIGHT_WS2812_H_ */
|
||||
|
@@ -0,0 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
/* tap dance stuff*/
|
||||
#undef TAPPING_TERM
|
||||
#define TAPPING_TERM 500
|
||||
|
||||
#define TAPPING_TOGGLE 2
|
||||
|
||||
#define EXAMPLESTRING1 "tapdance_1"
|
||||
#define EXAMPLESTRING2 "tapdance_2"
|
||||
#define EXAMPLESTRING3 "tapdance_3"
|
||||
#define EXAMPLESTRING4 "tapdance_4"
|
||||
|
||||
#undef RGBLED_NUM
|
||||
#define RGBLED_NUM 16
|
215
keyboards/1upkeyboards/sweet16/keymaps/ridingintraffic/keymap.c
Normal file
215
keyboards/1upkeyboards/sweet16/keymaps/ridingintraffic/keymap.c
Normal file
@@ -0,0 +1,215 @@
|
||||
/*
|
||||
tap danc eis turned on in the rules now...
|
||||
*/
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
#define _EMOJI 0
|
||||
#define _TAPLAND 1
|
||||
#define _LEDCNTL 2
|
||||
|
||||
enum custom_keycodes {
|
||||
SHRUG,
|
||||
DISFACE,
|
||||
FU,
|
||||
TFLIP,
|
||||
TFLIP2,
|
||||
SAD_EYES,
|
||||
TPUT,
|
||||
HAPPYFACE,
|
||||
HEARTFACE,
|
||||
CLOUD,
|
||||
CHANFACE,
|
||||
CMDCLEAR
|
||||
};
|
||||
//Tap Dance Declarations
|
||||
enum {
|
||||
TD_EXAMPLE1 = 0,
|
||||
TD_EXAMPLE2,
|
||||
TD_EXAMPLE3,
|
||||
TD_EXAMPLE4
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
/* EMOJI Pad
|
||||
* ,-------------------------------.
|
||||
* |TFLIP | TFlIP2|DISFACE| FU |
|
||||
* |------+-------+-------+--------|
|
||||
* | CLOUD| | | CLEAR |
|
||||
* |------+-------+-------+--------|
|
||||
* |SHRUG |DISFACE| HRTFAC| HAPPYF |
|
||||
* |------+-------+-------+--------|
|
||||
* | ENTER| |LEDCNTR| tapland|
|
||||
* `-------------------------------'
|
||||
*/
|
||||
//purple
|
||||
[_EMOJI] = LAYOUT_ortho_4x4(
|
||||
TFLIP, TFLIP2, KC_NO, FU ,
|
||||
CLOUD, KC_NO, KC_NO, CMDCLEAR,
|
||||
SHRUG, DISFACE, HEARTFACE, HAPPYFACE,
|
||||
KC_ENT, RGB_TOG, MO(_LEDCNTL), MO(_TAPLAND)
|
||||
),
|
||||
|
||||
/* TapLand //
|
||||
* ,-------------------------------.
|
||||
* | str1 | str2 | str3 | str4 |
|
||||
* |------+-------+-------+--------|
|
||||
* | | | | |
|
||||
* |------+-------+-------+--------|
|
||||
* | | | | |
|
||||
* |------+-------+-------+--------|
|
||||
* | | | | |
|
||||
* `-------------------------------'
|
||||
*/
|
||||
//blue
|
||||
[_TAPLAND] = LAYOUT_ortho_4x4(
|
||||
TD(TD_EXAMPLE1), TD(TD_EXAMPLE2), TD(TD_EXAMPLE3), TD(TD_EXAMPLE4),
|
||||
KC_NO, KC_NO, KC_NO, KC_NO,
|
||||
KC_NO, KC_NO, KC_NO, KC_NO,
|
||||
KC_NO, KC_NO, KC_NO, KC_NO
|
||||
),
|
||||
/* LEDControl Pad
|
||||
* ,-------------------------------.
|
||||
* | snake|breathe|rainbow|gradient|
|
||||
* |------+-------+-------+--------|
|
||||
* | xmas | Val+ | Sat+ | HUE+ |
|
||||
* |------+-------+-------+--------|
|
||||
* |kngrdr| Val- | Sat- | HUE- |
|
||||
* |------+-------+-------+--------|
|
||||
* | swirl| PLAIN | | ON/OFF |
|
||||
* `-------------------------------'
|
||||
*/
|
||||
//blue
|
||||
[_LEDCNTL] = LAYOUT_ortho_4x4(
|
||||
RGB_M_SN, RGB_M_B, RGB_M_R, RGB_M_G,
|
||||
RGB_M_X, RGB_VAI, RGB_SAI, RGB_HUI,
|
||||
RGB_M_K, RGB_VAD, RGB_SAD, RGB_HUD,
|
||||
RGB_M_SW, RGB_M_P, KC_NO, RGB_TOG
|
||||
),
|
||||
};
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
if (record->event.pressed) {
|
||||
switch(keycode) {
|
||||
case CLOUD: // (っ◕‿◕)っ
|
||||
if(record->event.pressed){
|
||||
send_unicode_hex_string("0028 3063 25D5 203F 25D5 0029 3063");
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case FU: // t(-_-t)
|
||||
if(record->event.pressed){
|
||||
SEND_STRING("t(-_-t)");
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case HAPPYFACE: // ʘ‿ʘ
|
||||
if(record->event.pressed){
|
||||
send_unicode_hex_string("0298 203F 0298");
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case CMDCLEAR:
|
||||
if (record->event.pressed) {
|
||||
register_code(KC_LGUI);
|
||||
tap_code(KC_A);
|
||||
unregister_code(KC_LGUI);
|
||||
tap_code(KC_DEL);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case SHRUG: // ¯\_(ツ)_/¯
|
||||
if (record->event.pressed) {
|
||||
send_unicode_hex_string("00AF 005C 005F 0028 30C4 0029 005F 002F 00AF");
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case HEARTFACE: // ♥‿♥
|
||||
if(record->event.pressed){
|
||||
send_unicode_hex_string("2665 203F 2665");
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case DISFACE: // ಠ_ಠ
|
||||
if(record->event.pressed){
|
||||
send_unicode_hex_string("0CA0 005F 0CA0");
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case TFLIP: // (╯°□°)╯ ︵ ┻━┻
|
||||
if(record->event.pressed){
|
||||
send_unicode_hex_string("0028 256F 00B0 25A1 00B0 0029 256F 0020 FE35 0020 253B 2501 253B");
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case TFLIP2: // ┻━┻︵ \(°□°)/ ︵ ┻━┻
|
||||
if(record->event.pressed){
|
||||
send_unicode_hex_string("253B 2501 253B FE35 0020 005C 0028 00B0 25A1 00B0 0029 002F 0020 FE35 0020 253B 2501 253B");
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/* tap dance time */
|
||||
void tdexample1(qk_tap_dance_state_t *state, void *user_data) {
|
||||
if (state->count >= 2) {
|
||||
SEND_STRING(EXAMPLESTRING1);
|
||||
reset_tap_dance (state);
|
||||
}
|
||||
}
|
||||
void tdexample2(qk_tap_dance_state_t *state, void *user_data) {
|
||||
if (state->count >= 2) {
|
||||
SEND_STRING(EXAMPLESTRING2);
|
||||
reset_tap_dance (state);
|
||||
}
|
||||
}
|
||||
void tdexample3(qk_tap_dance_state_t *state, void *user_data) {
|
||||
if (state->count >= 2) {
|
||||
SEND_STRING(EXAMPLESTRING3);
|
||||
reset_tap_dance (state);
|
||||
}
|
||||
}
|
||||
void tdexample4(qk_tap_dance_state_t *state, void *user_data) {
|
||||
if (state->count >= 2) {
|
||||
SEND_STRING(EXAMPLESTRING4);
|
||||
reset_tap_dance (state);
|
||||
}
|
||||
}
|
||||
|
||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
||||
[TD_EXAMPLE1] = ACTION_TAP_DANCE_FN(tdexample1),
|
||||
[TD_EXAMPLE2] = ACTION_TAP_DANCE_FN(tdexample2),
|
||||
[TD_EXAMPLE3] = ACTION_TAP_DANCE_FN(tdexample3),
|
||||
[TD_EXAMPLE4] = ACTION_TAP_DANCE_FN(tdexample4)
|
||||
};
|
||||
|
||||
// Runs just one time when the keyboard initializes.
|
||||
void matrix_scan_user(void) {
|
||||
static bool has_ran_yet;
|
||||
if (!has_ran_yet) {
|
||||
has_ran_yet = true;
|
||||
rgblight_setrgb (16, 0, 16);
|
||||
}
|
||||
}
|
||||
uint32_t layer_state_set_user(uint32_t state) {
|
||||
switch (biton32(state)) {
|
||||
case _TAPLAND:
|
||||
rgblight_setrgb(0, 16, 0); //green
|
||||
break;
|
||||
case _LEDCNTL:
|
||||
rgblight_setrgb(0, 0, 16); //blue
|
||||
break;
|
||||
case _EMOJI:
|
||||
rgblight_setrgb (16, 0, 16); //purple
|
||||
break;
|
||||
|
||||
default: // for any other layers, or the default layer
|
||||
rgblight_setrgb (16, 0, 16); //purple
|
||||
break;
|
||||
}
|
||||
return state;
|
||||
}
|
@@ -0,0 +1,10 @@
|
||||
# Ridingtraffic's examples
|
||||
===
|
||||
This keymap has many features:
|
||||
3 layers
|
||||
Momentary layer switching
|
||||
16 pixel neopixel
|
||||
Unicode Enabled
|
||||
Tap dance enabled
|
||||
|
||||
The rgb also updates depending on what layer you are on, and then flips back when done.
|
@@ -0,0 +1,5 @@
|
||||
# turning on tap dance
|
||||
TAP_DANCE_ENABLE = yes
|
||||
RGBLIGHT_ENABLE = yes
|
||||
MOUSEKEY_ENABLE = no
|
||||
UNICODE_ENABLE = yes
|
@@ -35,7 +35,7 @@
|
||||
{ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, ___, ___, ___, ___, ___}, \
|
||||
{ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, ___, ___, ___, ___, ___}, \
|
||||
{ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, ___, ___, ___, ___, ___}, \
|
||||
{ K30, K31, K32, K33, K34, K35, K35, K37, K38, K39, ___, ___, ___, ___, ___}, \
|
||||
{ K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, ___, ___, ___, ___, ___}, \
|
||||
{ K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, ___, ___, ___, ___, ___} \
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
{ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, K0c, K0d, K0e}, \
|
||||
{ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, K1c, K1d, K1e}, \
|
||||
{ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, K2c, K2d, K2e}, \
|
||||
{ K30, K31, K32, K33, K34, K35, K35, K37, K38, K39, K3a, K3b, K3c, K3d, K3e}, \
|
||||
{ K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3a, K3b, K3c, K3d, K3e}, \
|
||||
{ K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4a, K4b, K4c, K4d, K4e} \
|
||||
}
|
||||
|
||||
|
@@ -39,11 +39,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/* ws2812 RGB LED */
|
||||
#define RGB_DI_PIN F7
|
||||
#define RGBLIGHT_TIMER
|
||||
|
||||
#define RGBLIGHT_ANIMATIONS
|
||||
#define RGBLED_NUM 6 // Number of LEDs
|
||||
#define ws2812_PORTREG PORTD
|
||||
#define ws2812_DDRREG DDRD
|
||||
|
||||
/* COL2ROW or ROW2COL */
|
||||
#define DIODE_DIRECTION COL2ROW
|
||||
|
@@ -39,10 +39,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/* ws2812 RGB LED */
|
||||
#define RGB_DI_PIN F7
|
||||
#define RGBLIGHT_TIMER
|
||||
|
||||
#define RGBLED_NUM 1 // Number of LEDs
|
||||
#define ws2812_PORTREG PORTD
|
||||
#define ws2812_DDRREG DDRD
|
||||
|
||||
/* COL2ROW or ROW2COL */
|
||||
#define DIODE_DIRECTION COL2ROW
|
||||
|
@@ -1,5 +1,5 @@
|
||||
# Build Options
|
||||
# change to "no" to disable the options, or define them in the Makefile in
|
||||
# change to "no" to disable the options, or define them in the Makefile in
|
||||
# the appropriate keymap folder that will get included automatically
|
||||
#
|
||||
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
|
||||
@@ -13,14 +13,11 @@ MIDI_ENABLE = no # MIDI controls
|
||||
AUDIO_ENABLE = no # Audio output on port C6
|
||||
UNICODE_ENABLE = no # Unicode
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
|
||||
RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight.
|
||||
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||
|
||||
#define ws2812_PORTREG PORTD
|
||||
#define ws2812_DDRREG DDRD
|
||||
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../../Makefile
|
||||
|
@@ -1,5 +1,5 @@
|
||||
# Build Options
|
||||
# change to "no" to disable the options, or define them in the Makefile in
|
||||
# change to "no" to disable the options, or define them in the Makefile in
|
||||
# the appropriate keymap folder that will get included automatically
|
||||
#
|
||||
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
|
||||
@@ -13,15 +13,7 @@ MIDI_ENABLE = no # MIDI controls
|
||||
AUDIO_ENABLE = no # Audio output on port C6
|
||||
UNICODE_ENABLE = no # Unicode
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
|
||||
RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight.
|
||||
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||
|
||||
#define ws2812_PORTREG PORTD
|
||||
#define ws2812_DDRREG DDRD
|
||||
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../../Makefile
|
||||
endif
|
||||
|
@@ -13,15 +13,7 @@ MIDI_ENABLE = no # MIDI controls
|
||||
AUDIO_ENABLE = no # Audio output on port C6
|
||||
UNICODE_ENABLE = no # Unicode
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
|
||||
|
||||
# Do not enable SLEEP_LED_ENABLE. It uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||
|
||||
#define ws2812_PORTREG PORTD
|
||||
#define ws2812_DDRREG DDRD
|
||||
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../../Makefile
|
||||
endif
|
||||
|
@@ -1,5 +1,5 @@
|
||||
# Build Options
|
||||
# change to "no" to disable the options, or define them in the Makefile in
|
||||
# change to "no" to disable the options, or define them in the Makefile in
|
||||
# the appropriate keymap folder that will get included automatically
|
||||
#
|
||||
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
|
||||
@@ -13,15 +13,7 @@ MIDI_ENABLE = no # MIDI controls
|
||||
AUDIO_ENABLE = no # Audio output on port C6
|
||||
UNICODE_ENABLE = no # Unicode
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
|
||||
RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight.
|
||||
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||
|
||||
#define ws2812_PORTREG PORTD
|
||||
#define ws2812_DDRREG DDRD
|
||||
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../../Makefile
|
||||
endif
|
||||
|
@@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls
|
||||
AUDIO_ENABLE = no # Audio output on port C6
|
||||
UNICODE_ENABLE = no # Unicode
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
|
||||
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||
|
@@ -9,7 +9,7 @@ MIDI_ENABLE = no # MIDI controls
|
||||
AUDIO_ENABLE = yes # Audio output on port C6
|
||||
UNICODE_ENABLE = no # Unicode
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
|
||||
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
@@ -63,7 +63,7 @@ MIDI_ENABLE = no # MIDI controls
|
||||
AUDIO_ENABLE = no # Audio output on port C6
|
||||
UNICODE_ENABLE = no # Unicode
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
|
||||
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||
|
@@ -10,7 +10,7 @@ MIDI_ENABLE = no # MIDI controls
|
||||
AUDIO_ENABLE = no # Audio output on port C6
|
||||
UNICODE_ENABLE = yes # Unicode
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
|
||||
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
|
6
keyboards/atreus62/keymaps/194h/config.h
Normal file
6
keyboards/atreus62/keymaps/194h/config.h
Normal file
@@ -0,0 +1,6 @@
|
||||
#pragma once
|
||||
#define ONESHOT_TIMEOUT 3000
|
||||
#define TAPPING_TERM 200
|
||||
#define FORCE_NKRO
|
||||
#define LEADER_TIMEOUT 1000
|
||||
#define TAPPING_TOGGLE 3
|
149
keyboards/atreus62/keymaps/194h/keymap.c
Normal file
149
keyboards/atreus62/keymaps/194h/keymap.c
Normal file
@@ -0,0 +1,149 @@
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
//The current Nordic and Norwegian layout files are a mess. I'll do it myself:
|
||||
//Norwegian
|
||||
#define NO_AE KC_QUOT // Æ
|
||||
#define NO_AO KC_LBRC // Å
|
||||
#define NO_BSLS KC_EQL // Backslash
|
||||
#define NO_LT KC_NUBS // <
|
||||
#define NO_MINS KC_SLSH // -
|
||||
#define NO_OE KC_SCLN // Ø
|
||||
#define NO_PIPE KC_GRV // |
|
||||
#define NO_PLUS KC_MINS // +
|
||||
#define NO_QUOT KC_NUHS // '
|
||||
#define NO_UMLA KC_RBRC // ¨
|
||||
//Norwegian - Modifier dependant definitions
|
||||
#define NO_EXLM LSFT(KC_1) // !
|
||||
#define NO_DQT LSFT(KC_2) // "
|
||||
#define NO_AT RALT(KC_2) // @
|
||||
#define NO_HASH LSFT(KC_3) // #
|
||||
#define NO_EUR LSFT(KC_4) // €
|
||||
#define NO_DLR RALT(KC_4) // $
|
||||
#define NO_PERC LSFT(KC_5) // %
|
||||
#define NO_AND LSFT(KC_6) // &
|
||||
#define NO_SLSH LSFT(KC_7) // /
|
||||
#define NO_PO LSFT(KC_8) // (
|
||||
#define NO_PC LSFT(KC_9) // )
|
||||
#define NO_EQL LSFT(KC_0) // =
|
||||
#define NO_LCBR RALT(KC_7) // {
|
||||
#define NO_LBRC RALT(KC_8) // [
|
||||
#define NO_RBRC RALT(KC_9) // ]
|
||||
#define NO_RCBR RALT(KC_0) // }
|
||||
#define NO_COLN LSFT(KC_DOT) // :
|
||||
#define NO_SCLN LSFT(KC_COMM) // ;
|
||||
#define NO_MU RALT(KC_M) // µ
|
||||
#define NO_EURO RALT(KC_E) // €
|
||||
#define NO_SECT LSFT(KC_GRV) // §
|
||||
#define NO_GERC RALT(KC_COMM) // ¸
|
||||
#define NO_QUAR LSFT(RALT(KC_4)) // ¼
|
||||
//Norwegian layout - dependant on previous definitions
|
||||
#define NO_UNDS LSFT(NO_MINS) // _
|
||||
#define NO_QUES LSFT(NO_PLUS) // ?
|
||||
#define NO_ACUT RALT(NO_BSLS) // Acute
|
||||
#define NO_GRAV LSFT(NO_BSLS) // `
|
||||
#define NO_GT LSFT(NO_LT) // >
|
||||
#define NO_HALF RALT(NO_LT) // ½
|
||||
#define NO_HAT LSFT(NO_UMLA) // ^
|
||||
#define NO_ASTR LSFT(NO_QUOT) // *
|
||||
#define NO_TILD RALT(NO_UMLA) // ~
|
||||
|
||||
//One Shot Modifier
|
||||
#define OSM_LCTL OSM(MOD_LCTL)
|
||||
#define OSM_LALT OSM(MOD_LALT)
|
||||
#define OSM_LSFT OSM(MOD_LSFT)
|
||||
#define OSM_LGUI OSM(MOD_LGUI)
|
||||
#define OSM_RCTL OSM(MOD_RCTL)
|
||||
#define OSM_RALT OSM(MOD_RALT)
|
||||
#define OSM_RSFT OSM(MOD_RSFT)
|
||||
#define OSM_RGUI OSM(MOD_RGUI)
|
||||
|
||||
//CTRL on hold, ESC on tap
|
||||
#define CTL_ESC CTL_T(KC_ESC)
|
||||
|
||||
//Layers
|
||||
#define L1 0
|
||||
#define L2 1
|
||||
#define L3 2
|
||||
#define L4 3
|
||||
#define L5 4
|
||||
|
||||
// Momentary switch to layer
|
||||
#define MO_L2 MO(L2)
|
||||
#define MO_L4 MO(L4)
|
||||
#define MO_L5 MO(L5)
|
||||
// Momentary switch to layer - One Shot Layer
|
||||
#define OSL_L2 OSL(L2)
|
||||
#define OSL_L3 OSL(L3)
|
||||
#define OSL_L4 OSL(L4)
|
||||
|
||||
//Tap Dance Declarations
|
||||
enum {
|
||||
SCLN_OE = 0,
|
||||
QUOT_AE,
|
||||
DQT_AO
|
||||
};
|
||||
|
||||
//Tap Dance Definitions
|
||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
||||
//Tap once for semicolon, twice for ø
|
||||
[SCLN_OE] = ACTION_TAP_DANCE_DOUBLE(NO_SCLN, NO_OE),
|
||||
//Tap once for single quote, twice for æ
|
||||
[QUOT_AE] = ACTION_TAP_DANCE_DOUBLE(NO_QUOT, NO_AE),
|
||||
//Tap once for double quote, twice for å
|
||||
[DQT_AO] = ACTION_TAP_DANCE_DOUBLE(NO_DQT, NO_AO),
|
||||
// Other declarations would go here, separated by commas, if you have them
|
||||
};
|
||||
|
||||
//Tap Dance keys
|
||||
#define TD_SCLN_OE TD(SCLN_OE)
|
||||
#define TD_QUOT_AE TD(QUOT_AE)
|
||||
#define TD_DQT_AO TD(DQT_AO)
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
[L1] = LAYOUT(
|
||||
KC_LGUI, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_RGUI,
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, TD_DQT_AO,
|
||||
KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, TD_SCLN_OE, TD_QUOT_AE,
|
||||
OSM_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, NO_MINS, OSM_RSFT,
|
||||
CTL_ESC, MO_L5, KC_TAB, OSM_LALT, MO_L4, OSL_L3, KC_SPC, KC_ENT, OSL_L3, MO_L4, OSM_LALT, NO_EQL, NO_PLUS, KC_RCTL
|
||||
),
|
||||
[L2] = LAYOUT(
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, NO_DQT,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, NO_SCLN, NO_QUOT,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
),
|
||||
[L3] = LAYOUT(
|
||||
NO_LBRC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, NO_RBRC,
|
||||
NO_LCBR, XXXXXXX, XXXXXXX, NO_AT, XXXXXXX, NO_TILD, NO_QUES, NO_EXLM, NO_PIPE, XXXXXXX, XXXXXXX, NO_RCBR,
|
||||
_______, NO_ASTR, NO_BSLS, NO_DLR, NO_HASH, XXXXXXX, NO_HAT, XXXXXXX, NO_COLN, NO_SLSH, NO_SCLN, NO_QUOT,
|
||||
NO_PO, KC_0, NO_SECT, NO_PERC, XXXXXXX, NO_GRAV, NO_AND, NO_UMLA, NO_LT, NO_GT, NO_UNDS, NO_PC,
|
||||
XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX
|
||||
),
|
||||
[L4] = LAYOUT(
|
||||
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||
XXXXXXX, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_HOME, KC_PGDN, KC_PGUP, KC_END, XXXXXXX, XXXXXXX,
|
||||
_______, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, XXXXXXX, KC_DEL,
|
||||
XXXXXXX, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, XXXXXXX, KC_APP, XXXXXXX, XXXXXXX, KC_VOLD, XXXXXXX,
|
||||
OSM_LCTL, _______, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, OSM_RALT, KC_MUTE, KC_VOLU, OSM_RCTL
|
||||
),
|
||||
[L5] = LAYOUT(
|
||||
XXXXXXX, TO(L1), TO(L2), TO(L3), TO(L4), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||
XXXXXXX, XXXXXXX, XXXXXXX, KC_CAPS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||
XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX
|
||||
)
|
||||
};
|
||||
|
||||
//TODO: Is there productivity gain in the use of unicode?
|
||||
// - Won't work in xterm.
|
||||
// Create a layer for macros and/or unicode?
|
||||
// Are macros useful?
|
||||
// - Found no gain in having sendstring for commands.
|
||||
// - Find repeated tasks that cannot be done easily on the OS.
|
||||
// - Most other keymaps have macros for game/fun stuff, hard to find "serious" onces.
|
||||
// Screw Norwegian layout, switch to US with unicode æøå or US/English International?
|
||||
// - Will be different from laptop keyboard, requiring a switch on the OS side when only using the laptop.
|
7
keyboards/atreus62/keymaps/194h/rules.mk
Normal file
7
keyboards/atreus62/keymaps/194h/rules.mk
Normal file
@@ -0,0 +1,7 @@
|
||||
TAP_DANCE_ENABLE = yes
|
||||
NKRO_ENABLE = true
|
||||
MOUSEKEY_ENABLE = no
|
||||
EXTRAKEY_ENABLE = yes
|
||||
CONSOLE_ENABLE = no
|
||||
KEY_LOCK_ENABLE = no
|
||||
LEADER_ENABLE = no
|
@@ -53,7 +53,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/* ws2812 RGB LED */
|
||||
#define RGB_DI_PIN B4
|
||||
#define RGBLIGHT_TIMER
|
||||
|
||||
#define RGBLED_NUM 20 // Number of LEDs
|
||||
|
||||
/*
|
||||
|
@@ -63,7 +63,7 @@ MIDI_ENABLE = no # MIDI controls
|
||||
AUDIO_ENABLE = no # Audio output on port C6
|
||||
UNICODE_ENABLE = no # Unicode
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||
|
||||
|
@@ -26,10 +26,12 @@ void matrix_init_user(void) {
|
||||
|
||||
__attribute__ ((weak))
|
||||
void matrix_scan_user(void) {
|
||||
#if defined(RGBLIGHT_ENABLE)
|
||||
if (runonce && timer_elapsed(my_timer) > 1000) {
|
||||
runonce = false;
|
||||
rgblight_sethsv_noeeprom(0x0, 0xff, 0x80);
|
||||
rgblight_mode_noeeprom(9);
|
||||
rgblight_enable_noeeprom();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@@ -21,7 +21,6 @@
|
||||
#define MATRIX_ROW_PINS { B4 }
|
||||
#undef MATRIX_COL_PINS
|
||||
#define MATRIX_COL_PINS { B6 }
|
||||
//#define UNUSED_PINS
|
||||
|
||||
/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */
|
||||
#undef DIODE_DIRECTION
|
||||
@@ -32,14 +31,12 @@
|
||||
#define BACKLIGHT_LEVELS 3
|
||||
#define BREATHING_PERIOD 5
|
||||
|
||||
/* for Tap Dance */
|
||||
#undef TAPPING_TERM
|
||||
#define TAPPING_TERM 700
|
||||
|
||||
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
|
||||
//#define DEBOUNCING_DELAY 5
|
||||
#undef DEBOUNCING_DELAY
|
||||
#define DEBOUNCING_DELAY 2
|
||||
#define DEBOUNCING_DELAY 5
|
||||
|
||||
// set flashing LED with QMK DFU
|
||||
#define QMK_LED B0
|
||||
|
||||
// set audio pin
|
||||
#define C6_AUDIO
|
||||
|
@@ -20,8 +20,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[0] = LAYOUT( /* Base */
|
||||
TD(CAD_TD) \
|
||||
),
|
||||
};
|
||||
|
||||
void led_set_user(uint8_t usb_led) {
|
||||
|
||||
}
|
||||
[1] = LAYOUT( /*Secondary*/
|
||||
TD(BSW_TAP_DANCE) \
|
||||
),
|
||||
};
|
@@ -1,7 +1,16 @@
|
||||
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default
|
||||
|
||||
#If using a ProMicro and it has the QMK DFU bootloader instead of Caterina,
|
||||
#run "make <keyboard>:<keymap> dfu=qmk" when compiling to ensure it is flagged properly after being flashed
|
||||
ifeq ($(strip $(dfu)), qmk)
|
||||
BOOTLOADER = qmk-dfu
|
||||
endif
|
||||
endif
|
||||
|
||||
AUDIO_ENABLE = yes # Audio output on port C6
|
||||
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default
|
||||
CONSOLE_ENABLE = no # Console for debug(+400)
|
||||
COMMAND_ENABLE = no # Commands for debug and configuration
|
||||
RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
|
||||
MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config)
|
||||
UNICODE_ENABLE = no # Unicode
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
|
||||
HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400)
|
@@ -51,11 +51,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/* ws2812 RGB LED */
|
||||
#define RGB_DI_PIN B1
|
||||
#define RGBLIGHT_TIMER
|
||||
#define RGBLED_NUM 4
|
||||
#define ws2812_PORTREG PORTB
|
||||
#define ws2812_DDRREG DDRB
|
||||
|
||||
#define RGBLED_NUM 4
|
||||
#define RGBLIGHT_HUE_STEP 10
|
||||
#define RGBLIGHT_SAT_STEP 17
|
||||
|
||||
|
211
keyboards/bminiex/backlight.c
Normal file
211
keyboards/bminiex/backlight.c
Normal file
@@ -0,0 +1,211 @@
|
||||
/**
|
||||
* Backlighting code for PS2AVRGB boards (ATMEGA32A)
|
||||
* Kenneth A. (github.com/krusli | krusli.me)
|
||||
*/
|
||||
|
||||
#include "backlight.h"
|
||||
#include "quantum.h"
|
||||
|
||||
#include <avr/pgmspace.h>
|
||||
#include <avr/interrupt.h>
|
||||
|
||||
#include "backlight_custom.h"
|
||||
#include "breathing_custom.h"
|
||||
|
||||
// DEBUG
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
// Port D: digital pins of the AVR chipset
|
||||
#define NUMLOCK_PORT (1 << 0) // D0
|
||||
#define CAPSLOCK_PORT (1 << 1) // D1
|
||||
#define BACKLIGHT_PORT (1 << 4) // D4
|
||||
#define SCROLLLOCK_PORT (1 << 6) // D6
|
||||
|
||||
#define TIMER_CLK_DIV64 0x03 ///< Timer clocked at F_CPU/64
|
||||
#define TIMER1PRESCALE TIMER_CLK_DIV64 ///< timer 1 prescaler default
|
||||
|
||||
#define TIMER_PRESCALE_MASK 0x07 ///< Timer Prescaler Bit-Mask
|
||||
|
||||
#define PWM_MAX 0xFF
|
||||
#define TIMER_TOP 255 // 8 bit PWM
|
||||
|
||||
extern backlight_config_t backlight_config;
|
||||
|
||||
/**
|
||||
* References
|
||||
* Port Registers: https://www.arduino.cc/en/Reference/PortManipulation
|
||||
* TCCR1A: https://electronics.stackexchange.com/questions/92350/what-is-the-difference-between-tccr1a-and-tccr1b
|
||||
* Timers: http://www.avrbeginners.net/architecture/timers/timers.html
|
||||
* 16-bit timer setup: http://sculland.com/ATmega168/Interrupts-And-Timers/16-Bit-Timer-Setup/
|
||||
* PS2AVRGB firmware: https://github.com/showjean/ps2avrU/tree/master/firmware
|
||||
*/
|
||||
|
||||
// @Override
|
||||
// turn LEDs on and off depending on USB caps/num/scroll lock states.
|
||||
__attribute__ ((weak))
|
||||
void led_set_user(uint8_t usb_led) {
|
||||
if (usb_led & (1 << USB_LED_NUM_LOCK)) {
|
||||
// turn on
|
||||
DDRD |= NUMLOCK_PORT;
|
||||
PORTD |= NUMLOCK_PORT;
|
||||
} else {
|
||||
// turn off
|
||||
DDRD &= ~NUMLOCK_PORT;
|
||||
PORTD &= ~NUMLOCK_PORT;
|
||||
}
|
||||
|
||||
if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
|
||||
DDRD |= CAPSLOCK_PORT;
|
||||
PORTD |= CAPSLOCK_PORT;
|
||||
} else {
|
||||
DDRD &= ~CAPSLOCK_PORT;
|
||||
PORTD &= ~CAPSLOCK_PORT;
|
||||
}
|
||||
|
||||
if (usb_led & (1 << USB_LED_SCROLL_LOCK)) {
|
||||
DDRD |= SCROLLLOCK_PORT;
|
||||
PORTD |= SCROLLLOCK_PORT;
|
||||
} else {
|
||||
DDRD &= ~SCROLLLOCK_PORT;
|
||||
PORTD &= ~SCROLLLOCK_PORT;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef BACKLIGHT_ENABLE
|
||||
|
||||
// sets up Timer 1 for 8-bit PWM
|
||||
void timer1PWMSetup(void) { // NOTE ONLY CALL THIS ONCE
|
||||
// default 8 bit mode
|
||||
TCCR1A &= ~(1 << 1); // cbi(TCCR1A,PWM11); <- set PWM11 bit to HIGH
|
||||
TCCR1A |= (1 << 0); // sbi(TCCR1A,PWM10); <- set PWM10 bit to LOW
|
||||
|
||||
// clear output compare value A
|
||||
// outb(OCR1AH, 0);
|
||||
// outb(OCR1AL, 0);
|
||||
|
||||
// clear output comparator registers for B
|
||||
OCR1BH = 0; // outb(OCR1BH, 0);
|
||||
OCR1BL = 0; // outb(OCR1BL, 0);
|
||||
}
|
||||
|
||||
bool is_init = false;
|
||||
void timer1Init(void) {
|
||||
// timer1SetPrescaler(TIMER1PRESCALE)
|
||||
// set to DIV/64
|
||||
(TCCR1B) = ((TCCR1B) & ~TIMER_PRESCALE_MASK) | TIMER1PRESCALE;
|
||||
|
||||
// reset TCNT1
|
||||
TCNT1H = 0; // outb(TCNT1H, 0);
|
||||
TCNT1L = 0; // outb(TCNT1L, 0);
|
||||
|
||||
// TOIE1: Timer Overflow Interrupt Enable (Timer 1);
|
||||
TIMSK |= _BV(TOIE1); // sbi(TIMSK, TOIE1);
|
||||
|
||||
is_init = true;
|
||||
}
|
||||
|
||||
void timer1UnInit(void) {
|
||||
// set prescaler back to NONE
|
||||
(TCCR1B) = ((TCCR1B) & ~TIMER_PRESCALE_MASK) | 0x00; // TIMERRTC_CLK_STOP
|
||||
|
||||
// disable timer overflow interrupt
|
||||
TIMSK &= ~_BV(TOIE1); // overflow bit?
|
||||
|
||||
setPWM(0);
|
||||
|
||||
is_init = false;
|
||||
}
|
||||
|
||||
|
||||
// handle TCNT1 overflow
|
||||
//! Interrupt handler for tcnt1 overflow interrupt
|
||||
ISR(TIMER1_OVF_vect, ISR_NOBLOCK)
|
||||
{
|
||||
// sei();
|
||||
// handle breathing here
|
||||
#ifdef BACKLIGHT_BREATHING
|
||||
if (is_breathing()) {
|
||||
custom_breathing_handler();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// enable timer 1 PWM
|
||||
// timer1PWMBOn()
|
||||
void timer1PWMBEnable(void) {
|
||||
// turn on channel B (OC1B) PWM output
|
||||
// set OC1B as non-inverted PWM
|
||||
TCCR1A |= _BV(COM1B1);
|
||||
TCCR1A &= ~_BV(COM1B0);
|
||||
}
|
||||
|
||||
// disable timer 1 PWM
|
||||
// timer1PWMBOff()
|
||||
void timer1PWMBDisable(void) {
|
||||
TCCR1A &= ~_BV(COM1B1);
|
||||
TCCR1A &= ~_BV(COM1B0);
|
||||
}
|
||||
|
||||
void enableBacklight(void) {
|
||||
DDRD |= BACKLIGHT_PORT; // set digital pin 4 as output
|
||||
PORTD |= BACKLIGHT_PORT; // set digital pin 4 to high
|
||||
}
|
||||
|
||||
void disableBacklight(void) {
|
||||
// DDRD &= ~BACKLIGHT_PORT; // set digital pin 4 as input
|
||||
PORTD &= ~BACKLIGHT_PORT; // set digital pin 4 to low
|
||||
}
|
||||
|
||||
void startPWM(void) {
|
||||
timer1Init();
|
||||
timer1PWMBEnable();
|
||||
enableBacklight();
|
||||
}
|
||||
|
||||
void stopPWM(void) {
|
||||
timer1UnInit();
|
||||
disableBacklight();
|
||||
timer1PWMBDisable();
|
||||
}
|
||||
|
||||
void b_led_init_ports(void) {
|
||||
/* turn backlight on/off depending on user preference */
|
||||
#if BACKLIGHT_ON_STATE == 0
|
||||
// DDRx register: sets the direction of Port D
|
||||
// DDRD &= ~BACKLIGHT_PORT; // set digital pin 4 as input
|
||||
PORTD &= ~BACKLIGHT_PORT; // set digital pin 4 to low
|
||||
#else
|
||||
DDRD |= BACKLIGHT_PORT; // set digital pin 4 as output
|
||||
PORTD |= BACKLIGHT_PORT; // set digital pin 4 to high
|
||||
#endif
|
||||
|
||||
timer1PWMSetup();
|
||||
startPWM();
|
||||
|
||||
#ifdef BACKLIGHT_BREATHING
|
||||
breathing_enable();
|
||||
#endif
|
||||
}
|
||||
|
||||
void b_led_set(uint8_t level) {
|
||||
if (level > BACKLIGHT_LEVELS) {
|
||||
level = BACKLIGHT_LEVELS;
|
||||
}
|
||||
|
||||
setPWM((int)(TIMER_TOP * (float) level / BACKLIGHT_LEVELS));
|
||||
}
|
||||
|
||||
// called every matrix scan
|
||||
void b_led_task(void) {
|
||||
// do nothing for now
|
||||
}
|
||||
|
||||
void setPWM(uint16_t xValue) {
|
||||
if (xValue > TIMER_TOP) {
|
||||
xValue = TIMER_TOP;
|
||||
}
|
||||
OCR1B = xValue; // timer1PWMBSet(xValue);
|
||||
}
|
||||
|
||||
#endif // BACKLIGHT_ENABLE
|
13
keyboards/bminiex/backlight_custom.h
Normal file
13
keyboards/bminiex/backlight_custom.h
Normal file
@@ -0,0 +1,13 @@
|
||||
/**
|
||||
* Backlighting code for PS2AVRGB boards (ATMEGA32A)
|
||||
* Kenneth A. (github.com/krusli | krusli.me)
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <avr/pgmspace.h>
|
||||
void b_led_init_ports(void);
|
||||
void b_led_set(uint8_t level);
|
||||
void b_led_task(void);
|
||||
void setPWM(uint16_t xValue);
|
||||
|
97
keyboards/bminiex/bminiex.c
Normal file
97
keyboards/bminiex/bminiex.c
Normal file
@@ -0,0 +1,97 @@
|
||||
/*
|
||||
Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "bminiex.h"
|
||||
#include "rgblight.h"
|
||||
|
||||
#include <avr/pgmspace.h>
|
||||
|
||||
#include "action_layer.h"
|
||||
#include "i2c.h"
|
||||
#include "quantum.h"
|
||||
|
||||
#include "backlight.h"
|
||||
#include "backlight_custom.h"
|
||||
|
||||
// for keyboard subdirectory level init functions
|
||||
// @Override
|
||||
void matrix_init_kb(void) {
|
||||
// call user level keymaps, if any
|
||||
matrix_init_user();
|
||||
}
|
||||
|
||||
#ifdef BACKLIGHT_ENABLE
|
||||
/// Overrides functions in `quantum.c`
|
||||
void backlight_init_ports(void) {
|
||||
b_led_init_ports();
|
||||
}
|
||||
|
||||
void backlight_task(void) {
|
||||
b_led_task();
|
||||
}
|
||||
|
||||
void backlight_set(uint8_t level) {
|
||||
b_led_set(level);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
extern rgblight_config_t rgblight_config;
|
||||
|
||||
// custom RGB driver
|
||||
void rgblight_set(void) {
|
||||
if (!rgblight_config.enable) {
|
||||
for (uint8_t i=0; i<RGBLED_NUM; i++) {
|
||||
led[i].r = 0;
|
||||
led[i].g = 0;
|
||||
led[i].b = 0;
|
||||
}
|
||||
}
|
||||
|
||||
i2c_init();
|
||||
i2c_send(0xb0, (uint8_t*)led, 3 * RGBLED_NUM);
|
||||
}
|
||||
|
||||
bool rgb_init = false;
|
||||
|
||||
void matrix_scan_kb(void) {
|
||||
// if LEDs were previously on before poweroff, turn them back on
|
||||
if (rgb_init == false && rgblight_config.enable) {
|
||||
i2c_init();
|
||||
i2c_send(0xb0, (uint8_t*)led, 3 * RGBLED_NUM);
|
||||
rgb_init = true;
|
||||
}
|
||||
|
||||
rgblight_task();
|
||||
#else
|
||||
void matrix_scan_kb(void) {
|
||||
#endif
|
||||
matrix_scan_user();
|
||||
/* Nothing else for now. */
|
||||
}
|
||||
|
||||
__attribute__((weak)) // overridable
|
||||
void matrix_init_user(void) {
|
||||
|
||||
}
|
||||
|
||||
__attribute__((weak)) // overridable
|
||||
void matrix_scan_user(void) {
|
||||
|
||||
}
|
||||
|
||||
|
58
keyboards/bminiex/bminiex.h
Normal file
58
keyboards/bminiex/bminiex.h
Normal file
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "quantum.h"
|
||||
|
||||
#define LAYOUT( \
|
||||
K05, K25, K35, K45, K55, K06, KA6, KA7, K07, KB5, KC5, KD5, KE5, KD1, KE1, KE2, K65, K75, K85, K95, \
|
||||
K04, K14, K24, K34, K44, K54, K16, KB6, KB7, K17, KA4, KB4, KC4, KE4, KD0, K64, K74, K84, K94, \
|
||||
K03, K13, K23, K33, K43, K53, K26, KC6, KC7, K27, KA3, KB3, KC3, KD3, K67, K63, K73, K83, \
|
||||
K02, K12, K22, K32, K42, K52, K36, KD6, KD7, K37, KA2, KB2, KC2, KD2, KE0, K62, K72, K82, K92, \
|
||||
K01, K30, K11, K21, K31, K41, K51, K46, KE6, KE7, K47, KA1, KB1, K86, K77, K61, K71, K81, \
|
||||
K00, K10, K20, K56, K57, KB0, KC0, K66, K76, K96, K60, K80, K90 \
|
||||
){ \
|
||||
{ K00, K10, K20, K30, KC_NO, KC_NO, K60, KC_NO, K80, K90, KC_NO, KB0, KC0, KD0, KE0 }, \
|
||||
{ K01, K11, K21, K31, K41, K51, K61, K71, K81, KC_NO, KA1, KB1, KC_NO, KD1, KE1 }, \
|
||||
{ K02, K12, K22, K32, K42, K52, K62, K72, K82, K92, KA2, KB2, KC2, KD2, KE2 }, \
|
||||
{ K03, K13, K23, K33, K43, K53, K63, K73, K83, KC_NO, KA3, KB3, KC3, KD3, KC_NO }, \
|
||||
{ K04, K14, K24, K34, K44, K54, K64, K74, K84, K94, KA4, KB4, KC4, KC_NO, KE4 }, \
|
||||
{ K05, KC_NO, K25, K35, K45, K55, K65, K75, K85, K95, KC_NO, KB5, KC5, KD5, KE5 }, \
|
||||
{ K06, K16, K26, K36, K46, K56, K66, K76, K86, K96, KA6, KB6, KC6, KD6, KE6 }, \
|
||||
{ K07, K17, K27, K37, K47, K57, K67, K77, KC_NO, KC_NO, KA7, KB7, KC7, KD7, KE7 } \
|
||||
}
|
||||
|
||||
#define LAYOUT_kc( \
|
||||
K05, K25, K35, K45, K55, K06, KA6, KA7, K07, KB5, KC5, KD5, KE5, KD1, KE1, KE2, K65, K75, K85, K95, \
|
||||
K04, K14, K24, K34, K44, K54, K16, KB6, KB7, K17, KA4, KB4, KC4, KE4, KD0, K64, K74, K84, K94, \
|
||||
K03, K13, K23, K33, K43, K53, K26, KC6, KC7, K27, KA3, KB3, KC3, KD3, K67, K63, K73, K83, \
|
||||
K02, K12, K22, K32, K42, K52, K36, KD6, KD7, K37, KA2, KB2, KC2, KD2, KE0, K62, K72, K82, K92, \
|
||||
K01, K30, K11, K21, K31, K41, K51, K46, KE6, KE7, K47, KA1, KB1, K86, K77, K61, K71, K81, \
|
||||
K00, K10, K20, K56, K57, KB0, KC0, K66, K76, K96, K60, K80, K90 \
|
||||
) \
|
||||
{ \
|
||||
{ KC_##K00, KC_##K10, KC_##K20, KC_##K30, KC_NO, KC_NO, KC_##K60, KC_NO, KC_##K80, KC_##K90, KC_NO, KC_##KB0, KC_##KC0, KC_##KD0, KC_##KE0 }, \
|
||||
{ KC_##K01, KC_##K11, KC_##K21, KC_##K31, KC_##K41, KC_##K51, KC_##K61, KC_##K71, KC_##K81, KC_NO, KC_##KA1, KC_##KB1, KC_NO, KC_##KD1, KC_##KE1 }, \
|
||||
{ KC_##K02, KC_##K12, KC_##K22, KC_##K32, KC_##K42, KC_##K52, KC_##K62, KC_##K72, KC_##K82, KC_##K92, KC_##KA2, KC_##KB2, KC_##KC2, KC_##KD2, KC_##KE2 }, \
|
||||
{ KC_##K03, KC_##K13, KC_##K23, KC_##K33, KC_##K43, KC_##K53, KC_##K63, KC_##K73, KC_##K83, KC_NO, KC_##KA3, KC_##KB3, KC_##KC3, KC_##KD3, KC_NO }, \
|
||||
{ KC_##K04, KC_##K14, KC_##K24, KC_##K34, KC_##K44, KC_##K54, KC_##K64, KC_##K74, KC_##K84, KC_##K94, KC_##KA4, KC_##KB4, KC_##KC4, KC_NO, KC_##KE4 }, \
|
||||
{ KC_##K05, KC_NO, KC_##K25, KC_##K35, KC_##K45, KC_##K55, KC_##K65, KC_##K75, KC_##K85, KC_##K95, KC_NO, KC_##KB5, KC_##KC5, KC_##KD5, KC_##KE5 }, \
|
||||
{ KC_##K06, KC_##K16, KC_##K26, KC_##K36, KC_##K46, KC_##K56, KC_##K66, KC_##K76, KC_##K86, KC_##K96, KC_##KA6, KC_##KB6, KC_##KC6, KC_##KD6, KC_##KE6 }, \
|
||||
{ KC_##K07, KC_##K17, KC_##K27, KC_##K37, KC_##K47, KC_##K57, KC_##K67, KC_##K77, KC_NO, KC_NO, KC_##KA7, KC_##KB7, KC_##KC7, KC_##KD7, KC_##KE7 } \
|
||||
}
|
||||
|
140
keyboards/bminiex/breathing_custom.h
Normal file
140
keyboards/bminiex/breathing_custom.h
Normal file
@@ -0,0 +1,140 @@
|
||||
/**
|
||||
* Breathing effect code for PS2AVRGB boards (ATMEGA32A)
|
||||
* Works in conjunction with `backlight.c`.
|
||||
*
|
||||
* Code adapted from `quantum.c` to register with the existing TIMER1 overflow
|
||||
* handler in `backlight.c` instead of setting up its own timer.
|
||||
* Kenneth A. (github.com/krusli | krusli.me)
|
||||
*/
|
||||
|
||||
#ifdef BACKLIGHT_ENABLE
|
||||
#ifdef BACKLIGHT_BREATHING
|
||||
|
||||
#include "backlight_custom.h"
|
||||
|
||||
#ifndef BREATHING_PERIOD
|
||||
#define BREATHING_PERIOD 6
|
||||
#endif
|
||||
|
||||
#define breathing_min() do {breathing_counter = 0;} while (0)
|
||||
#define breathing_max() do {breathing_counter = breathing_period * 244 / 2;} while (0)
|
||||
|
||||
// TODO make this share code with quantum.c
|
||||
|
||||
#define BREATHING_NO_HALT 0
|
||||
#define BREATHING_HALT_OFF 1
|
||||
#define BREATHING_HALT_ON 2
|
||||
#define BREATHING_STEPS 128
|
||||
|
||||
static uint8_t breathing_period = BREATHING_PERIOD;
|
||||
static uint8_t breathing_halt = BREATHING_NO_HALT;
|
||||
static uint16_t breathing_counter = 0;
|
||||
|
||||
static bool breathing = false;
|
||||
|
||||
bool is_breathing(void) {
|
||||
return breathing;
|
||||
}
|
||||
|
||||
// See http://jared.geek.nz/2013/feb/linear-led-pwm
|
||||
static uint16_t cie_lightness(uint16_t v) {
|
||||
if (v <= 5243) // if below 8% of max
|
||||
return v / 9; // same as dividing by 900%
|
||||
else {
|
||||
uint32_t y = (((uint32_t) v + 10486) << 8) / (10486 + 0xFFFFUL); // add 16% of max and compare
|
||||
// to get a useful result with integer division, we shift left in the expression above
|
||||
// and revert what we've done again after squaring.
|
||||
y = y * y * y >> 8;
|
||||
if (y > 0xFFFFUL) // prevent overflow
|
||||
return 0xFFFFU;
|
||||
else
|
||||
return (uint16_t) y;
|
||||
}
|
||||
}
|
||||
|
||||
void breathing_enable(void) {
|
||||
breathing = true;
|
||||
breathing_counter = 0;
|
||||
breathing_halt = BREATHING_NO_HALT;
|
||||
// interrupt already registered
|
||||
}
|
||||
|
||||
void breathing_pulse(void) {
|
||||
if (get_backlight_level() == 0)
|
||||
breathing_min();
|
||||
else
|
||||
breathing_max();
|
||||
breathing_halt = BREATHING_HALT_ON;
|
||||
// breathing_interrupt_enable();
|
||||
breathing = true;
|
||||
}
|
||||
|
||||
void breathing_disable(void) {
|
||||
breathing = false;
|
||||
// backlight_set(get_backlight_level());
|
||||
b_led_set(get_backlight_level()); // custom implementation of backlight_set()
|
||||
}
|
||||
|
||||
void breathing_self_disable(void)
|
||||
{
|
||||
if (get_backlight_level() == 0)
|
||||
breathing_halt = BREATHING_HALT_OFF;
|
||||
else
|
||||
breathing_halt = BREATHING_HALT_ON;
|
||||
}
|
||||
|
||||
void breathing_toggle(void) {
|
||||
if (is_breathing())
|
||||
breathing_disable();
|
||||
else
|
||||
breathing_enable();
|
||||
}
|
||||
|
||||
void breathing_period_set(uint8_t value)
|
||||
{
|
||||
if (!value)
|
||||
value = 1;
|
||||
breathing_period = value;
|
||||
}
|
||||
|
||||
void breathing_period_default(void) {
|
||||
breathing_period_set(BREATHING_PERIOD);
|
||||
}
|
||||
|
||||
void breathing_period_inc(void)
|
||||
{
|
||||
breathing_period_set(breathing_period+1);
|
||||
}
|
||||
|
||||
void breathing_period_dec(void)
|
||||
{
|
||||
breathing_period_set(breathing_period-1);
|
||||
}
|
||||
|
||||
/* To generate breathing curve in python:
|
||||
* from math import sin, pi; [int(sin(x/128.0*pi)**4*255) for x in range(128)]
|
||||
*/
|
||||
static const uint8_t breathing_table[BREATHING_STEPS] PROGMEM = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 3, 4, 5, 6, 8, 10, 12, 15, 17, 20, 24, 28, 32, 36, 41, 46, 51, 57, 63, 70, 76, 83, 91, 98, 106, 113, 121, 129, 138, 146, 154, 162, 170, 178, 185, 193, 200, 207, 213, 220, 225, 231, 235, 240, 244, 247, 250, 252, 253, 254, 255, 254, 253, 252, 250, 247, 244, 240, 235, 231, 225, 220, 213, 207, 200, 193, 185, 178, 170, 162, 154, 146, 138, 129, 121, 113, 106, 98, 91, 83, 76, 70, 63, 57, 51, 46, 41, 36, 32, 28, 24, 20, 17, 15, 12, 10, 8, 6, 5, 4, 3, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
|
||||
|
||||
// Use this before the cie_lightness function.
|
||||
static inline uint16_t scale_backlight(uint16_t v) {
|
||||
return v / BACKLIGHT_LEVELS * get_backlight_level();
|
||||
}
|
||||
|
||||
void custom_breathing_handler(void) {
|
||||
uint16_t interval = (uint16_t) breathing_period * 244 / BREATHING_STEPS;
|
||||
// resetting after one period to prevent ugly reset at overflow.
|
||||
breathing_counter = (breathing_counter + 1) % (breathing_period * 244);
|
||||
uint8_t index = breathing_counter / interval % BREATHING_STEPS;
|
||||
|
||||
if (((breathing_halt == BREATHING_HALT_ON) && (index == BREATHING_STEPS / 2)) ||
|
||||
((breathing_halt == BREATHING_HALT_OFF) && (index == BREATHING_STEPS - 1)))
|
||||
{
|
||||
// breathing_interrupt_disable();
|
||||
}
|
||||
|
||||
setPWM(cie_lightness(scale_backlight((uint16_t) pgm_read_byte(&breathing_table[index]) * 0x0101U)));
|
||||
}
|
||||
|
||||
#endif // BACKLIGHT_BREATHING
|
||||
#endif // BACKLIGHT_ENABLE
|
41
keyboards/bminiex/config.h
Normal file
41
keyboards/bminiex/config.h
Normal file
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "config_common.h"
|
||||
|
||||
#define VENDOR_ID 0x20A0
|
||||
#define PRODUCT_ID 0x422E
|
||||
#define MANUFACTURER winkeyless.kr
|
||||
#define PRODUCT B.mini Ex
|
||||
|
||||
#define RGBLED_NUM 20
|
||||
|
||||
/* matrix size */
|
||||
#define MATRIX_ROWS 8
|
||||
#define MATRIX_COLS 15
|
||||
|
||||
#define RGBLIGHT_ANIMATIONS
|
||||
|
||||
#define BACKLIGHT_LEVELS 5
|
||||
|
||||
#define NO_UART 1
|
||||
|
||||
/* key combination for command */
|
||||
#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)))
|
||||
|
106
keyboards/bminiex/i2c.c
Normal file
106
keyboards/bminiex/i2c.c
Normal file
@@ -0,0 +1,106 @@
|
||||
/*
|
||||
Copyright 2016 Luiz Ribeiro <luizribeiro@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
// Please do not modify this file
|
||||
|
||||
#include <avr/io.h>
|
||||
#include <util/twi.h>
|
||||
|
||||
#include "i2c.h"
|
||||
|
||||
void i2c_set_bitrate(uint16_t bitrate_khz) {
|
||||
uint8_t bitrate_div = ((F_CPU / 1000l) / bitrate_khz);
|
||||
if (bitrate_div >= 16) {
|
||||
bitrate_div = (bitrate_div - 16) / 2;
|
||||
}
|
||||
TWBR = bitrate_div;
|
||||
}
|
||||
|
||||
void i2c_init(void) {
|
||||
// set pull-up resistors on I2C bus pins
|
||||
PORTC |= 0b11;
|
||||
|
||||
i2c_set_bitrate(400);
|
||||
|
||||
// enable TWI (two-wire interface)
|
||||
TWCR |= (1 << TWEN);
|
||||
|
||||
// enable TWI interrupt and slave address ACK
|
||||
TWCR |= (1 << TWIE);
|
||||
TWCR |= (1 << TWEA);
|
||||
}
|
||||
|
||||
uint8_t i2c_start(uint8_t address) {
|
||||
// reset TWI control register
|
||||
TWCR = 0;
|
||||
|
||||
// begin transmission and wait for it to end
|
||||
TWCR = (1<<TWINT) | (1<<TWSTA) | (1<<TWEN);
|
||||
while (!(TWCR & (1<<TWINT)));
|
||||
|
||||
// check if the start condition was successfully transmitted
|
||||
if ((TWSR & 0xF8) != TW_START) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
// transmit address and wait
|
||||
TWDR = address;
|
||||
TWCR = (1<<TWINT) | (1<<TWEN);
|
||||
while (!(TWCR & (1<<TWINT)));
|
||||
|
||||
// check if the device has acknowledged the READ / WRITE mode
|
||||
uint8_t twst = TW_STATUS & 0xF8;
|
||||
if ((twst != TW_MT_SLA_ACK) && (twst != TW_MR_SLA_ACK)) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void i2c_stop(void) {
|
||||
TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWSTO);
|
||||
}
|
||||
|
||||
uint8_t i2c_write(uint8_t data) {
|
||||
TWDR = data;
|
||||
|
||||
// transmit data and wait
|
||||
TWCR = (1<<TWINT) | (1<<TWEN);
|
||||
while (!(TWCR & (1<<TWINT)));
|
||||
|
||||
if ((TWSR & 0xF8) != TW_MT_DATA_ACK) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint8_t i2c_send(uint8_t address, uint8_t *data, uint16_t length) {
|
||||
if (i2c_start(address)) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
for (uint16_t i = 0; i < length; i++) {
|
||||
if (i2c_write(data[i])) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
i2c_stop();
|
||||
|
||||
return 0;
|
||||
}
|
25
keyboards/bminiex/i2c.h
Normal file
25
keyboards/bminiex/i2c.h
Normal file
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
Copyright 2016 Luiz Ribeiro <luizribeiro@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
// Please do not modify this file
|
||||
|
||||
#pragma once
|
||||
|
||||
void i2c_init(void);
|
||||
void i2c_set_bitrate(uint16_t bitrate_khz);
|
||||
uint8_t i2c_send(uint8_t address, uint8_t *data, uint16_t length);
|
||||
|
29
keyboards/bminiex/keymaps/default/keymap.c
Normal file
29
keyboards/bminiex/keymaps/default/keymap.c
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[0] = LAYOUT(
|
||||
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR,KC_HOME,KC_END, KC_NO, KC_NO, KC_NO, KC_NO,
|
||||
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,KC_EQL, KC_BSPC, KC_DEL, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS,
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,KC_RBRC,KC_NO, KC_INS, KC_P7, KC_P8, KC_P9,
|
||||
KC_LCAP, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT,KC_NUHS,KC_ENT, KC_PGUP, KC_P4, KC_P5, KC_P6, KC_PPLS,
|
||||
KC_LSFT,KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,KC_RSFT, KC_UP, KC_PGDN, KC_P1, KC_P2, KC_P3,
|
||||
KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_APP ,KC_RCTL,KC_LEFT,KC_DOWN,KC_RGHT, KC_P0, KC_PDOT, KC_PENT
|
||||
)
|
||||
};
|
122
keyboards/bminiex/matrix.c
Normal file
122
keyboards/bminiex/matrix.c
Normal file
@@ -0,0 +1,122 @@
|
||||
/*
|
||||
Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <avr/io.h>
|
||||
#include <util/delay.h>
|
||||
|
||||
#include "matrix.h"
|
||||
#include "backlight.h"
|
||||
|
||||
#ifndef DEBOUNCE
|
||||
#define DEBOUNCE 5
|
||||
#endif
|
||||
|
||||
static uint8_t debouncing = DEBOUNCE;
|
||||
|
||||
static matrix_row_t matrix[MATRIX_ROWS];
|
||||
static matrix_row_t matrix_debouncing[MATRIX_ROWS];
|
||||
|
||||
__attribute__ ((weak))
|
||||
void matrix_init_user(void) {}
|
||||
__attribute__ ((weak))
|
||||
void matrix_scan_user(void) {}
|
||||
__attribute__ ((weak))
|
||||
void matrix_init_kb(void) {
|
||||
matrix_init_user();
|
||||
}
|
||||
__attribute__ ((weak))
|
||||
void matrix_scan_kb(void) {
|
||||
matrix_scan_user();
|
||||
}
|
||||
|
||||
void matrix_init(void) {
|
||||
// all outputs for rows high
|
||||
DDRB = 0xFF;
|
||||
PORTB = 0xFF;
|
||||
// all inputs for columns
|
||||
DDRA = 0x00;
|
||||
DDRC &= ~(0x111111<<2);
|
||||
DDRD &= ~(1<<PIND7);
|
||||
// all columns are pulled-up
|
||||
PORTA = 0xFF;
|
||||
PORTC |= (0b111111<<2);
|
||||
PORTD |= (1<<PIND7);
|
||||
|
||||
// initialize matrix state: all keys off
|
||||
for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
|
||||
matrix[row] = 0x00;
|
||||
matrix_debouncing[row] = 0x00;
|
||||
}
|
||||
|
||||
matrix_init_quantum();
|
||||
}
|
||||
|
||||
void matrix_set_row_status(uint8_t row) {
|
||||
DDRB = (1 << row);
|
||||
PORTB = ~(1 << row);
|
||||
}
|
||||
|
||||
uint8_t bit_reverse(uint8_t x) {
|
||||
x = ((x >> 1) & 0x55) | ((x << 1) & 0xaa);
|
||||
x = ((x >> 2) & 0x33) | ((x << 2) & 0xcc);
|
||||
x = ((x >> 4) & 0x0f) | ((x << 4) & 0xf0);
|
||||
return x;
|
||||
}
|
||||
|
||||
uint8_t matrix_scan(void) {
|
||||
for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
|
||||
matrix_set_row_status(row);
|
||||
_delay_us(5);
|
||||
|
||||
matrix_row_t cols = (
|
||||
// cols 0..7, PORTA 0 -> 7
|
||||
(~PINA) & 0xFF
|
||||
) | (
|
||||
// cols 8..13, PORTC 7 -> 0
|
||||
bit_reverse((~PINC) & 0xFF) << 8
|
||||
) | (
|
||||
// col 14, PORTD 7
|
||||
((~PIND) & (1 << PIND7)) << 7
|
||||
);
|
||||
|
||||
if (matrix_debouncing[row] != cols) {
|
||||
matrix_debouncing[row] = cols;
|
||||
debouncing = DEBOUNCE;
|
||||
}
|
||||
}
|
||||
|
||||
if (debouncing) {
|
||||
if (--debouncing) {
|
||||
_delay_ms(1);
|
||||
} else {
|
||||
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
|
||||
matrix[i] = matrix_debouncing[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
matrix_scan_quantum();
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
inline matrix_row_t matrix_get_row(uint8_t row) {
|
||||
return matrix[row];
|
||||
}
|
||||
|
||||
void matrix_print(void) {
|
||||
}
|
14
keyboards/bminiex/readme.md
Normal file
14
keyboards/bminiex/readme.md
Normal file
@@ -0,0 +1,14 @@
|
||||
B.mini EX
|
||||
=========
|
||||
|
||||
A compact fullsize keyboard with RGB
|
||||
|
||||
Keyboard Maintainer: QMK Community
|
||||
Hardware Supported: B.mini EX PCB
|
||||
Hardware Availability: https://winkeyless.kr/product/b-mini-ex-x2-pcb/
|
||||
|
||||
Make example for this keyboard (after setting up your build environment):
|
||||
|
||||
make bminiex:default
|
||||
|
||||
See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
|
56
keyboards/bminiex/rules.mk
Normal file
56
keyboards/bminiex/rules.mk
Normal file
@@ -0,0 +1,56 @@
|
||||
# Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# MCU name
|
||||
MCU = atmega32a
|
||||
PROTOCOL = VUSB
|
||||
|
||||
# unsupported features for now
|
||||
NO_UART = yes
|
||||
NO_SUSPEND_POWER_DOWN = yes
|
||||
|
||||
# processor frequency
|
||||
F_CPU = 12000000
|
||||
|
||||
# Bootloader
|
||||
# This definition is optional, and if your keyboard supports multiple bootloaders of
|
||||
# different sizes, comment this out, and the correct address will be loaded
|
||||
# automatically (+60). See bootloader.mk for all options.
|
||||
BOOTLOADER = bootloadHID
|
||||
|
||||
# build options
|
||||
BOOTMAGIC_ENABLE = yes
|
||||
MOUSEKEY_ENABLE = yes
|
||||
EXTRAKEY_ENABLE = yes
|
||||
CONSOLE_ENABLE = no
|
||||
DEBUG_ENABLE = no
|
||||
COMMAND_ENABLE = no
|
||||
BACKLIGHT_ENABLE = yes
|
||||
BACKLIGHT_CUSTOM_DRIVER = yes
|
||||
RGBLIGHT_ENABLE = yes
|
||||
RGBLIGHT_CUSTOM_DRIVER = yes
|
||||
TAP_DANCE_ENABLE = no
|
||||
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||
|
||||
OPT_DEFS = -DDEBUG_LEVEL=0
|
||||
|
||||
# custom matrix setup
|
||||
CUSTOM_MATRIX = yes
|
||||
SRC = matrix.c i2c.c backlight.c
|
||||
|
||||
# programming options
|
||||
PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex
|
396
keyboards/bminiex/usbconfig.h
Normal file
396
keyboards/bminiex/usbconfig.h
Normal file
@@ -0,0 +1,396 @@
|
||||
/* Name: usbconfig.h
|
||||
* Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers
|
||||
* Author: Christian Starkjohann
|
||||
* Creation Date: 2005-04-01
|
||||
* Tabsize: 4
|
||||
* Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH
|
||||
* License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt)
|
||||
* This Revision: $Id: usbconfig-prototype.h 785 2010-05-30 17:57:07Z cs $
|
||||
*/
|
||||
|
||||
#ifndef __usbconfig_h_included__
|
||||
#define __usbconfig_h_included__
|
||||
|
||||
#include "config.h"
|
||||
|
||||
/*
|
||||
General Description:
|
||||
This file is an example configuration (with inline documentation) for the USB
|
||||
driver. It configures V-USB for USB D+ connected to Port D bit 2 (which is
|
||||
also hardware interrupt 0 on many devices) and USB D- to Port D bit 4. You may
|
||||
wire the lines to any other port, as long as D+ is also wired to INT0 (or any
|
||||
other hardware interrupt, as long as it is the highest level interrupt, see
|
||||
section at the end of this file).
|
||||
*/
|
||||
|
||||
/* ---------------------------- Hardware Config ---------------------------- */
|
||||
|
||||
#define USB_CFG_IOPORTNAME D
|
||||
/* This is the port where the USB bus is connected. When you configure it to
|
||||
* "B", the registers PORTB, PINB and DDRB will be used.
|
||||
*/
|
||||
#define USB_CFG_DMINUS_BIT 3
|
||||
/* This is the bit number in USB_CFG_IOPORT where the USB D- line is connected.
|
||||
* This may be any bit in the port.
|
||||
*/
|
||||
#define USB_CFG_DPLUS_BIT 2
|
||||
/* This is the bit number in USB_CFG_IOPORT where the USB D+ line is connected.
|
||||
* This may be any bit in the port. Please note that D+ must also be connected
|
||||
* to interrupt pin INT0! [You can also use other interrupts, see section
|
||||
* "Optional MCU Description" below, or you can connect D- to the interrupt, as
|
||||
* it is required if you use the USB_COUNT_SOF feature. If you use D- for the
|
||||
* interrupt, the USB interrupt will also be triggered at Start-Of-Frame
|
||||
* markers every millisecond.]
|
||||
*/
|
||||
#define USB_CFG_CLOCK_KHZ (F_CPU/1000)
|
||||
/* Clock rate of the AVR in kHz. Legal values are 12000, 12800, 15000, 16000,
|
||||
* 16500, 18000 and 20000. The 12.8 MHz and 16.5 MHz versions of the code
|
||||
* require no crystal, they tolerate +/- 1% deviation from the nominal
|
||||
* frequency. All other rates require a precision of 2000 ppm and thus a
|
||||
* crystal!
|
||||
* Since F_CPU should be defined to your actual clock rate anyway, you should
|
||||
* not need to modify this setting.
|
||||
*/
|
||||
#define USB_CFG_CHECK_CRC 0
|
||||
/* Define this to 1 if you want that the driver checks integrity of incoming
|
||||
* data packets (CRC checks). CRC checks cost quite a bit of code size and are
|
||||
* currently only available for 18 MHz crystal clock. You must choose
|
||||
* USB_CFG_CLOCK_KHZ = 18000 if you enable this option.
|
||||
*/
|
||||
|
||||
/* ----------------------- Optional Hardware Config ------------------------ */
|
||||
|
||||
/* #define USB_CFG_PULLUP_IOPORTNAME D */
|
||||
/* If you connect the 1.5k pullup resistor from D- to a port pin instead of
|
||||
* V+, you can connect and disconnect the device from firmware by calling
|
||||
* the macros usbDeviceConnect() and usbDeviceDisconnect() (see usbdrv.h).
|
||||
* This constant defines the port on which the pullup resistor is connected.
|
||||
*/
|
||||
/* #define USB_CFG_PULLUP_BIT 4 */
|
||||
/* This constant defines the bit number in USB_CFG_PULLUP_IOPORT (defined
|
||||
* above) where the 1.5k pullup resistor is connected. See description
|
||||
* above for details.
|
||||
*/
|
||||
|
||||
/* --------------------------- Functional Range ---------------------------- */
|
||||
|
||||
#define USB_CFG_HAVE_INTRIN_ENDPOINT 1
|
||||
/* Define this to 1 if you want to compile a version with two endpoints: The
|
||||
* default control endpoint 0 and an interrupt-in endpoint (any other endpoint
|
||||
* number).
|
||||
*/
|
||||
#define USB_CFG_HAVE_INTRIN_ENDPOINT3 1
|
||||
/* Define this to 1 if you want to compile a version with three endpoints: The
|
||||
* default control endpoint 0, an interrupt-in endpoint 3 (or the number
|
||||
* configured below) and a catch-all default interrupt-in endpoint as above.
|
||||
* You must also define USB_CFG_HAVE_INTRIN_ENDPOINT to 1 for this feature.
|
||||
*/
|
||||
#define USB_CFG_EP3_NUMBER 3
|
||||
/* If the so-called endpoint 3 is used, it can now be configured to any other
|
||||
* endpoint number (except 0) with this macro. Default if undefined is 3.
|
||||
*/
|
||||
/* #define USB_INITIAL_DATATOKEN USBPID_DATA1 */
|
||||
/* The above macro defines the startup condition for data toggling on the
|
||||
* interrupt/bulk endpoints 1 and 3. Defaults to USBPID_DATA1.
|
||||
* Since the token is toggled BEFORE sending any data, the first packet is
|
||||
* sent with the oposite value of this configuration!
|
||||
*/
|
||||
#define USB_CFG_IMPLEMENT_HALT 0
|
||||
/* Define this to 1 if you also want to implement the ENDPOINT_HALT feature
|
||||
* for endpoint 1 (interrupt endpoint). Although you may not need this feature,
|
||||
* it is required by the standard. We have made it a config option because it
|
||||
* bloats the code considerably.
|
||||
*/
|
||||
#define USB_CFG_SUPPRESS_INTR_CODE 0
|
||||
/* Define this to 1 if you want to declare interrupt-in endpoints, but don't
|
||||
* want to send any data over them. If this macro is defined to 1, functions
|
||||
* usbSetInterrupt() and usbSetInterrupt3() are omitted. This is useful if
|
||||
* you need the interrupt-in endpoints in order to comply to an interface
|
||||
* (e.g. HID), but never want to send any data. This option saves a couple
|
||||
* of bytes in flash memory and the transmit buffers in RAM.
|
||||
*/
|
||||
#define USB_CFG_INTR_POLL_INTERVAL 1
|
||||
/* If you compile a version with endpoint 1 (interrupt-in), this is the poll
|
||||
* interval. The value is in milliseconds and must not be less than 10 ms for
|
||||
* low speed devices.
|
||||
*/
|
||||
#define USB_CFG_IS_SELF_POWERED 0
|
||||
/* Define this to 1 if the device has its own power supply. Set it to 0 if the
|
||||
* device is powered from the USB bus.
|
||||
*/
|
||||
#define USB_CFG_MAX_BUS_POWER 500
|
||||
/* Set this variable to the maximum USB bus power consumption of your device.
|
||||
* The value is in milliamperes. [It will be divided by two since USB
|
||||
* communicates power requirements in units of 2 mA.]
|
||||
*/
|
||||
#define USB_CFG_IMPLEMENT_FN_WRITE 1
|
||||
/* Set this to 1 if you want usbFunctionWrite() to be called for control-out
|
||||
* transfers. Set it to 0 if you don't need it and want to save a couple of
|
||||
* bytes.
|
||||
*/
|
||||
#define USB_CFG_IMPLEMENT_FN_READ 0
|
||||
/* Set this to 1 if you need to send control replies which are generated
|
||||
* "on the fly" when usbFunctionRead() is called. If you only want to send
|
||||
* data from a static buffer, set it to 0 and return the data from
|
||||
* usbFunctionSetup(). This saves a couple of bytes.
|
||||
*/
|
||||
#define USB_CFG_IMPLEMENT_FN_WRITEOUT 0
|
||||
/* Define this to 1 if you want to use interrupt-out (or bulk out) endpoints.
|
||||
* You must implement the function usbFunctionWriteOut() which receives all
|
||||
* interrupt/bulk data sent to any endpoint other than 0. The endpoint number
|
||||
* can be found in 'usbRxToken'.
|
||||
*/
|
||||
#define USB_CFG_HAVE_FLOWCONTROL 0
|
||||
/* Define this to 1 if you want flowcontrol over USB data. See the definition
|
||||
* of the macros usbDisableAllRequests() and usbEnableAllRequests() in
|
||||
* usbdrv.h.
|
||||
*/
|
||||
#define USB_CFG_DRIVER_FLASH_PAGE 0
|
||||
/* If the device has more than 64 kBytes of flash, define this to the 64 k page
|
||||
* where the driver's constants (descriptors) are located. Or in other words:
|
||||
* Define this to 1 for boot loaders on the ATMega128.
|
||||
*/
|
||||
#define USB_CFG_LONG_TRANSFERS 0
|
||||
/* Define this to 1 if you want to send/receive blocks of more than 254 bytes
|
||||
* in a single control-in or control-out transfer. Note that the capability
|
||||
* for long transfers increases the driver size.
|
||||
*/
|
||||
/* #define USB_RX_USER_HOOK(data, len) if(usbRxToken == (uchar)USBPID_SETUP) blinkLED(); */
|
||||
/* This macro is a hook if you want to do unconventional things. If it is
|
||||
* defined, it's inserted at the beginning of received message processing.
|
||||
* If you eat the received message and don't want default processing to
|
||||
* proceed, do a return after doing your things. One possible application
|
||||
* (besides debugging) is to flash a status LED on each packet.
|
||||
*/
|
||||
/* #define USB_RESET_HOOK(resetStarts) if(!resetStarts){hadUsbReset();} */
|
||||
/* This macro is a hook if you need to know when an USB RESET occurs. It has
|
||||
* one parameter which distinguishes between the start of RESET state and its
|
||||
* end.
|
||||
*/
|
||||
/* #define USB_SET_ADDRESS_HOOK() hadAddressAssigned(); */
|
||||
/* This macro (if defined) is executed when a USB SET_ADDRESS request was
|
||||
* received.
|
||||
*/
|
||||
#define USB_COUNT_SOF 1
|
||||
/* define this macro to 1 if you need the global variable "usbSofCount" which
|
||||
* counts SOF packets. This feature requires that the hardware interrupt is
|
||||
* connected to D- instead of D+.
|
||||
*/
|
||||
/* #ifdef __ASSEMBLER__
|
||||
* macro myAssemblerMacro
|
||||
* in YL, TCNT0
|
||||
* sts timer0Snapshot, YL
|
||||
* endm
|
||||
* #endif
|
||||
* #define USB_SOF_HOOK myAssemblerMacro
|
||||
* This macro (if defined) is executed in the assembler module when a
|
||||
* Start Of Frame condition is detected. It is recommended to define it to
|
||||
* the name of an assembler macro which is defined here as well so that more
|
||||
* than one assembler instruction can be used. The macro may use the register
|
||||
* YL and modify SREG. If it lasts longer than a couple of cycles, USB messages
|
||||
* immediately after an SOF pulse may be lost and must be retried by the host.
|
||||
* What can you do with this hook? Since the SOF signal occurs exactly every
|
||||
* 1 ms (unless the host is in sleep mode), you can use it to tune OSCCAL in
|
||||
* designs running on the internal RC oscillator.
|
||||
* Please note that Start Of Frame detection works only if D- is wired to the
|
||||
* interrupt, not D+. THIS IS DIFFERENT THAN MOST EXAMPLES!
|
||||
*/
|
||||
#define USB_CFG_CHECK_DATA_TOGGLING 0
|
||||
/* define this macro to 1 if you want to filter out duplicate data packets
|
||||
* sent by the host. Duplicates occur only as a consequence of communication
|
||||
* errors, when the host does not receive an ACK. Please note that you need to
|
||||
* implement the filtering yourself in usbFunctionWriteOut() and
|
||||
* usbFunctionWrite(). Use the global usbCurrentDataToken and a static variable
|
||||
* for each control- and out-endpoint to check for duplicate packets.
|
||||
*/
|
||||
#define USB_CFG_HAVE_MEASURE_FRAME_LENGTH 0
|
||||
/* define this macro to 1 if you want the function usbMeasureFrameLength()
|
||||
* compiled in. This function can be used to calibrate the AVR's RC oscillator.
|
||||
*/
|
||||
#define USB_USE_FAST_CRC 0
|
||||
/* The assembler module has two implementations for the CRC algorithm. One is
|
||||
* faster, the other is smaller. This CRC routine is only used for transmitted
|
||||
* messages where timing is not critical. The faster routine needs 31 cycles
|
||||
* per byte while the smaller one needs 61 to 69 cycles. The faster routine
|
||||
* may be worth the 32 bytes bigger code size if you transmit lots of data and
|
||||
* run the AVR close to its limit.
|
||||
*/
|
||||
|
||||
/* -------------------------- Device Description --------------------------- */
|
||||
|
||||
#define USB_CFG_VENDOR_ID (VENDOR_ID & 0xFF), ((VENDOR_ID >> 8) & 0xFF)
|
||||
/* USB vendor ID for the device, low byte first. If you have registered your
|
||||
* own Vendor ID, define it here. Otherwise you may use one of obdev's free
|
||||
* shared VID/PID pairs. Be sure to read USB-IDs-for-free.txt for rules!
|
||||
* *** IMPORTANT NOTE ***
|
||||
* This template uses obdev's shared VID/PID pair for Vendor Class devices
|
||||
* with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand
|
||||
* the implications!
|
||||
*/
|
||||
#define USB_CFG_DEVICE_ID (PRODUCT_ID & 0xFF), ((PRODUCT_ID >> 8) & 0xFF)
|
||||
/* This is the ID of the product, low byte first. It is interpreted in the
|
||||
* scope of the vendor ID. If you have registered your own VID with usb.org
|
||||
* or if you have licensed a PID from somebody else, define it here. Otherwise
|
||||
* you may use one of obdev's free shared VID/PID pairs. See the file
|
||||
* USB-IDs-for-free.txt for details!
|
||||
* *** IMPORTANT NOTE ***
|
||||
* This template uses obdev's shared VID/PID pair for Vendor Class devices
|
||||
* with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand
|
||||
* the implications!
|
||||
*/
|
||||
#define USB_CFG_DEVICE_VERSION 0x00, 0x02
|
||||
/* Version number of the device: Minor number first, then major number.
|
||||
*/
|
||||
#define USB_CFG_VENDOR_NAME 'w', 'i', 'n', 'k', 'e', 'y', 'l', 'e', 's', 's', '.', 'k', 'r'
|
||||
#define USB_CFG_VENDOR_NAME_LEN 13
|
||||
/* These two values define the vendor name returned by the USB device. The name
|
||||
* must be given as a list of characters under single quotes. The characters
|
||||
* are interpreted as Unicode (UTF-16) entities.
|
||||
* If you don't want a vendor name string, undefine these macros.
|
||||
* ALWAYS define a vendor name containing your Internet domain name if you use
|
||||
* obdev's free shared VID/PID pair. See the file USB-IDs-for-free.txt for
|
||||
* details.
|
||||
*/
|
||||
#define USB_CFG_DEVICE_NAME 'p', 's', '2', 'a', 'v', 'r', 'G', 'B'
|
||||
#define USB_CFG_DEVICE_NAME_LEN 8
|
||||
/* Same as above for the device name. If you don't want a device name, undefine
|
||||
* the macros. See the file USB-IDs-for-free.txt before you assign a name if
|
||||
* you use a shared VID/PID.
|
||||
*/
|
||||
/*#define USB_CFG_SERIAL_NUMBER 'N', 'o', 'n', 'e' */
|
||||
/*#define USB_CFG_SERIAL_NUMBER_LEN 0 */
|
||||
/* Same as above for the serial number. If you don't want a serial number,
|
||||
* undefine the macros.
|
||||
* It may be useful to provide the serial number through other means than at
|
||||
* compile time. See the section about descriptor properties below for how
|
||||
* to fine tune control over USB descriptors such as the string descriptor
|
||||
* for the serial number.
|
||||
*/
|
||||
#define USB_CFG_DEVICE_CLASS 0
|
||||
#define USB_CFG_DEVICE_SUBCLASS 0
|
||||
/* See USB specification if you want to conform to an existing device class.
|
||||
* Class 0xff is "vendor specific".
|
||||
*/
|
||||
#define USB_CFG_INTERFACE_CLASS 3 /* HID */
|
||||
#define USB_CFG_INTERFACE_SUBCLASS 1 /* Boot */
|
||||
#define USB_CFG_INTERFACE_PROTOCOL 1 /* Keyboard */
|
||||
/* See USB specification if you want to conform to an existing device class or
|
||||
* protocol. The following classes must be set at interface level:
|
||||
* HID class is 3, no subclass and protocol required (but may be useful!)
|
||||
* CDC class is 2, use subclass 2 and protocol 1 for ACM
|
||||
*/
|
||||
#define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH 0
|
||||
/* Define this to the length of the HID report descriptor, if you implement
|
||||
* an HID device. Otherwise don't define it or define it to 0.
|
||||
* If you use this define, you must add a PROGMEM character array named
|
||||
* "usbHidReportDescriptor" to your code which contains the report descriptor.
|
||||
* Don't forget to keep the array and this define in sync!
|
||||
*/
|
||||
|
||||
/* #define USB_PUBLIC static */
|
||||
/* Use the define above if you #include usbdrv.c instead of linking against it.
|
||||
* This technique saves a couple of bytes in flash memory.
|
||||
*/
|
||||
|
||||
/* ------------------- Fine Control over USB Descriptors ------------------- */
|
||||
/* If you don't want to use the driver's default USB descriptors, you can
|
||||
* provide our own. These can be provided as (1) fixed length static data in
|
||||
* flash memory, (2) fixed length static data in RAM or (3) dynamically at
|
||||
* runtime in the function usbFunctionDescriptor(). See usbdrv.h for more
|
||||
* information about this function.
|
||||
* Descriptor handling is configured through the descriptor's properties. If
|
||||
* no properties are defined or if they are 0, the default descriptor is used.
|
||||
* Possible properties are:
|
||||
* + USB_PROP_IS_DYNAMIC: The data for the descriptor should be fetched
|
||||
* at runtime via usbFunctionDescriptor(). If the usbMsgPtr mechanism is
|
||||
* used, the data is in FLASH by default. Add property USB_PROP_IS_RAM if
|
||||
* you want RAM pointers.
|
||||
* + USB_PROP_IS_RAM: The data returned by usbFunctionDescriptor() or found
|
||||
* in static memory is in RAM, not in flash memory.
|
||||
* + USB_PROP_LENGTH(len): If the data is in static memory (RAM or flash),
|
||||
* the driver must know the descriptor's length. The descriptor itself is
|
||||
* found at the address of a well known identifier (see below).
|
||||
* List of static descriptor names (must be declared PROGMEM if in flash):
|
||||
* char usbDescriptorDevice[];
|
||||
* char usbDescriptorConfiguration[];
|
||||
* char usbDescriptorHidReport[];
|
||||
* char usbDescriptorString0[];
|
||||
* int usbDescriptorStringVendor[];
|
||||
* int usbDescriptorStringDevice[];
|
||||
* int usbDescriptorStringSerialNumber[];
|
||||
* Other descriptors can't be provided statically, they must be provided
|
||||
* dynamically at runtime.
|
||||
*
|
||||
* Descriptor properties are or-ed or added together, e.g.:
|
||||
* #define USB_CFG_DESCR_PROPS_DEVICE (USB_PROP_IS_RAM | USB_PROP_LENGTH(18))
|
||||
*
|
||||
* The following descriptors are defined:
|
||||
* USB_CFG_DESCR_PROPS_DEVICE
|
||||
* USB_CFG_DESCR_PROPS_CONFIGURATION
|
||||
* USB_CFG_DESCR_PROPS_STRINGS
|
||||
* USB_CFG_DESCR_PROPS_STRING_0
|
||||
* USB_CFG_DESCR_PROPS_STRING_VENDOR
|
||||
* USB_CFG_DESCR_PROPS_STRING_PRODUCT
|
||||
* USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER
|
||||
* USB_CFG_DESCR_PROPS_HID
|
||||
* USB_CFG_DESCR_PROPS_HID_REPORT
|
||||
* USB_CFG_DESCR_PROPS_UNKNOWN (for all descriptors not handled by the driver)
|
||||
*
|
||||
* Note about string descriptors: String descriptors are not just strings, they
|
||||
* are Unicode strings prefixed with a 2 byte header. Example:
|
||||
* int serialNumberDescriptor[] = {
|
||||
* USB_STRING_DESCRIPTOR_HEADER(6),
|
||||
* 'S', 'e', 'r', 'i', 'a', 'l'
|
||||
* };
|
||||
*/
|
||||
|
||||
#define USB_CFG_DESCR_PROPS_DEVICE 0
|
||||
#define USB_CFG_DESCR_PROPS_CONFIGURATION USB_PROP_IS_DYNAMIC
|
||||
//#define USB_CFG_DESCR_PROPS_CONFIGURATION 0
|
||||
#define USB_CFG_DESCR_PROPS_STRINGS 0
|
||||
#define USB_CFG_DESCR_PROPS_STRING_0 0
|
||||
#define USB_CFG_DESCR_PROPS_STRING_VENDOR 0
|
||||
#define USB_CFG_DESCR_PROPS_STRING_PRODUCT 0
|
||||
#define USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER 0
|
||||
#define USB_CFG_DESCR_PROPS_HID USB_PROP_IS_DYNAMIC
|
||||
//#define USB_CFG_DESCR_PROPS_HID 0
|
||||
#define USB_CFG_DESCR_PROPS_HID_REPORT USB_PROP_IS_DYNAMIC
|
||||
//#define USB_CFG_DESCR_PROPS_HID_REPORT 0
|
||||
#define USB_CFG_DESCR_PROPS_UNKNOWN 0
|
||||
|
||||
#define usbMsgPtr_t unsigned short
|
||||
/* If usbMsgPtr_t is not defined, it defaults to 'uchar *'. We define it to
|
||||
* a scalar type here because gcc generates slightly shorter code for scalar
|
||||
* arithmetics than for pointer arithmetics. Remove this define for backward
|
||||
* type compatibility or define it to an 8 bit type if you use data in RAM only
|
||||
* and all RAM is below 256 bytes (tiny memory model in IAR CC).
|
||||
*/
|
||||
|
||||
/* ----------------------- Optional MCU Description ------------------------ */
|
||||
|
||||
/* The following configurations have working defaults in usbdrv.h. You
|
||||
* usually don't need to set them explicitly. Only if you want to run
|
||||
* the driver on a device which is not yet supported or with a compiler
|
||||
* which is not fully supported (such as IAR C) or if you use a differnt
|
||||
* interrupt than INT0, you may have to define some of these.
|
||||
*/
|
||||
/* #define USB_INTR_CFG MCUCR */
|
||||
/* #define USB_INTR_CFG_SET ((1 << ISC00) | (1 << ISC01)) */
|
||||
/* #define USB_INTR_CFG_CLR 0 */
|
||||
/* #define USB_INTR_ENABLE GIMSK */
|
||||
/* #define USB_INTR_ENABLE_BIT INT0 */
|
||||
/* #define USB_INTR_PENDING GIFR */
|
||||
/* #define USB_INTR_PENDING_BIT INTF0 */
|
||||
/* #define USB_INTR_VECTOR INT0_vect */
|
||||
|
||||
/* Set INT1 for D- falling edge to count SOF */
|
||||
/* #define USB_INTR_CFG EICRA */
|
||||
#define USB_INTR_CFG_SET ((1 << ISC11) | (0 << ISC10))
|
||||
/* #define USB_INTR_CFG_CLR 0 */
|
||||
/* #define USB_INTR_ENABLE EIMSK */
|
||||
#define USB_INTR_ENABLE_BIT INT1
|
||||
/* #define USB_INTR_PENDING EIFR */
|
||||
#define USB_INTR_PENDING_BIT INTF1
|
||||
#define USB_INTR_VECTOR INT1_vect
|
||||
|
||||
#endif /* __usbconfig_h_included__ */
|
@@ -13,5 +13,5 @@ MIDI_ENABLE = no # MIDI controls
|
||||
AUDIO_ENABLE = no # Audio output on port C6
|
||||
UNICODE_ENABLE = no # Unicode
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
|
||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||
|
@@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls
|
||||
AUDIO_ENABLE = no # Audio output on port C6
|
||||
UNICODE_ENABLE = no # Unicode
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
|
||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
|
@@ -14,7 +14,7 @@ AUDIO_ENABLE = no # Audio output on port C6
|
||||
UNICODE_ENABLE = no # Unicode
|
||||
UNICODEMAP_ENABLE = yes # unicodemap
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
|
||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||
TAP_DANCE_ENABLE = yes
|
||||
LEADER_ENABLE = yes
|
||||
|
@@ -13,5 +13,5 @@ MIDI_ENABLE = no # MIDI controls
|
||||
AUDIO_ENABLE = no # Audio output on port C6
|
||||
UNICODE_ENABLE = no # Unicode
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
|
||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||
|
@@ -14,7 +14,7 @@ MIDI_ENABLE = no # MIDI controls
|
||||
AUDIO_ENABLE = no # Audio output on port C6
|
||||
UNICODE_ENABLE = no # Unicode
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
|
||||
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
|
@@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls
|
||||
AUDIO_ENABLE = no # Audio output on port C6
|
||||
UNICODE_ENABLE = no # Unicode
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
|
||||
TAP_DANCE_ENABLE = yes # see https://docs.qmk.fm/#/feature_tap_dance (+1000)
|
||||
|
||||
|
||||
|
@@ -14,7 +14,7 @@ MIDI_ENABLE = no # MIDI controls
|
||||
AUDIO_ENABLE = no # Audio output on port C6
|
||||
UNICODE_ENABLE = no # Unicode
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
|
||||
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
|
@@ -60,7 +60,7 @@ MIDI_ENABLE = no # MIDI controls
|
||||
AUDIO_ENABLE = no # Audio output on port C6
|
||||
UNICODE_ENABLE = no # Unicode
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
|
||||
|
||||
|
||||
CUSTOM_MATRIX = yes
|
||||
|
@@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls
|
||||
AUDIO_ENABLE = no # Audio output on port C6
|
||||
UNICODE_ENABLE = no # Unicode
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
|
||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
|
@@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls
|
||||
AUDIO_ENABLE = no # Audio output on port C6
|
||||
UNICODE_ENABLE = no # Unicode
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
|
||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
|
@@ -39,7 +39,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define DIODE_DIRECTION COL2ROW
|
||||
|
||||
/* Set 0 if debouncing isn't needed */
|
||||
#define DEBOUNCING_DELAY 50
|
||||
// #define DEBOUNCING_DELAY 0
|
||||
|
||||
/* key combination for command */
|
||||
#define IS_COMMAND() ( \
|
||||
|
@@ -50,32 +50,30 @@
|
||||
// The first section contains all of the arguements
|
||||
// The second converts the arguments into a two-dimensional array
|
||||
|
||||
#define KC_KEYMAP( \
|
||||
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k10, k11, \
|
||||
k12, k13, k14, k15, k16, k17, k18, k19, k20, k21, k22, k23, \
|
||||
k24, k25, k26, k27, k28, k29, k30, k31, k32, k33, k34, k35, \
|
||||
k36, k37, k38, k39, k40, k41, k42, k43, k44, k45, k46, k47 \
|
||||
) \
|
||||
{ \
|
||||
{ KC_##k43, KC_##k45, KC_##k34, KC_##k11, KC_##k23, KC_##k40, KC_##k38, KC_##k25, KC_##k00, KC_##k12 }, \
|
||||
{ KC_##k31, KC_##k44, KC_##k46, KC_##k35, KC_##k22, KC_##k28, KC_##k39, KC_##k37, KC_##k24, KC_##k13 }, \
|
||||
{ KC_##k30, KC_##k32, KC_##k33, KC_##k47, KC_##k09, KC_##k29, KC_##k27, KC_##k26, KC_##k36, KC_##k02 }, \
|
||||
{ KC_##k19, KC_##k20, KC_##k21, KC_##k42, KC_##k18, KC_##k16, KC_##k15, KC_##k14, KC_##k41, KC_##k17 }, \
|
||||
{ KC_##k06, KC_##k07, KC_##k08, KC_##k10, KC_NO, KC_##k05, KC_##k04, KC_##k03, KC_##k01, KC_NO }, \
|
||||
#define LAYOUT_ortho_4x12( \
|
||||
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k10, k11, \
|
||||
k12, k13, k14, k15, k16, k17, k18, k19, k20, k21, k22, k23, \
|
||||
k24, k25, k26, k27, k28, k29, k30, k31, k32, k33, k34, k35, \
|
||||
k36, k37, k38, k39, k40, k41, k42, k43, k44, k45, k46, k47 \
|
||||
) { \
|
||||
{ k43, k45, k34, k11, k23, k40, k38, k25, k00, k12 }, \
|
||||
{ k31, k44, k46, k35, k22, k28, k39, k37, k24, k13 }, \
|
||||
{ k30, k32, k33, k47, k09, k29, k27, k26, k36, k02 }, \
|
||||
{ k19, k20, k21, k42, k18, k16, k15, k14, k41, k17 }, \
|
||||
{ k06, k07, k08, k10, KC_NO, k05, k04, k03, k01, KC_NO } \
|
||||
}
|
||||
|
||||
#define KEYMAP( \
|
||||
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k10, k11, \
|
||||
k12, k13, k14, k15, k16, k17, k18, k19, k20, k21, k22, k23, \
|
||||
k24, k25, k26, k27, k28, k29, k30, k31, k32, k33, k34, k35, \
|
||||
k36, k37, k38, k39, k40, k41, k42, k43, k44, k45, k46, k47 \
|
||||
) \
|
||||
{ \
|
||||
{ k43, k45, k34, k11, k23, k40, k38, k25, k00, k12 }, \
|
||||
{ k31, k44, k46, k35, k22, k28, k39, k37, k24, k13 }, \
|
||||
{ k30, k32, k33, k47, k09, k29, k27, k26, k36, k02 }, \
|
||||
{ k19, k20, k21, k42, k18, k16, k15, k14, k41, k17 }, \
|
||||
{ k06, k07, k08, k10, KC_NO, k05, k04, k03, k01, KC_NO }, \
|
||||
#define LAYOUT_kc_ortho_4x12( \
|
||||
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k10, k11, \
|
||||
k12, k13, k14, k15, k16, k17, k18, k19, k20, k21, k22, k23, \
|
||||
k24, k25, k26, k27, k28, k29, k30, k31, k32, k33, k34, k35, \
|
||||
k36, k37, k38, k39, k40, k41, k42, k43, k44, k45, k46, k47 \
|
||||
) { \
|
||||
{ KC_##k43, KC_##k45, KC_##k34, KC_##k11, KC_##k23, KC_##k40, KC_##k38, KC_##k25, KC_##k00, KC_##k12 }, \
|
||||
{ KC_##k31, KC_##k44, KC_##k46, KC_##k35, KC_##k22, KC_##k28, KC_##k39, KC_##k37, KC_##k24, KC_##k13 }, \
|
||||
{ KC_##k30, KC_##k32, KC_##k33, KC_##k47, KC_##k09, KC_##k29, KC_##k27, KC_##k26, KC_##k36, KC_##k02 }, \
|
||||
{ KC_##k19, KC_##k20, KC_##k21, KC_##k42, KC_##k18, KC_##k16, KC_##k15, KC_##k14, KC_##k41, KC_##k17 }, \
|
||||
{ KC_##k06, KC_##k07, KC_##k08, KC_##k10, KC_NO, KC_##k05, KC_##k04, KC_##k03, KC_##k01, KC_NO } \
|
||||
}
|
||||
|
||||
|
||||
|
13
keyboards/chimera_ls/info.json
Normal file
13
keyboards/chimera_ls/info.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"keyboard_name": "Chimera LS",
|
||||
"url": "",
|
||||
"maintainer": "qmk",
|
||||
"width": 13,
|
||||
"height": 4,
|
||||
"layouts": {
|
||||
"LAYOUT_ortho_4x12": {
|
||||
"key_count": 48,
|
||||
"layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":7, "y":1}, {"x":8, "y":1}, {"x":9, "y":1}, {"x":10, "y":1}, {"x":11, "y":1}, {"x":12, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2}, {"x":5, "y":2}, {"x":7, "y":2}, {"x":8, "y":2}, {"x":9, "y":2}, {"x":10, "y":2}, {"x":11, "y":2}, {"x":12, "y":2}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}, {"x":4, "y":3}, {"x":5, "y":3}, {"x":7, "y":3}, {"x":8, "y":3}, {"x":9, "y":3}, {"x":10, "y":3}, {"x":11, "y":3}, {"x":12, "y":3}]
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,7 +1,7 @@
|
||||
// this is the style you want to emulate.
|
||||
// This is the canonical layout file for the Quantum project. If you want to add another keyboard,
|
||||
|
||||
#include "chimera_ls.h"
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
// Each layer gets a name for readability, which is then used in the keymap matrix below.
|
||||
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
|
||||
@@ -24,168 +24,163 @@ enum chimera_lets_split_layers
|
||||
#define KC_SCTR MT(MOD_LCTL, KC_RBRC)
|
||||
#define KC_SPLT MT(MOD_LALT, KC_MINS)
|
||||
#define KC_MESC LT(_MACROS, KC_ESC)
|
||||
#define KC_INCL M(0)
|
||||
#define KC_PULL M(1)
|
||||
#define KC_PUSH M(2)
|
||||
#define KC_SCAP M(3)
|
||||
#define KC_SCOF M(4)
|
||||
#define KC_CAD LALT(LCTL(KC_DEL))
|
||||
|
||||
enum custom_keycodes {
|
||||
KC_INCL = SAFE_RANGE,
|
||||
KC_PULL,
|
||||
KC_PUSH,
|
||||
KC_SCAP,
|
||||
KC_SCOF
|
||||
};
|
||||
|
||||
#define LONGPRESS_DELAY 150
|
||||
//#define LAYER_TOGGLE_DELAY 300
|
||||
|
||||
// Fillers to make layering more clear
|
||||
#define _______ KC_TRNS
|
||||
#define XXXXXXX KC_NO
|
||||
#define KC_ KC_TRNS
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
[_QWERTY] = KC_KEYMAP(
|
||||
//,----+----+----+----+----+----. ,----+----+----+----+----+----.
|
||||
MESC, Q , W , E , R , T , Y , U , I , O , P ,BSPC,
|
||||
//|----+----+----+----+----+----| |----+----+----+----+----+----|
|
||||
TAB , A , S , D , F , G , H , J , K , L ,SCLN, ENT,
|
||||
//|----+----+----+----+----+----| |----+----+----+----+----+----|
|
||||
LSPO, Z , X , C , V , B , N , M ,COMM,DOT ,SLSH,RSPC,
|
||||
//|----+----+----+----+----+----| |----+----+----+----+----+----|
|
||||
SCTL,SPFN,SPLT,AMPR,NMPD,SPC , SPC ,SYMB,ASTR,EXLM,LBRC,SCTR
|
||||
//`----+----+----+----+----+----' `----+----+----+----+----+----'
|
||||
[_QWERTY] = LAYOUT_ortho_4x12(
|
||||
//,--------+--------+--------+--------+--------+--------. ,--------+--------+--------+--------+--------+--------.
|
||||
KC_MESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
|
||||
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
|
||||
KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT,
|
||||
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
|
||||
KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC,
|
||||
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
|
||||
KC_SCTL, KC_SPFN, KC_SPLT, KC_AMPR, KC_NMPD, KC_SPC, KC_SPC, KC_SYMB, KC_ASTR, KC_EXLM, KC_LBRC, KC_SCTR
|
||||
//`--------+--------+--------+--------+--------+--------' `--------+--------+--------+--------+--------+--------'
|
||||
),
|
||||
|
||||
[_CAPS] = KC_KEYMAP(
|
||||
//,----+----+----+----+----+----. ,----+----+----+----+----+----.
|
||||
, , , , , , , , , , , ,
|
||||
//|----+----+----+----+----+----| |----+----+----+----+----+----|
|
||||
, , , , , , , , , ,COLN, ,
|
||||
//|----+----+----+----+----+----| |----+----+----+----+----+----|
|
||||
, , , , , , , , , , , ,
|
||||
//|----+----+----+----+----+----| |----+----+----+----+----+----|
|
||||
, ,UNDS, , , , , , , , ,
|
||||
//`----+----+----+----+----+----' `----+----+----+----+----+----'
|
||||
[_CAPS] = LAYOUT_ortho_4x12(
|
||||
//,--------+--------+--------+--------+--------+--------. ,--------+--------+--------+--------+--------+--------.
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_COLN, _______,
|
||||
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
|
||||
_______, _______, KC_UNDS, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
//`--------+--------+--------+--------+--------+--------' `--------+--------+--------+--------+--------+--------'
|
||||
),
|
||||
|
||||
|
||||
[_NUMPAD] = KC_KEYMAP(
|
||||
//,----+----+----+----+----+----. ,----+----+----+----+----+----.
|
||||
, , , , , , , 7 , 8 , 9 ,MINS,QUOT,
|
||||
//|----+----+----+----+----+----| |----+----+----+----+----+----|
|
||||
, , , , , , , 4 , 5 , 6 ,PLUS, ENT,
|
||||
//|----+----+----+----+----+----| |----+----+----+----+----+----|
|
||||
LSFT, , , , , , , 1 , 2 , 3 ,ASTR, EQL,
|
||||
//|----+----+----+----+----+----| |----+----+----+----+----+----|
|
||||
, , , , ,BSPC, SPC , 0 , 0 , DOT,SLSH,
|
||||
//`----+----+----+----+----+----' `----+----+----+----+----+----'
|
||||
[_NUMPAD] = LAYOUT_ortho_4x12(
|
||||
//,--------+--------+--------+--------+--------+--------. ,--------+--------+--------+--------+--------+--------.
|
||||
_______, _______, _______, _______, _______, _______, _______, KC_7, KC_8, KC_9, KC_MINS, KC_QUOT,
|
||||
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
|
||||
_______, _______, _______, _______, _______, _______, _______, KC_4, KC_5, KC_6, KC_PLUS, KC_ENT,
|
||||
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
|
||||
KC_LSFT, _______, _______, _______, _______, _______, _______, KC_1, KC_2, KC_3, KC_ASTR, KC_EQL,
|
||||
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
|
||||
_______, _______, _______, _______, _______, KC_BSPC, KC_SPC, KC_0, KC_0, KC_DOT, KC_SLSH, _______
|
||||
//`--------+--------+--------+--------+--------+--------' `--------+--------+--------+--------+--------+--------'
|
||||
),
|
||||
|
||||
[_SYMBOLS] = KC_KEYMAP(
|
||||
//,----+----+----+----+----+----. ,----+----+----+----+----+----.
|
||||
,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN,QUOT,
|
||||
//|----+----+----+----+----+----| |----+----+----+----+----+----|
|
||||
F1 , F2 , F3 , F4 , F5 , F6 , TILD,EQL ,UNDS,LCBR,RCBR,PIPE,
|
||||
//|----+----+----+----+----+----| |----+----+----+----+----+----|
|
||||
F7 , F8 , F9 , F10, F11, F12, GRV ,PLUS,MINS,LBRC,RBRC,BSLS,
|
||||
//|----+----+----+----+----+----| |----+----+----+----+----+----|
|
||||
, , , , NO ,BSPC, SPC , , , , ,
|
||||
//`----+----+----+----+----+----' `----+----+----+----+----+----'
|
||||
[_SYMBOLS] = LAYOUT_ortho_4x12(
|
||||
//,--------+--------+--------+--------+--------+--------. ,--------+--------+--------+--------+--------+--------.
|
||||
_______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_QUOT,
|
||||
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
|
||||
KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_TILD, KC_EQL, KC_UNDS, KC_LCBR, KC_RCBR, KC_PIPE,
|
||||
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
|
||||
KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_GRV, KC_PLUS, KC_MINS, KC_LBRC, KC_RBRC, KC_BSLS,
|
||||
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
|
||||
_______, _______, _______, _______, XXXXXXX, KC_BSPC, KC_SPC, _______, _______, _______, _______, _______
|
||||
//`--------+--------+--------+--------+--------+--------' `--------+--------+--------+--------+--------+--------'
|
||||
),
|
||||
|
||||
[_NAV] = KC_KEYMAP(
|
||||
//,----+----+----+----+----+----. ,----+----+----+----+----+----.
|
||||
, , , , DEL,BSPC, ,HOME, UP , END, INS,PSCR,
|
||||
//|----+----+----+----+----+----| |----+----+----+----+----+----|
|
||||
, , ,LSFT,LCTL, ENT, ,LEFT,DOWN,RGHT, DEL, ,
|
||||
//|----+----+----+----+----+----| |----+----+----+----+----+----|
|
||||
, , , , , , ,PGUP,PGDN, , , ,
|
||||
//|----+----+----+----+----+----| |----+----+----+----+----+----|
|
||||
, , , , ,DEL , , , , , ,
|
||||
//`----+----+----+----+----+----' `----+----+----+----+----+----'
|
||||
[_NAV] = LAYOUT_ortho_4x12(
|
||||
//,--------+--------+--------+--------+--------+--------. ,--------+--------+--------+--------+--------+--------.
|
||||
_______, _______, _______, _______, KC_DEL, KC_BSPC, _______, KC_HOME, KC_UP, KC_END, KC_INS, KC_PSCR,
|
||||
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
|
||||
_______, _______, _______, KC_LSFT, KC_LCTL, KC_ENT, _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_DEL, _______,
|
||||
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
|
||||
_______, _______, _______, _______, _______, _______, _______, KC_PGUP, KC_PGDN, _______, _______, _______,
|
||||
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
|
||||
_______, _______, _______, _______, _______, KC_DEL, _______, _______, _______, _______, _______, _______
|
||||
//`--------+--------+--------+--------+--------+--------' `--------+--------+--------+--------+--------+--------'
|
||||
),
|
||||
|
||||
[_MACROS] = KC_KEYMAP(
|
||||
//,----+----+----+----+----+----. ,----+----+----+----+----+----.
|
||||
, , , , , , , ,INCL, , , ,
|
||||
//|----+----+----+----+----+----| |----+----+----+----+----+----|
|
||||
, , ,CAD , , , , , , , , ,
|
||||
//|----+----+----+----+----+----| |----+----+----+----+----+----|
|
||||
SCAP, , , , , , , ,PULL,PUSH, ,SCAP,
|
||||
//|----+----+----+----+----+----| |----+----+----+----+----+----|
|
||||
, , , , , , , , , , ,
|
||||
//`----+----+----+----+----+----' `----+----+----+----+----+----'
|
||||
[_MACROS] = LAYOUT_ortho_4x12(
|
||||
//,--------+--------+--------+--------+--------+--------. ,--------+--------+--------+--------+--------+--------.
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, KC_INCL, _______, _______, _______,
|
||||
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
|
||||
_______, _______, _______, KC_CAD, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
|
||||
KC_SCAP, _______, _______, _______, _______, _______, _______, _______, KC_PULL, KC_PUSH, _______, KC_SCAP,
|
||||
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
//`--------+--------+--------+--------+--------+--------' `--------+--------+--------+--------+--------+--------'
|
||||
),
|
||||
|
||||
};
|
||||
|
||||
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
|
||||
};
|
||||
|
||||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||
{
|
||||
switch(id) {
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
switch(keycode) {
|
||||
/* include some kind of library or header */
|
||||
case 0:
|
||||
case KC_INCL:
|
||||
if (record->event.pressed) {
|
||||
SEND_STRING("#include <>");
|
||||
return MACRO( T(LEFT), END);
|
||||
SEND_STRING("#include <>" SS_TAP(X_LEFT) );
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
case KC_PULL:
|
||||
if (record->event.pressed) {
|
||||
SEND_STRING("git pull");
|
||||
return MACRO( T(ENT), END );
|
||||
SEND_STRING("git pull" SS_TAP(X_ENTER) );
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
case KC_PUSH:
|
||||
if (record->event.pressed){
|
||||
SEND_STRING("git push");
|
||||
return MACRO( T(ENT), END );
|
||||
SEND_STRING("git push" SS_TAP(X_ENTER) );
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
case KC_SCAP:
|
||||
if (record->event.pressed){
|
||||
layer_on(_CAPS);
|
||||
register_code(KC_CAPSLOCK);
|
||||
unregister_code(KC_CAPSLOCK);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
case KC_SCOF:
|
||||
if (record->event.pressed){
|
||||
layer_off(_CAPS);
|
||||
register_code(KC_CAPSLOCK);
|
||||
unregister_code(KC_CAPSLOCK);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return MACRO_NONE;
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
|
||||
void matrix_scan_user(void) {
|
||||
uint8_t layer = biton32(layer_state);
|
||||
|
||||
switch (layer) {
|
||||
case _QWERTY:
|
||||
set_led_green;
|
||||
break;
|
||||
case _CAPS:
|
||||
set_led_white;
|
||||
break;
|
||||
case _NUMPAD:
|
||||
set_led_blue;
|
||||
break;
|
||||
case _SYMBOLS:
|
||||
set_led_red;
|
||||
break;
|
||||
case _NAV:
|
||||
set_led_magenta;
|
||||
break;
|
||||
case _MACROS:
|
||||
set_led_cyan;
|
||||
break;
|
||||
default:
|
||||
set_led_green;
|
||||
break;
|
||||
}
|
||||
uint8_t layer = biton32(layer_state);
|
||||
|
||||
switch (layer) {
|
||||
case _QWERTY:
|
||||
set_led_green;
|
||||
break;
|
||||
case _CAPS:
|
||||
set_led_white;
|
||||
break;
|
||||
case _NUMPAD:
|
||||
set_led_blue;
|
||||
break;
|
||||
case _SYMBOLS:
|
||||
set_led_red;
|
||||
break;
|
||||
case _NAV:
|
||||
set_led_magenta;
|
||||
break;
|
||||
case _MACROS:
|
||||
set_led_cyan;
|
||||
break;
|
||||
default:
|
||||
set_led_green;
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
@@ -2,18 +2,14 @@
|
||||
|
||||

|
||||
|
||||
A wireless version of the let's split: a split 40% ortholinear keyboard
|
||||
A wireless version of the Let's Split: a split 40% ortholinear keyboard.
|
||||
|
||||
Keyboard Maintainer: [William Wilson](https://github.com/GlenPickle)
|
||||
|
||||
|
||||
Hardware Supported: Chimera LS PCB, WaveShare core nRF51822
|
||||
|
||||
Hardware Supported: Chimera LS PCB, WaveShare core nRF51822
|
||||
Hardware Availability: [Gerbers](https://github.com/GlenPickle/Chimera/tree/master/ls/gerbers)
|
||||
|
||||
Make example for this keyboard (after setting up your build environment):
|
||||
|
||||
make chimera_ls:default
|
||||
|
||||
See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information.
|
||||
|
||||
See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
|
||||
|
@@ -46,7 +46,7 @@ F_USB = $(F_CPU)
|
||||
|
||||
# Bootloader
|
||||
# This definition is optional, and if your keyboard supports multiple bootloaders of
|
||||
# different sizes, comment this out, and the correct address will be loaded
|
||||
# different sizes, comment this out, and the correct address will be loaded
|
||||
# automatically (+60). See bootloader.mk for all options.
|
||||
BOOTLOADER = caterina
|
||||
|
||||
@@ -80,3 +80,5 @@ UNICODE_ENABLE = YES # Unicode
|
||||
# BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
|
||||
USB = /dev/ttyACM0
|
||||
|
||||
LAYOUTS = ortho_4x12
|
||||
|
@@ -47,9 +47,7 @@
|
||||
#define RGBLIGHT_VAL_STEP 8
|
||||
#endif
|
||||
#define RGB_DI_PIN D3
|
||||
#define RGBLIGHT_TIMER
|
||||
|
||||
#define RGBLED_NUM 4
|
||||
#define ws2812_PORTREG PORTD
|
||||
#define ws2812_DDRREG DDRD
|
||||
|
||||
#endif
|
||||
|
@@ -42,7 +42,7 @@
|
||||
# change to "no" to disable the options, or define them in the makefile.mk in
|
||||
# the appropriate keymap folder that will get included automatically
|
||||
#
|
||||
RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
|
||||
RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight.
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../../Makefile
|
||||
|
@@ -15,7 +15,7 @@ MIDI_ENABLE = no # MIDI controls
|
||||
AUDIO_ENABLE = no # Audio output on port C6
|
||||
UNICODE_ENABLE = no # Unicode
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
|
||||
ONEHAND_ENABLE = no # Enable one-hand typing
|
||||
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
|
@@ -10,7 +10,7 @@ COMMAND_ENABLE = no # Commands for debug and configuration
|
||||
CONSOLE_ENABLE = no # Console for debug(+400)
|
||||
MIDI_ENABLE = no # MIDI controls
|
||||
NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../../Makefile
|
||||
|
@@ -20,13 +20,17 @@
|
||||
enum contra_layers {
|
||||
_QWERTZ,
|
||||
_FUNC,
|
||||
_NUMROW
|
||||
_NUMROW,
|
||||
_NUMROW_L3,
|
||||
_GAMING
|
||||
};
|
||||
|
||||
#define KC_I3 LM(_NUMROW, MOD_LALT)
|
||||
#define KC_NR MO(_NUMROW)
|
||||
#define NR_L3 SAFE_RANGE
|
||||
#define FUN MO(_FUNC)
|
||||
#define G_1 TO(_GAMING)
|
||||
#define G_0 TG(_GAMING)
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
@@ -52,7 +56,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | | | | | | | | Ü | | Ö | | Del |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | Lock | Ä | ß | | | | | RGBS | RGBB | RGBS | | |
|
||||
* | Lock | Ä | ß | | | GAME | | RGBS | RGBB | RGBS | | |
|
||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | | | | | | | | RGBH-| RGBT | RGBH+| PgUp | |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
@@ -61,14 +65,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
*/
|
||||
[_FUNC] = {
|
||||
{_______, _______, _______, _______, _______, _______, _______, DE_UE, _______, DE_OE, _______, KC_DEL },
|
||||
{KC_LOCK, DE_AE, DE_SS, _______, _______, _______, _______, RGB_M_P, RGB_M_B, RGB_M_SW,_______, _______},
|
||||
{KC_LOCK, DE_AE, DE_SS, _______, _______, G_1, _______, RGB_M_P, RGB_M_B, RGB_M_SW,_______, _______},
|
||||
{_______, _______, _______, _______, _______, _______, _______, RGB_HUD, RGB_TOG, RGB_HUI, KC_PGUP, _______},
|
||||
{_______, _______, _______, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, KC_HOME, KC_PGDN, KC_END }
|
||||
},
|
||||
|
||||
/* Numrow layer (special characters with Shift and ISO_L3_Shift)
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | ß |
|
||||
* | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | | | | | | | | | | | #' | |
|
||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
@@ -78,25 +82,61 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_NUMROW] = {
|
||||
{_______, DE_1, DE_2, DE_3, DE_4, DE_5, DE_6, DE_7, DE_8, DE_9, DE_0, DE_SS },
|
||||
{_______, DE_1, DE_2, DE_3, DE_4, DE_5, DE_6, DE_7, DE_8, DE_9, DE_0, _______},
|
||||
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, DE_HASH, _______},
|
||||
{_______, DE_LESS, _______, _______, _______, _______, _______, _______, _______, _______, DE_MINS, _______},
|
||||
{_______, _______, _______, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, _______, _______, _______}
|
||||
},
|
||||
[_NUMROW_L3] = {
|
||||
{_______, DE_1, DE_2, DE_3, DE_4, DE_5, DE_6, DE_7, DE_8, DE_9, DE_0, _______},
|
||||
{_______, DE_Q, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
|
||||
{_______, DE_LESS, _______, _______, _______, _______, _______, _______, _______, _______, DE_MINS, _______},
|
||||
{_______, _______, _______, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, _______, _______, _______}
|
||||
},
|
||||
|
||||
/* Gaming
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | | | | | | | | | | | | |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | | | | | | | | | | | | |
|
||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | | | | | | | | | | | | |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | Space| | | | | | | | Reset| | | |
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_GAMING] = {
|
||||
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
|
||||
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
|
||||
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______},
|
||||
{KC_SPC, _______, _______, _______, _______, _______, _______, _______, G_0, _______, _______, _______}
|
||||
}
|
||||
};
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
if (keycode == NR_L3) {
|
||||
if (record->event.pressed) {
|
||||
register_code(DE_ALGR);
|
||||
layer_on(_NUMROW);
|
||||
} else {
|
||||
layer_off(_NUMROW);
|
||||
unregister_code(DE_ALGR);
|
||||
}
|
||||
return false;
|
||||
switch(keycode) {
|
||||
case KC_BSPC:
|
||||
if (record->event.pressed) {
|
||||
if (get_mods() & (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT))) {
|
||||
register_code(DE_SS);
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
unregister_code(DE_SS);
|
||||
}
|
||||
return true;
|
||||
case NR_L3:
|
||||
if (record->event.pressed) {
|
||||
register_code(DE_ALGR);
|
||||
layer_on(_NUMROW_L3);
|
||||
} else {
|
||||
layer_off(_NUMROW_L3);
|
||||
unregister_code(DE_ALGR);
|
||||
}
|
||||
return false;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void led_set_user(uint8_t usb_led) {
|
||||
|
83
keyboards/converter/adb_usb/README.md
Normal file
83
keyboards/converter/adb_usb/README.md
Normal file
@@ -0,0 +1,83 @@
|
||||
ADB-to USB Keyboard Converter
|
||||
=============================
|
||||
This firmware converts Apple Desktop Bus (ADB) keyboard protocol to USB so that you can use an ADB keyboard on a modern computer. It works on the PJRC Teensy 2.0 and other USB AVR MCUs (ATMega32U4, AT90USB64/128, etc) and needs at least 10KB of flash memory.
|
||||
|
||||
|
||||
This is a port of the TMK ADB-to-USB converter to QMK. For information on QMK, please consult the following:
|
||||
https://github.com/qmk/qmk_firmware
|
||||
https://docs.qmk.fm
|
||||
|
||||
|
||||
Wiring
|
||||
------
|
||||
Connect the VCC, GND, and DATA lines of the ADB keyboard to the controller (Teensy 2.0 or similar). By default the DATA line uses port PD0. The Power SW line is unused by the converter.
|
||||
|
||||
ADB female socket from the front:
|
||||
|
||||
,--_--.
|
||||
/ o4 3o \ 1: DATA
|
||||
| o2 1o | 2: Power SW
|
||||
- === - 3: VCC
|
||||
`-___-' 4: GND
|
||||
|
||||
This converter uses AVR's internal pull-up, but it seems to be too weak, in particular when you want to use a long or coiled cable. Using an external pull-up resistor (1K-10K Ohm) between the DATA and VCC lines is strongly recommended.
|
||||
|
||||
Pull-up resistor:
|
||||
|
||||
Keyboard Converter
|
||||
,------.
|
||||
5V------+------|VCC |
|
||||
| | |
|
||||
[R] | |
|
||||
| | |
|
||||
Signal--+------|PD0 |
|
||||
| |
|
||||
GND------------|GND |
|
||||
`------'
|
||||
R: 1K Ohm resistor
|
||||
|
||||
|
||||
Define following macros for ADB connection in config.h if you use other than port PD0.
|
||||
|
||||
ADB_PORT, ADB_PIN, ADB_DDR, ADB_DATA_BIT
|
||||
|
||||
|
||||
Building the Firmware
|
||||
------------------------------------------
|
||||
See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
|
||||
|
||||
|
||||
Keymap
|
||||
------
|
||||
To build the default keymap run this command:
|
||||
|
||||
$ make converter/adb_usb:default
|
||||
|
||||
You may add your own keymap to the converter/adb_usb/keymaps directory, as you would with any other QMK-powered keyboard.
|
||||
|
||||
To build your custom keymap, change the build command to:
|
||||
|
||||
$ make converter/adb_usb:my_keymap
|
||||
|
||||
Where 'my_keymap' is the name of your custom keymap directory.
|
||||
|
||||
|
||||
Locking Caps Lock
|
||||
----------------
|
||||
Many old ADB keyboards use a locking switch for the caps lock key. This converter supports the locking caps lock key by default.
|
||||
|
||||
|
||||
Notes
|
||||
-----
|
||||
Non-extended ADB keyboards make no distinction between the left and right modifiers,
|
||||
i.e. the keycode for the left modifier will be sent even if the right modifier
|
||||
|
||||
The Apple Extended Keyboard and Apple Extended Keyboard II can differentiate between the left and right modifiers except for the GUI key (Windows/Command).
|
||||
|
||||
Most ADB keyboards have no diodes in its matrix so they are not NKRO,
|
||||
though the ADB protocol itself supports it. See protocol/adb.c for more info.
|
||||
|
||||
|
||||
QMK Port Changelog
|
||||
---------
|
||||
- 2018/09/16 - Initial release.
|
3
keyboards/converter/adb_usb/adb_usb.c
Normal file
3
keyboards/converter/adb_usb/adb_usb.c
Normal file
@@ -0,0 +1,3 @@
|
||||
#include "adb_usb.h"
|
||||
#include <avr/io.h>
|
||||
#include "quantum.h"
|
109
keyboards/converter/adb_usb/adb_usb.h
Normal file
109
keyboards/converter/adb_usb/adb_usb.h
Normal file
@@ -0,0 +1,109 @@
|
||||
/*
|
||||
Copyright 2011,2012,2013 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/>.
|
||||
|
||||
Ported to QMK by Peter Roe <pete@13bit.me>
|
||||
*/
|
||||
|
||||
#ifndef KEYMAP_COMMON_H
|
||||
#define KEYMAP_COMMON_H
|
||||
|
||||
#include "quantum.h"
|
||||
|
||||
/* M0115/M3501 Apple Extended Keyboard ANSI
|
||||
* ,---. ,---------------. ,---------------. ,---------------. ,-----------. ,---.
|
||||
* |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| |Pwr|
|
||||
* `---' `---------------' `---------------' `---------------' `-----------' `---'
|
||||
* ,-----------------------------------------------------------. ,-----------. ,---------------.
|
||||
* | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backspa| |Ins|Hom|PgU| |NmL| =| /| *|
|
||||
* |-----------------------------------------------------------| |-----------| |---------------|
|
||||
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| |Del|End|PgD| | 7| 8| 9| -|
|
||||
* |-----------------------------------------------------------| `-----------' |---------------|
|
||||
* |CapsLo| A| S| D| F| G| H| J| K| L| ;| '|Return | | 4| 5| 6| +|
|
||||
* |-----------------------------------------------------------| ,---. |---------------|
|
||||
* |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shift | |Up | | 1| 2| 3| |
|
||||
* |-----------------------------------------------------------| ,-----------. |-----------|Ent|
|
||||
* |Ctrl |Opt |Cmd | Space | |Opt |Ctrl | |Lef|Dow|Rig| | 0| .| |
|
||||
* `-----------------------------------------------------------' `-----------' `---------------'
|
||||
*/
|
||||
#define LAYOUT_ext_ansi( \
|
||||
K35, K7A,K78,K63,K76,K60,K61,K62,K64,K65,K6D,K67,K6F, K69,K6B,K71, K7F, \
|
||||
K32,K12,K13,K14,K15,K17,K16,K1A,K1C,K19,K1D,K1B,K18,K33, K72,K73,K74, K47,K51,K4B,K43, \
|
||||
K30,K0C,K0D,K0E,K0F,K11,K10,K20,K22,K1F,K23,K21,K1E,K2A, K75,K77,K79, K59,K5B,K5C,K4E, \
|
||||
K39,K00,K01,K02,K03,K05,K04,K26,K28,K25,K29,K27, K24, K56,K57,K58,K45, \
|
||||
K38,K06,K07,K08,K09,K0B,K2D,K2E,K2B,K2F,K2C, K7B, K3E, K53,K54,K55, \
|
||||
K36,K3A,K37, K31, K7C,K7D, K3B,K3D,K3C, K52, K41,K4C \
|
||||
) { \
|
||||
{ K00, K01, K02, K03, K04, K05, K06, K07 }, \
|
||||
{ K08, K09, KC_NO, K0B, K0C, K0D, K0E, K0F }, \
|
||||
{ K10, K11, K12, K13, K14, K15, K16, K17 }, \
|
||||
{ K18, K19, K1A, K1B, K1C, K1D, K1E, K1F }, \
|
||||
{ K20, K21, K22, K23, K24, K25, K26, K27 }, \
|
||||
{ K28, K29, K2A, K2B, K2C, K2D, K2E, K2F }, \
|
||||
{ K30, K31, K32, K33, KC_NO, K35, K36, K37 }, \
|
||||
{ K38, K39, K3A, K3B, K3C, K3D, K3E, KC_NO, }, \
|
||||
{ KC_NO, K41, KC_NO, K43, KC_NO, K45, KC_NO, K47 }, \
|
||||
{ KC_NO, KC_NO, KC_NO, K4B, K4C, KC_NO, K4E, KC_NO, }, \
|
||||
{ KC_NO, KC_NO, K52, K53, K54, K55, K56, K57 }, \
|
||||
{ K58, K59, KC_NO, K5B, K5C, KC_NO, KC_NO, KC_NO, }, \
|
||||
{ K60, K61, K62, K63, K64, K65, KC_NO, K67 }, \
|
||||
{ KC_NO, K69, KC_NO, K6B, KC_NO, K6D, KC_NO, K6F }, \
|
||||
{ KC_NO, K71, K72, K73, K74, K75, K76, K77 }, \
|
||||
{ K78, K79, K7A, K7B, K7C, K7D, KC_NO, K7F } \
|
||||
}
|
||||
|
||||
/* M0116 Apple Standard Keyboard ANSI
|
||||
* +-------+
|
||||
* | power |
|
||||
* +-------+
|
||||
* +---+---+---+---+---+---+---+---+---+---+---+---+---+-----+ +---+---+---+---+
|
||||
* |esc| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | bks | |clr| = | / | * |
|
||||
* +---------------------------------------------------------+ +---+---+---+---+
|
||||
* | tab | q | w | e | r | t | y | u | i | o | p | [ | ] | | | 7 | 8 | 9 | + |
|
||||
* +-----------------------------------------------------+ | +---+---+---+---+
|
||||
* | ctrl | a | s | d | f | g | h | j | k | l | ; | ' |return| | 4 | 5 | 6 | - |
|
||||
* +---------------------------------------------------------+ +---+---+---+---+
|
||||
* | shift | z | x | c | v | b | n | m | , | . | / | shift | | 1 | 2 | 3 | |
|
||||
* +---------------------------------------------------------+ +-------+---|ent|
|
||||
* |cap|opt|comnd| ` | | \ |lef|rig|dwn|up | | 0 | . | |
|
||||
* +---------------------------------------------------------+ +-------+---+---+
|
||||
*/
|
||||
#define LAYOUT_m0116_ansi( \
|
||||
K7F, \
|
||||
K35,K12,K13,K14,K15,K17,K16,K1A,K1C,K19,K1D,K1B,K18,K33, K47,K51,K4B,K43, \
|
||||
K30,K0C,K0D,K0E,K0F,K11,K10,K20,K22,K1F,K23,K21,K1E, K59,K5B,K5C,K45, \
|
||||
K36,K00,K01,K02,K03,K05,K04,K26,K28,K25,K29,K27, K24, K56,K57,K58,K4E, \
|
||||
K38,K06,K07,K08,K09,K0B,K2D,K2E,K2B,K2F,K2C, K7B, K53,K54,K55, \
|
||||
K39,K3A,K37,K32, K31, K2A,K3B,K3C,K3D,K3E, K52, K41,K4C \
|
||||
) { \
|
||||
{ K00, K01, K02, K03, K04, K05, K06, K07 }, \
|
||||
{ K08, K09, KC_NO, K0B, K0C, K0D, K0E, K0F }, \
|
||||
{ K10, K11, K12, K13, K14, K15, K16, K17 }, \
|
||||
{ K18, K19, K1A, K1B, K1C, K1D, K1E, K1F }, \
|
||||
{ K20, K21, K22, K23, K24, K25, K26, K27 }, \
|
||||
{ K28, K29, K2A, K2B, K2C, K2D, K2E, K2F }, \
|
||||
{ K30, K31, K32, K33, KC_NO, K35, K36, K37 }, \
|
||||
{ K38, K39, K3A, K3B, K3C, K3D, K3E, KC_NO }, \
|
||||
{ KC_NO, K41, KC_NO, K43, KC_NO, K45, KC_NO, K47 }, \
|
||||
{ KC_NO, KC_NO, KC_NO, K4B, K4C, KC_NO, K4E, KC_NO }, \
|
||||
{ KC_NO, K51, K52, K53, K54, K55, K56, K57 }, \
|
||||
{ K58, K59, KC_NO, K5B, K5C, KC_NO, KC_NO, KC_NO }, \
|
||||
{ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \
|
||||
{ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \
|
||||
{ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \
|
||||
{ KC_NO, KC_NO, KC_NO, K7B, KC_NO, KC_NO, KC_NO, K7F } \
|
||||
}
|
||||
|
||||
#endif
|
43
keyboards/converter/adb_usb/config.h
Normal file
43
keyboards/converter/adb_usb/config.h
Normal file
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
Copyright 2011 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/>.
|
||||
|
||||
Ported to QMK by Peter Roe <pete@13bit.me>
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#define VENDOR_ID 0xFEED
|
||||
#define PRODUCT_ID 0x0ADB
|
||||
#define DEVICE_VER 0x0101
|
||||
#define MANUFACTURER QMK
|
||||
#define PRODUCT ADB keyboard converter
|
||||
#define DESCRIPTION Convert ADB keyboard to USB
|
||||
|
||||
/* matrix size */
|
||||
#define MATRIX_ROWS 16 // keycode bit: 3-0
|
||||
#define MATRIX_COLS 8 // keycode bit: 6-4
|
||||
|
||||
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
||||
#define LOCKING_SUPPORT_ENABLE
|
||||
/* Locking resynchronize hack */
|
||||
#define LOCKING_RESYNC_ENABLE
|
||||
|
||||
/* ADB port setting */
|
||||
#define ADB_PORT PORTD
|
||||
#define ADB_PIN PIND
|
||||
#define ADB_DDR DDRD
|
||||
#define ADB_DATA_BIT 0
|
||||
//#define ADB_PSW_BIT 1 // optional
|
26
keyboards/converter/adb_usb/keymaps/13bit/keymap.c
Normal file
26
keyboards/converter/adb_usb/keymaps/13bit/keymap.c
Normal file
@@ -0,0 +1,26 @@
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
#define MCTL LCTL(KC_UP)
|
||||
#define SCST LSFT(LGUI(KC_4))
|
||||
#define SLP LALT(LGUI(KC_EJCT))
|
||||
|
||||
#define APP1 LSFT(LALT(LCTL(LGUI(KC_1))))
|
||||
#define APP2 LSFT(LALT(LCTL(LGUI(KC_2))))
|
||||
#define APP3 LSFT(LALT(LCTL(LGUI(KC_3))))
|
||||
#define APP4 LSFT(LALT(LCTL(LGUI(KC_4))))
|
||||
#define APP5 LSFT(LALT(LCTL(LGUI(KC_5))))
|
||||
#define APP6 LSFT(LALT(LCTL(LGUI(KC_6))))
|
||||
#define APP7 LSFT(LALT(LCTL(LGUI(KC_7))))
|
||||
#define APP8 LSFT(LALT(LCTL(LGUI(KC_8))))
|
||||
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
LAYOUT_ext_ansi(
|
||||
KC_ESC, APP1, APP2, APP3, APP4, APP5, APP6, APP7, APP8, MCTL, KC_MUTE, KC_VOLD, KC_VOLU, SCST, KC_SLCK, KC_PAUS, SLP,
|
||||
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, KC_NLCK, KC_EQL, KC_PSLS, KC_PAST,
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, KC_P7, KC_P8, KC_P9, KC_PMNS,
|
||||
KC_LCAP, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS,
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3,
|
||||
KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT
|
||||
),
|
||||
};
|
13
keyboards/converter/adb_usb/keymaps/default/keymap.c
Normal file
13
keyboards/converter/adb_usb/keymaps/default/keymap.c
Normal file
@@ -0,0 +1,13 @@
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
LAYOUT_ext_ansi(
|
||||
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR,KC_SLCK,KC_PAUS, KC_EJCT,
|
||||
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, KC_NLCK, KC_EQL, KC_PSLS, KC_PAST,
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, KC_P7, KC_P8, KC_P9, KC_PMNS,
|
||||
KC_LCAP, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS,
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3,
|
||||
KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT
|
||||
),
|
||||
};
|
27
keyboards/converter/adb_usb/led.c
Normal file
27
keyboards/converter/adb_usb/led.c
Normal file
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
Copyright 2011 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/>.
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <util/delay.h>
|
||||
#include "adb.h"
|
||||
#include "led.h"
|
||||
|
||||
|
||||
void led_set(uint8_t usb_led)
|
||||
{
|
||||
adb_host_kbd_led(ADB_ADDR_KEYBOARD, ~usb_led);
|
||||
}
|
43
keyboards/converter/adb_usb/led.h
Normal file
43
keyboards/converter/adb_usb/led.h
Normal file
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
Copyright 2011 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/>.
|
||||
|
||||
Ported to QMK by Peter Roe <pete@13bit.me>
|
||||
*/
|
||||
|
||||
#ifndef LED_H
|
||||
#define LED_H
|
||||
#include "stdint.h"
|
||||
|
||||
|
||||
/* keyboard LEDs */
|
||||
#define USB_LED_NUM_LOCK 0
|
||||
#define USB_LED_CAPS_LOCK 1
|
||||
#define USB_LED_SCROLL_LOCK 2
|
||||
#define USB_LED_COMPOSE 3
|
||||
#define USB_LED_KANA 4
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void led_set(uint8_t usb_led);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
267
keyboards/converter/adb_usb/matrix.c
Normal file
267
keyboards/converter/adb_usb/matrix.c
Normal file
@@ -0,0 +1,267 @@
|
||||
/*
|
||||
Copyright 2011 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/>.
|
||||
|
||||
Ported to QMK by Peter Roe <pete@13bit.me>
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <avr/io.h>
|
||||
#include <util/delay.h>
|
||||
#include "print.h"
|
||||
#include "util.h"
|
||||
#include "debug.h"
|
||||
#include "adb.h"
|
||||
#include "matrix.h"
|
||||
#include "report.h"
|
||||
#include "host.h"
|
||||
#include "led.h"
|
||||
#include "timer.h"
|
||||
|
||||
static bool is_iso_layout = false;
|
||||
|
||||
// matrix state buffer(1:on, 0:off)
|
||||
static matrix_row_t matrix[MATRIX_ROWS];
|
||||
|
||||
static void register_key(uint8_t key);
|
||||
|
||||
__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)
|
||||
{
|
||||
// LED on
|
||||
DDRD |= (1<<6); PORTD |= (1<<6);
|
||||
|
||||
adb_host_init();
|
||||
// wait for keyboard to boot up and receive command
|
||||
_delay_ms(2000);
|
||||
|
||||
// initialize matrix state: all keys off
|
||||
for (uint8_t i=0; i < MATRIX_ROWS; i++) matrix[i] = 0x00;
|
||||
|
||||
led_set(host_keyboard_leds());
|
||||
|
||||
// debug_enable = false;
|
||||
// debug_matrix = true;
|
||||
// debug_keyboard = true;
|
||||
// debug_mouse = true;
|
||||
// print("debug enabled.\n");
|
||||
|
||||
// LED off
|
||||
DDRD |= (1<<6); PORTD &= ~(1<<6);
|
||||
matrix_init_quantum();
|
||||
}
|
||||
|
||||
#ifdef ADB_MOUSE_ENABLE
|
||||
|
||||
#ifdef MAX
|
||||
#undef MAX
|
||||
#endif
|
||||
#define MAX(X, Y) ((X) > (Y) ? (X) : (Y))
|
||||
|
||||
static report_mouse_t mouse_report = {};
|
||||
|
||||
void adb_mouse_task(void)
|
||||
{
|
||||
uint16_t codes;
|
||||
int16_t x, y;
|
||||
static int8_t mouseacc;
|
||||
|
||||
/* tick of last polling */
|
||||
static uint16_t tick_ms;
|
||||
|
||||
// polling with 12ms interval
|
||||
if (timer_elapsed(tick_ms) < 12) return;
|
||||
tick_ms = timer_read();
|
||||
|
||||
codes = adb_host_mouse_recv();
|
||||
// If nothing received reset mouse acceleration, and quit.
|
||||
if (!codes) {
|
||||
mouseacc = 1;
|
||||
return;
|
||||
};
|
||||
// Bit sixteen is button.
|
||||
if (~codes & (1 << 15))
|
||||
mouse_report.buttons |= MOUSE_BTN1;
|
||||
if (codes & (1 << 15))
|
||||
mouse_report.buttons &= ~MOUSE_BTN1;
|
||||
// lower seven bits are movement, as signed int_7.
|
||||
// low byte is X-axis, high byte is Y.
|
||||
y = (codes>>8 & 0x3F);
|
||||
x = (codes>>0 & 0x3F);
|
||||
// bit seven and fifteen is negative
|
||||
// usb does not use int_8, but int_7 (measuring distance) with sign-bit.
|
||||
if (codes & (1 << 6))
|
||||
x = (x-0x40);
|
||||
if (codes & (1 << 14))
|
||||
y = (y-0x40);
|
||||
// Accelerate mouse. (They weren't meant to be used on screens larger than 320x200).
|
||||
x *= mouseacc;
|
||||
y *= mouseacc;
|
||||
// Cap our two bytes per axis to one byte.
|
||||
// Easier with a MIN-function, but since -MAX(-a,-b) = MIN(a,b)...
|
||||
// I.E. MIN(MAX(x,-127),127) = -MAX(-MAX(x, -127), -127) = MIN(-MIN(-x,127),127)
|
||||
mouse_report.x = -MAX(-MAX(x, -127), -127);
|
||||
mouse_report.y = -MAX(-MAX(y, -127), -127);
|
||||
if (debug_mouse) {
|
||||
print("adb_host_mouse_recv: "); print_bin16(codes); print("\n");
|
||||
print("adb_mouse raw: [");
|
||||
phex(mouseacc); print(" ");
|
||||
phex(mouse_report.buttons); print("|");
|
||||
print_decs(mouse_report.x); print(" ");
|
||||
print_decs(mouse_report.y); print("]\n");
|
||||
}
|
||||
// Send result by usb.
|
||||
host_mouse_send(&mouse_report);
|
||||
// increase acceleration of mouse
|
||||
mouseacc += ( mouseacc < ADB_MOUSE_MAXACC ? 1 : 0 );
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
uint8_t matrix_scan(void)
|
||||
{
|
||||
/* extra_key is volatile and more convoluted than necessary because gcc refused
|
||||
to generate valid code otherwise. Making extra_key uint8_t and constructing codes
|
||||
here via codes = extra_key<<8 | 0xFF; would consistently fail to even LOAD
|
||||
extra_key from memory, and leave garbage in the high byte of codes. I tried
|
||||
dozens of code variations and it kept generating broken assembly output. So
|
||||
beware if attempting to make extra_key code more logical and efficient. */
|
||||
static volatile uint16_t extra_key = 0xFFFF;
|
||||
uint16_t codes;
|
||||
uint8_t key0, key1;
|
||||
|
||||
/* tick of last polling */
|
||||
static uint16_t tick_ms;
|
||||
|
||||
codes = extra_key;
|
||||
extra_key = 0xFFFF;
|
||||
|
||||
if ( codes == 0xFFFF )
|
||||
{
|
||||
// polling with 12ms interval
|
||||
if (timer_elapsed(tick_ms) < 12) return 0;
|
||||
tick_ms = timer_read();
|
||||
|
||||
codes = adb_host_kbd_recv();
|
||||
}
|
||||
|
||||
key0 = codes>>8;
|
||||
key1 = codes&0xFF;
|
||||
|
||||
if (debug_matrix && codes) {
|
||||
print("adb_host_kbd_recv: "); phex16(codes); print("\n");
|
||||
}
|
||||
|
||||
if (codes == 0) { // no keys
|
||||
return 0;
|
||||
} else if (codes == 0x7F7F) { // power key press
|
||||
register_key(0x7F);
|
||||
} else if (codes == 0xFFFF) { // power key release
|
||||
register_key(0xFF);
|
||||
} else if (key0 == 0xFF) { // error
|
||||
xprintf("adb_host_kbd_recv: ERROR(%d)\n", codes);
|
||||
// something wrong or plug-in
|
||||
matrix_init();
|
||||
return key1;
|
||||
} else {
|
||||
/* Swap codes for ISO keyboard
|
||||
* https://github.com/tmk/tmk_keyboard/issues/35
|
||||
*
|
||||
* ANSI
|
||||
* ,----------- ----------.
|
||||
* | *a| 1| 2 =|Backspa|
|
||||
* |----------- ----------|
|
||||
* |Tab | Q| | ]| *c|
|
||||
* |----------- ----------|
|
||||
* |CapsLo| A| '|Return |
|
||||
* |----------- ----------|
|
||||
* |Shift | Shift |
|
||||
* `----------- ----------'
|
||||
*
|
||||
* ISO
|
||||
* ,----------- ----------.
|
||||
* | *a| 1| 2 =|Backspa|
|
||||
* |----------- ----------|
|
||||
* |Tab | Q| | ]|Retur|
|
||||
* |----------- -----` |
|
||||
* |CapsLo| A| '| *c| |
|
||||
* |----------- ----------|
|
||||
* |Shif| *b| Shift |
|
||||
* `----------- ----------'
|
||||
*
|
||||
* ADB scan code USB usage
|
||||
* ------------- ---------
|
||||
* Key ANSI ISO ANSI ISO
|
||||
* ---------------------------------------------
|
||||
* *a 0x32 0x0A 0x35 0x35
|
||||
* *b ---- 0x32 ---- 0x64
|
||||
* *c 0x2A 0x2A 0x31 0x31(or 0x32)
|
||||
*/
|
||||
if (is_iso_layout) {
|
||||
if ((key0 & 0x7F) == 0x32) {
|
||||
key0 = (key0 & 0x80) | 0x0A;
|
||||
} else if ((key0 & 0x7F) == 0x0A) {
|
||||
key0 = (key0 & 0x80) | 0x32;
|
||||
}
|
||||
}
|
||||
register_key(key0);
|
||||
if (key1 != 0xFF) // key1 is 0xFF when no second key.
|
||||
extra_key = key1<<8 | 0xFF; // process in a separate call
|
||||
}
|
||||
|
||||
matrix_scan_quantum();
|
||||
return 1;
|
||||
}
|
||||
|
||||
void matrix_print(void){
|
||||
|
||||
}
|
||||
|
||||
inline
|
||||
matrix_row_t matrix_get_row(uint8_t row)
|
||||
{
|
||||
return matrix[row];
|
||||
}
|
||||
|
||||
inline
|
||||
static void register_key(uint8_t key)
|
||||
{
|
||||
uint8_t col, row;
|
||||
col = key&0x07;
|
||||
row = (key>>3)&0x0F;
|
||||
if (key&0x80) {
|
||||
matrix[row] &= ~(1<<col);
|
||||
} else {
|
||||
matrix[row] |= (1<<col);
|
||||
}
|
||||
}
|
73
keyboards/converter/adb_usb/rules.mk
Normal file
73
keyboards/converter/adb_usb/rules.mk
Normal file
@@ -0,0 +1,73 @@
|
||||
# MCU name
|
||||
# atmega32u4 Teensy2.0
|
||||
# atemga32u4 TMK Converter rev.1
|
||||
# atemga32u2 TMK Converter rev.2
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
#
|
||||
F_CPU = 16000000
|
||||
# F_CPU = 8000000
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
# Bootloader
|
||||
# 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
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096 for TMK Converter rev.1/rev.2
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
|
||||
# Build Options
|
||||
# comment out to disable the options.
|
||||
#
|
||||
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE = no # Mouse keys(+4700)
|
||||
CONSOLE_ENABLE = no # Console for debug(+400)
|
||||
COMMAND_ENABLE = no # Commands for debug and configuration
|
||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||
NKRO_ENABLE = no # USB Nkey Rollover - not yet supported in LUFA
|
||||
EXTRAKEY_ENABLE = yes
|
||||
USB_HID_ENABLE = yes
|
||||
BACKLIGHT_ENABLE = no
|
||||
#BLUETOOTH = AdafruitBLE # For Adafruit Feather 32U4 BLE support, uncomment this line
|
||||
|
||||
CUSTOM_MATRIX = yes
|
||||
SRC = matrix.c \
|
||||
adb.c
|
@@ -14,7 +14,7 @@ AUDIO_ENABLE = no # Audio output on port C6
|
||||
UNICODE_ENABLE = no # Unicode
|
||||
UNICODEMAP_ENABLE = yes
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
|
||||
PS2_USE_USART = yes
|
||||
API_SYSEX_ENABLE = no
|
||||
|
||||
|
@@ -14,7 +14,7 @@ AUDIO_ENABLE = no # Audio output on port C6
|
||||
UNICODE_ENABLE = no # Unicode
|
||||
UNICODEMAP_ENABLE = yes
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
|
||||
PS2_USE_USART = yes
|
||||
API_SYSEX_ENABLE = no
|
||||
|
||||
|
@@ -61,7 +61,7 @@ AUDIO_ENABLE = no # Audio output on port C6
|
||||
UNICODE_ENABLE = no # Unicode
|
||||
UNICODEMAP_ENABLE = yes
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
|
||||
PS2_USE_USART = yes
|
||||
API_SYSEX_ENABLE = n
|
||||
CUSTOM_MATRIX = yes
|
||||
|
64
keyboards/converter/sun_usb/command_extra.c
Normal file
64
keyboards/converter/sun_usb/command_extra.c
Normal file
@@ -0,0 +1,64 @@
|
||||
#include QMK_KEYBOARD_H
|
||||
#include "protocol/serial.h"
|
||||
|
||||
bool sun_bell = false;
|
||||
bool sun_click = false;
|
||||
|
||||
|
||||
bool command_extra(uint8_t code)
|
||||
{
|
||||
switch (code) {
|
||||
case KC_H:
|
||||
case KC_SLASH: /* ? */
|
||||
print("\n\n----- Sun converter Help -----\n");
|
||||
print("Home: Toggle Bell\n");
|
||||
print("End: Toggle Click\n");
|
||||
print("PgUp: LED all On\n");
|
||||
print("PgDown: LED all Off\n");
|
||||
print("Insert: Layout\n");
|
||||
print("Delete: Reset\n");
|
||||
return false;
|
||||
case KC_DEL:
|
||||
print("Reset\n");
|
||||
serial_send(0x01);
|
||||
break;
|
||||
case KC_HOME:
|
||||
sun_bell = !sun_bell;
|
||||
if (sun_bell) {
|
||||
print("Bell On\n");
|
||||
serial_send(0x02);
|
||||
} else {
|
||||
print("Bell Off\n");
|
||||
serial_send(0x03);
|
||||
}
|
||||
break;
|
||||
case KC_END:
|
||||
sun_click = !sun_click;
|
||||
if (sun_click) {
|
||||
print("Click On\n");
|
||||
serial_send(0x0A);
|
||||
} else {
|
||||
print("Click Off\n");
|
||||
serial_send(0x0B);
|
||||
}
|
||||
break;
|
||||
case KC_PGUP:
|
||||
print("LED all on\n");
|
||||
serial_send(0x0E);
|
||||
serial_send(0xFF);
|
||||
break;
|
||||
case KC_PGDOWN:
|
||||
print("LED all off\n");
|
||||
serial_send(0x0E);
|
||||
serial_send(0x00);
|
||||
break;
|
||||
case KC_INSERT:
|
||||
print("layout\n");
|
||||
serial_send(0x0F);
|
||||
break;
|
||||
default:
|
||||
xprintf("Unknown extra command: %02X\n", code);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user