Compare commits
136 Commits
Author | SHA1 | Date | |
---|---|---|---|
d5bc7fc157 | |||
a08be85780 | |||
1e6797b4e7 | |||
ce465c084b | |||
54f18ce0f7 | |||
9841c64de9 | |||
6471273149 | |||
31b75c75fd | |||
8cd6cfcb77 | |||
918a52da61 | |||
9a05c5d787 | |||
6b4549da8c | |||
824aa06c3c | |||
9cb4c5c092 | |||
6fcc6538c7 | |||
b2ee290c9f | |||
994852712d | |||
15297bcfce | |||
d3f7910e68 | |||
c5e10b7203 | |||
516f516062 | |||
0b3b80afc1 | |||
c5221fa1cb | |||
5fc2421811 | |||
1a680c1d6a | |||
84879f28a3 | |||
c080a3e7c4 | |||
32116f1a45 | |||
24df54b807 | |||
cc738e32dd | |||
6b74dd6de5 | |||
bf2670601d | |||
159191a874 | |||
fd698c43d7 | |||
aeafcc9fd3 | |||
65d3afc915 | |||
6ba39689d3 | |||
6848002601 | |||
e251850cd8 | |||
932d96ad56 | |||
f4f75acbd6 | |||
aea45c5483 | |||
6fa0c48563 | |||
bcb1815420 | |||
83f74dd94c | |||
c6183ab4fc | |||
aeee735f35 | |||
330e2e6af5 | |||
24b7d058e2 | |||
a45b625b62 | |||
a5f1581316 | |||
5fdb398e0a | |||
bd9be8af4a | |||
59bf9127f2 | |||
b577b3b461 | |||
a47860e7e3 | |||
096b480e3d | |||
9f2f9b5333 | |||
7e44618325 | |||
81a5e4d718 | |||
154e1d99c3 | |||
c3e0ef4d8a | |||
941f8678a4 | |||
be3a59d0ff | |||
6be078445c | |||
76da6ec061 | |||
6affec582b | |||
c789577675 | |||
3a513fc3a3 | |||
f1c7718463 | |||
4397b17ca0 | |||
a3104a7110 | |||
35f6919673 | |||
afa4763ef5 | |||
80e733798a | |||
f1be0236b6 | |||
045400ab28 | |||
9986c3d0b7 | |||
0affcc8bc3 | |||
5c7a31eae2 | |||
47051f506f | |||
7df9e584fa | |||
d4e1e712f6 | |||
612dc232d7 | |||
6172273c86 | |||
cb1aeb4254 | |||
b973258123 | |||
b89cab87ce | |||
9b232a7f88 | |||
3352677820 | |||
ab579650b6 | |||
e4ff07aff0 | |||
80d427a203 | |||
e9c3e04146 | |||
e14df8678d | |||
ff893bf17c | |||
b49dbf9b19 | |||
d26e73756f | |||
b6fbcd9d62 | |||
c4ce613bff | |||
e9c9c3a4fa | |||
4e2007b855 | |||
34a11d7bac | |||
fd9967dd8e | |||
0bbf655d14 | |||
d8e9a0f7a3 | |||
8c5c1fd7fe | |||
aa6cc28d43 | |||
4d88c716b4 | |||
e2411b0d4c | |||
87cbb1c552 | |||
9f63cd0d1d | |||
4082d880bc | |||
8f6285d3b3 | |||
6debadb101 | |||
c2080d3b0a | |||
1d49f76f15 | |||
19c504662e | |||
58f3ce5254 | |||
6a63b67cde | |||
71164eee6a | |||
d7ebdfb490 | |||
4c155559d5 | |||
fb49a882b1 | |||
d192fd00cd | |||
3d338f2555 | |||
7186d1581a | |||
74fcfd5335 | |||
d0a7e96d1e | |||
f0e0a67ea5 | |||
efe360464d | |||
c30155343f | |||
60ae309ced | |||
9e784841c0 | |||
02180c87f2 | |||
03d9e3fe79 |
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
||||
.history/
|
||||
.dep
|
||||
*.o
|
||||
*.bin
|
||||
|
@ -20,7 +20,7 @@ before_script:
|
||||
- avr-gcc --version
|
||||
script:
|
||||
- git rev-parse --short HEAD
|
||||
- make test:all AUTOGEN=false
|
||||
- make test:all
|
||||
- bash util/travis_build.sh
|
||||
- bash util/travis_docs.sh
|
||||
addons:
|
||||
|
22
Makefile
22
Makefile
@ -112,23 +112,29 @@ $(eval $(call GET_KEYBOARDS))
|
||||
# Only consider folders with makefiles, to prevent errors in case there are extra folders
|
||||
#KEYBOARDS += $(patsubst $(ROOD_DIR)/keyboards/%/rules.mk,%,$(wildcard $(ROOT_DIR)/keyboards/*/*/rules.mk))
|
||||
|
||||
.PHONY: list-keyboards
|
||||
list-keyboards:
|
||||
echo $(KEYBOARDS)
|
||||
exit 0
|
||||
|
||||
define PRINT_KEYBOARD
|
||||
$(info $(PRINTING_KEYBOARD))
|
||||
endef
|
||||
|
||||
.PHONY: generate-keyboards-file
|
||||
generate-keyboards-file:
|
||||
$(foreach PRINTING_KEYBOARD,$(KEYBOARDS),$(eval $(call PRINT_KEYBOARD)))
|
||||
exit 0
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
echo -n 'Deleting .build ... '
|
||||
echo -n 'Deleting .build/ ... '
|
||||
rm -rf $(BUILD_DIR)
|
||||
echo 'done'
|
||||
exit 0
|
||||
echo 'done.'
|
||||
|
||||
.PHONY: distclean
|
||||
distclean: clean
|
||||
echo -n 'Deleting *.bin and *.hex ... '
|
||||
rm -f *.bin *.hex
|
||||
echo 'done.'
|
||||
|
||||
#Compatibility with the old make variables, anything you specify directly on the command line
|
||||
# always overrides the detected folders
|
||||
@ -548,9 +554,10 @@ endif
|
||||
# it has to be there to allow parallel execution of the submake
|
||||
# This always tries to compile everything, even if error occurs in the middle
|
||||
# But we return the error code at the end, to trigger travis failures
|
||||
$(foreach COMMAND,$(COMMANDS),$(RUN_COMMAND))
|
||||
# The sort at this point is to remove duplicates
|
||||
$(foreach COMMAND,$(sort $(COMMANDS)),$(RUN_COMMAND))
|
||||
if [ -f $(ERROR_FILE) ]; then printf "$(MSG_ERRORS)" & exit 1; fi;
|
||||
$(foreach TEST,$(TESTS),$(RUN_TEST))
|
||||
$(foreach TEST,$(sort $(TESTS)),$(RUN_TEST))
|
||||
if [ -f $(ERROR_FILE) ]; then printf "$(MSG_ERRORS)" & exit 1; fi;
|
||||
|
||||
# These no longer work because of the colon system
|
||||
@ -576,6 +583,7 @@ lib/%:
|
||||
git submodule sync $?
|
||||
git submodule update --init $?
|
||||
|
||||
.PHONY: git-submodule
|
||||
git-submodule:
|
||||
git submodule sync --recursive
|
||||
git submodule update --init --recursive --progress
|
||||
|
@ -369,5 +369,7 @@ $(KEYBOARD_OUTPUT)_CONFIG := $(PROJECT_CONFIG)
|
||||
# Default target.
|
||||
all: build check-size
|
||||
build: elf cpfirmware
|
||||
check-size: build
|
||||
|
||||
include show_options.mk
|
||||
include $(TMK_PATH)/rules.mk
|
||||
|
@ -114,8 +114,27 @@ ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
|
||||
endif
|
||||
endif
|
||||
|
||||
RGB_MATRIX_ENABLE ?= no
|
||||
VALID_MATRIX_TYPES := yes IS31FL3731 IS31FL3733 custom
|
||||
|
||||
LED_MATRIX_ENABLE ?= no
|
||||
ifneq ($(strip $(LED_MATRIX_ENABLE)), no)
|
||||
ifeq ($(filter $(LED_MATRIX_ENABLE),$(VALID_MATRIX_TYPES)),)
|
||||
$(error LED_MATRIX_ENABLE="$(LED_MATRIX_ENABLE)" is not a valid matrix type)
|
||||
else
|
||||
OPT_DEFS += -DLED_MATRIX_ENABLE -DBACKLIGHT_ENABLE -DBACKLIGHT_CUSTOM_DRIVER
|
||||
SRC += $(QUANTUM_DIR)/led_matrix.c
|
||||
SRC += $(QUANTUM_DIR)/led_matrix_drivers.c
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(LED_MATRIX_ENABLE)), IS31FL3731)
|
||||
OPT_DEFS += -DIS31FL3731
|
||||
COMMON_VPATH += $(DRIVER_PATH)/issi
|
||||
SRC += is31fl3731-simple.c
|
||||
SRC += i2c_master.c
|
||||
endif
|
||||
|
||||
RGB_MATRIX_ENABLE ?= no
|
||||
ifneq ($(strip $(RGB_MATRIX_ENABLE)), no)
|
||||
ifeq ($(filter $(RGB_MATRIX_ENABLE),$(VALID_MATRIX_TYPES)),)
|
||||
$(error RGB_MATRIX_ENABLE="$(RGB_MATRIX_ENABLE)" is not a valid matrix type)
|
||||
@ -191,7 +210,7 @@ ifeq ($(strip $(BACKLIGHT_ENABLE)), yes)
|
||||
ifeq ($(strip $(VISUALIZER_ENABLE)), yes)
|
||||
CIE1931_CURVE = yes
|
||||
endif
|
||||
ifeq ($(strip $(BACKLIGHT_CUSTOM_DRIVER)), yes)
|
||||
ifeq ($(strip $(BACKLIGHT_CUSTOM_DRIVER)), yes)
|
||||
OPT_DEFS += -DBACKLIGHT_CUSTOM_DRIVER
|
||||
endif
|
||||
endif
|
||||
|
@ -40,6 +40,7 @@
|
||||
* [Unit Testing](unit_testing.md)
|
||||
* [Useful Functions](ref_functions.md)
|
||||
* [Configurator Support](reference_configurator_support.md)
|
||||
* [info.json Format](reference_info_json.md)
|
||||
|
||||
* [Features](features.md)
|
||||
* [Basic Keycodes](keycodes_basic.md)
|
||||
|
@ -37,6 +37,10 @@ SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2ff0", MODE:="066
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="feed", MODE:="0666"
|
||||
```
|
||||
|
||||
### Serial device is not detected in bootloader mode on Linux
|
||||
Make sure your kernel has appropriate support for your device. If your device uses USB ACM, such as
|
||||
Pro Micro (Atmega32u4), make sure to include `CONFIG_USB_ACM=y`. Other devices may require `USB_SERIAL` and any of its sub options.
|
||||
|
||||
## Unknown Device for DFU Bootloader
|
||||
|
||||
If you're using Windows to flash your keyboard, and you are running into issues, check the Device Manager. If you see an "Unknown Device" when the keyboard is in "bootloader mode", then you may have a driver issue.
|
||||
|
@ -21,7 +21,7 @@ Additionally, if at least one right-handed modifier is specified in a Mod Tap or
|
||||
|
||||
# Switching and Toggling Layers
|
||||
|
||||
These functions allow you to activate layers in various ways. Note that layers are not generally independent layouts -- multiple layers can be activated at once, and it's typical for layers to use `KC_TRNS` to allow keypresses to pass through to lower layers. For a detailed explanation of layers, see [Keymap Overview](keymap.md#keymap-and-layers) When using momentary layer switching with MO(), LM(), TT(), or LT(), make sure to leave the key on the above layers transparent or it may not work as intended.
|
||||
These functions allow you to activate layers in various ways. Note that layers are not generally independent layouts -- multiple layers can be activated at once, and it's typical for layers to use `KC_TRNS` to allow keypresses to pass through to lower layers. For a detailed explanation of layers, see [Keymap Overview](keymap.md#keymap-and-layers). When using momentary layer switching with MO(), LM(), TT(), or LT(), make sure to leave the key on the above layers transparent or it may not work as intended.
|
||||
|
||||
* `DF(layer)` - switches the default layer. The default layer is the always-active base layer that other layers stack on top of. See below for more about the default layer. This might be used to switch from QWERTY to Dvorak layout. (Note that this is a temporary switch that only persists until the keyboard loses power. To modify the default layer in a persistent way requires deeper customization, such as calling the `set_single_persistent_default_layer` function inside of [process_record_user](custom_quantum_functions.md#programming-the-behavior-of-any-keycode).)
|
||||
* `MO(layer)` - momentarily activates *layer*. As soon as you let go of the key, the layer is deactivated.
|
||||
@ -161,6 +161,81 @@ For one shot mods, you need to call `set_oneshot_mods(MOD)` to set it, or `clear
|
||||
|
||||
!> If you're having issues with OSM translating over Remote Desktop Connection, this can be fixed by opening the settings, going to the "Local Resources" tap, and in the keyboard section, change the drop down to "On this Computer". This will fix the issue and allow OSM to function properly over Remote Desktop.
|
||||
|
||||
## Callbacks
|
||||
|
||||
When you'd like to perform custom logic when pressing a one shot key, there are several callbacks you can choose to implement. You could indicate changes in one shot keys by flashing an LED or making a sound, for example.
|
||||
|
||||
There is a callback for `OSM(mod)`. It is called whenever the state of any one shot modifier key is changed: when it toggles on, but also when it is toggled off. You can use it like this:
|
||||
|
||||
```c
|
||||
void oneshot_mods_changed_user(uint8_t mods) {
|
||||
if (mods & MOD_MASK_SHIFT) {
|
||||
println("Oneshot mods SHIFT");
|
||||
}
|
||||
if (mods & MOD_MASK_CTRL) {
|
||||
println("Oneshot mods CTRL");
|
||||
}
|
||||
if (mods & MOD_MASK_ALT) {
|
||||
println("Oneshot mods ALT");
|
||||
}
|
||||
if (mods & MOD_MASK_GUI) {
|
||||
println("Oneshot mods GUI");
|
||||
}
|
||||
if (!mods) {
|
||||
println("Oneshot mods off");
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
The `mods` argument contains the active mods after the change, so it reflects the current state.
|
||||
|
||||
When you use One Shot Tap Toggle (by adding `#define ONESHOT_TAP_TOGGLE 2` in your `config.h` file), you may lock a modifier key by pressing it the specified amount of times. There's a callback for that, too:
|
||||
|
||||
```c
|
||||
void oneshot_locked_mods_changed_user(uint8_t mods) {
|
||||
if (mods & MOD_MASK_SHIFT) {
|
||||
println("Oneshot locked mods SHIFT");
|
||||
}
|
||||
if (mods & MOD_MASK_CTRL) {
|
||||
println("Oneshot locked mods CTRL");
|
||||
}
|
||||
if (mods & MOD_MASK_ALT) {
|
||||
println("Oneshot locked mods ALT");
|
||||
}
|
||||
if (mods & MOD_MASK_GUI) {
|
||||
println("Oneshot locked mods GUI");
|
||||
}
|
||||
if (!mods) {
|
||||
println("Oneshot locked mods off");
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Last, there is also a callback for the `OSL(layer)` one shot key:
|
||||
|
||||
```c
|
||||
void oneshot_layer_changed_user(uint8_t layer) {
|
||||
if (layer == 1) {
|
||||
println("Oneshot layer 1 on");
|
||||
}
|
||||
if (!layer) {
|
||||
println("Oneshot layer off");
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
If any one shot layer is switched off, `layer` will be zero. When you're looking to do something on any layer change instead of one shot layer changes, `layer_state_set_user` is a better callback to use.
|
||||
|
||||
If you are making your own keyboard, there are also `_kb` equivalent functions:
|
||||
|
||||
```c
|
||||
void oneshot_locked_mods_changed_kb(uint8_t mods);
|
||||
void oneshot_mods_changed_kb(uint8_t mods);
|
||||
void oneshot_layer_changed_kb(uint8_t layer);
|
||||
```
|
||||
|
||||
As with any callback, be sure to call the `_user` variant to allow for further customizability.
|
||||
|
||||
# Tap-Hold Configuration Options
|
||||
|
||||
While Tap-Hold options are fantastic, they are not without their issues. We have tried to configure them with reasonal defaults, but that may still cause issues for some people.
|
||||
|
@ -127,7 +127,9 @@ Additionally, you may want to specify which key to use. This is especially usef
|
||||
|
||||
By default, these are set to 0 and 0, which is usually the "ESC" key on a majority of keyboards.
|
||||
|
||||
And to trigger the bootloader, you hold this key down when plugging the keyboard in. Just the single key.
|
||||
And to trigger the bootloader, you hold this key down when plugging the keyboard in. Just the single key.
|
||||
|
||||
!> Using bootmagic lite will **always reset** the EEPROM, so you will lose any settings that have been saved.
|
||||
|
||||
## Advanced Bootmagic Lite
|
||||
|
||||
|
@ -29,7 +29,7 @@ If you want to add a list, then you'd use something like this:
|
||||
enum combos {
|
||||
AB_ESC,
|
||||
JK_TAB
|
||||
}
|
||||
};
|
||||
const uint16_t PROGMEM ab_combo[] = {KC_A, KC_B, COMBO_END};
|
||||
const uint16_t PROGMEM jk_combo[] = {KC_J, KC_K, COMBO_END};
|
||||
|
||||
|
90
docs/feature_led_matrix.md
Normal file
90
docs/feature_led_matrix.md
Normal file
@ -0,0 +1,90 @@
|
||||
# LED Matrix Lighting
|
||||
|
||||
This feature allows you to use LED matrices driven by external drivers. It hooks into the backlight system so you can use the same keycodes as backlighting to control it.
|
||||
|
||||
If you want to use RGB LED's you should use the [RGB Matrix Subsystem](feature_rgb_matrix.md) instead.
|
||||
|
||||
## Driver configuration
|
||||
|
||||
### IS31FL3731
|
||||
|
||||
There is basic support for addressable LED matrix lighting with the I2C IS31FL3731 RGB controller. To enable it, add this to your `rules.mk`:
|
||||
|
||||
LED_MATRIX_ENABLE = IS31FL3731
|
||||
|
||||
You can use between 1 and 4 IS31FL3731 IC's. Do not specify `LED_DRIVER_ADDR_<N>` defines for IC's that are not present on your keyboard. You can define the following items in `config.h`:
|
||||
|
||||
| Variable | Description | Default |
|
||||
|----------|-------------|---------|
|
||||
| `ISSI_TIMEOUT` | (Optional) How long to wait for i2c messages | 100 |
|
||||
| `ISSI_PERSISTENCE` | (Optional) Retry failed messages this many times | 0 |
|
||||
| `LED_DRIVER_COUNT` | (Required) How many LED driver IC's are present | |
|
||||
| `LED_DRIVER_LED_COUNT` | (Required) How many LED lights are present across all drivers | |
|
||||
| `LED_DRIVER_ADDR_1` | (Required) Address for the first LED driver | |
|
||||
| `LED_DRIVER_ADDR_2` | (Optional) Address for the second LED driver | |
|
||||
| `LED_DRIVER_ADDR_3` | (Optional) Address for the third LED driver | |
|
||||
| `LED_DRIVER_ADDR_4` | (Optional) Address for the fourth LED driver | |
|
||||
|
||||
Here is an example using 2 drivers.
|
||||
|
||||
// This is a 7-bit address, that gets left-shifted and bit 0
|
||||
// set to 0 for write, 1 for read (as per I2C protocol)
|
||||
// The address will vary depending on your wiring:
|
||||
// 0b1110100 AD <-> GND
|
||||
// 0b1110111 AD <-> VCC
|
||||
// 0b1110101 AD <-> SCL
|
||||
// 0b1110110 AD <-> SDA
|
||||
#define LED_DRIVER_ADDR_1 0b1110100
|
||||
#define LED_DRIVER_ADDR_2 0b1110110
|
||||
|
||||
#define LED_DRIVER_COUNT 2
|
||||
#define LED_DRIVER_1_LED_COUNT 25
|
||||
#define LED_DRIVER_2_LED_COUNT 24
|
||||
#define LED_DRIVER_LED_COUNT LED_DRIVER_1_LED_TOTAL + LED_DRIVER_2_LED_TOTAL
|
||||
|
||||
Currently only 2 drivers are supported, but it would be trivial to support all 4 combinations.
|
||||
|
||||
Define these arrays listing all the LEDs in your `<keyboard>.c`:
|
||||
|
||||
const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
|
||||
/* Refer to IS31 manual for these locations
|
||||
* driver
|
||||
* | LED address
|
||||
* | | */
|
||||
{0, C3_3},
|
||||
....
|
||||
}
|
||||
|
||||
Where `Cx_y` is the location of the LED in the matrix defined by [the datasheet](http://www.issi.com/WW/pdf/31FL3731.pdf) and the header file `drivers/issi/is31fl3731-simple.h`. The `driver` is the index of the driver you defined in your `config.h` (`0`, `1`, `2`, or `3` ).
|
||||
|
||||
## Keycodes
|
||||
|
||||
All LED matrix keycodes are currently shared with the [backlight system](feature_backlight.md).
|
||||
|
||||
## LED Matrix Effects
|
||||
|
||||
Currently no LED matrix effects have been created.
|
||||
|
||||
## Custom layer effects
|
||||
|
||||
Custom layer effects can be done by defining this in your `<keyboard>.c`:
|
||||
|
||||
void led_matrix_indicators_kb(void) {
|
||||
led_matrix_set_index_value(index, value);
|
||||
}
|
||||
|
||||
A similar function works in the keymap as `led_matrix_indicators_user`.
|
||||
|
||||
## Suspended state
|
||||
|
||||
To use the suspend feature, add this to your `<keyboard>.c`:
|
||||
|
||||
void suspend_power_down_kb(void)
|
||||
{
|
||||
led_matrix_set_suspend_state(true);
|
||||
}
|
||||
|
||||
void suspend_wakeup_init_kb(void)
|
||||
{
|
||||
led_matrix_set_suspend_state(false);
|
||||
}
|
@ -1,5 +1,9 @@
|
||||
# RGB Matrix Lighting
|
||||
|
||||
This feature allows you to use RGB LED matrices driven by external drivers. It hooks into the RGBLIGHT system so you can use the same keycodes as RGBLIGHT to control it.
|
||||
|
||||
If you want to use single color LED's you should use the [LED Matrix Subsystem](feature_led_matrix.md) instead.
|
||||
|
||||
## Driver configuration
|
||||
|
||||
### IS31FL3731
|
||||
|
@ -25,9 +25,13 @@ COMMAND_ENABLE = no
|
||||
|
||||
By default Space Cadet assumes a US ANSI layout, but if your layout uses different keys for parentheses, you can redefine them in your `config.h`.
|
||||
You can also disable the rollover, allowing you to use the opposite Shift key to cancel the Space Cadet state in the event of an erroneous press, instead of emitting a pair of parentheses when the keys are released.
|
||||
Also, by default, the Space Cadet applies modifiers LSPO_MOD and RSPC_MOD to keys defined by LSPO_KEY and RSPC_KEY. You can override this behavior by redefining those variables in your `config.h`. You can also prevent the Space Cadet to apply a modifier by defining DISABLE_SPACE_CADET_MODIFIER in your `config.h`.
|
||||
|
||||
|Define |Default |Description |
|
||||
|------------------------------|-------------|------------------------------------------------------------|
|
||||
|`LSPO_KEY` |`KC_9` |The keycode to send when Left Shift is tapped |
|
||||
|`RSPC_KEY` |`KC_0` |The keycode to send when Right Shift is tapped |
|
||||
|`DISABLE_SPACE_CADET_ROLLOVER`|*Not defined*|If defined, use the opposite Shift key to cancel Space Cadet|
|
||||
|Define |Default |Description |
|
||||
|------------------------------|-------------|--------------------------------------------------------------------------------|
|
||||
|`LSPO_KEY` |`KC_9` |The keycode to send when Left Shift is tapped |
|
||||
|`RSPC_KEY` |`KC_0` |The keycode to send when Right Shift is tapped |
|
||||
|`LSPO_MOD` |`KC_LSFT` |The keycode to send when Left Shift is tapped |
|
||||
|`RSPC_MOD` |`KC_RSFT` |The keycode to send when Right Shift is tapped |
|
||||
|`DISABLE_SPACE_CADET_ROLLOVER`|*Not defined*|If defined, use the opposite Shift key to cancel Space Cadet |
|
||||
|`DISABLE_SPACE_CADET_MODIFIER`|*Not defined*|If defined, prevent the Space Cadet to apply a modifier to LSPO_KEY and RSPC_KEY|
|
||||
|
@ -1,20 +1,104 @@
|
||||
# QMK Keyboard Guidelines
|
||||
|
||||
We welcome all keyboard projects into QMK, but ask that you try to stick to a couple guidelines that help us keep things organised and consistent.
|
||||
Since starting, QMK has grown by leaps and bounds thanks to people like you who contribute to creating and maintaining our community keyboards. As we've grown we've discovered some patterns that work well, and ask that you conform to them to make it easier for other people to benefit from your hard work.
|
||||
|
||||
|
||||
## Naming Your Keyboard/Project
|
||||
|
||||
All names should be lowercase alphanumeric, and separated by an underscore (`_`), but not begin with one. Your directory and your `.h` and `.c` files should have exactly the same name. All folders should follow the same format. `test`, `keyboard`, and `all` are reserved by make and are not a valid name for a keyboard.
|
||||
All keyboard names are in lower case, consisting only of letters, numbers, and underscore (`_`). Names may not begin with an underscore. Forward slash (`/`) is used as a sub-folder separation character.
|
||||
|
||||
## `readme.md`
|
||||
The names `test`, `keyboard`, and `all` are reserved for make commands and may not be used as a keyboard or subfolder name.
|
||||
|
||||
All projects need to have a `readme.md` file that explains what the keyboard is, who made it, where it is available, and links to more information. Please follow the [published template](documentation_templates.md#keyboard-readmemd-template).
|
||||
Valid Examples:
|
||||
|
||||
* `412_64`
|
||||
* `chimera_ortho`
|
||||
* `clueboard/66/rev3`
|
||||
* `planck`
|
||||
* `v60_type_r`
|
||||
|
||||
## Sub-folders
|
||||
|
||||
QMK uses sub-folders both for organization and to share code between revisions of the same keyboard. You can nest folders up to 4 levels deep:
|
||||
|
||||
qmk_firmware/keyboards/top_folder/sub_1/sub_2/sub_3/sub_4
|
||||
|
||||
If a sub-folder has a `rules.mk` file it will be considered a compilable keyboard. It will be available in QMK Configurator and tested with `make all`. If you are using a folder to organize several keyboards from the same maker you should not have a `rules.mk` file.
|
||||
|
||||
Example:
|
||||
|
||||
Clueboard uses sub-folders for both purposes, organization and keyboard revisions.
|
||||
|
||||
* [`qmk_firmware`](https://github.com/qmk/qmk_firmware/tree/master)
|
||||
* [`keyboards`](https://github.com/qmk/qmk_firmware/tree/master/keyboards)
|
||||
* [`clueboard`](https://github.com/qmk/qmk_firmware/tree/master/keyboards/clueboard) ← This is the organization folder, there's no `rules.mk` file
|
||||
* [`60`](https://github.com/qmk/qmk_firmware/tree/master/keyboards/clueboard/60) ← This is a compilable keyboard, it has a `rules.mk` file
|
||||
* [`66`](https://github.com/qmk/qmk_firmware/tree/master/keyboards/clueboard/66) ← This is also compilable- it uses `DEFAULT_FOLDER` to specify `rev3` as the default revision
|
||||
* [`rev1`](https://github.com/qmk/qmk_firmware/tree/master/keyboards/clueboard/66/rev1) ← compilable: `make clueboard/66/rev1`
|
||||
* [`rev2`](https://github.com/qmk/qmk_firmware/tree/master/keyboards/clueboard/66/rev2) ← compilable: `make clueboard/66/rev2`
|
||||
* [`rev3`](https://github.com/qmk/qmk_firmware/tree/master/keyboards/clueboard/66/rev3) ← compilable: `make clueboard/66/rev3` or `make clueboard/66`
|
||||
|
||||
## Keyboard Folder Structure
|
||||
|
||||
Your keyboard should be located in `qmk_firmware/keyboards/` and the folder name should be your keyboard's name as described in the previous section. Inside this folder should be several files:
|
||||
|
||||
* `readme.md`
|
||||
* `info.json`
|
||||
* `config.h`
|
||||
* `rules.mk`
|
||||
* `<keyboard_name>.c`
|
||||
* `<keyboard_name>.h`
|
||||
|
||||
### `readme.md`
|
||||
|
||||
All projects need to have a `readme.md` file that explains what the keyboard is, who made it and where it's available. If applicable, it should also contain links to more information, such as the maker's website. Please follow the [published template](documentation_templates.md#keyboard-readmemd-template).
|
||||
|
||||
### `info.json`
|
||||
|
||||
This file is used by the [QMK API](https://github.com/qmk/qmk_api). It contains the information [QMK Configurator](https://config.qmk.fm/) needs to display a representation of your keyboard. You can also set metadata here. For more information see the [reference page](reference_info_json.md).
|
||||
|
||||
### `config.h`
|
||||
|
||||
All projects need to have a `config.h` file that sets things like the matrix size, product name, USB VID/PID, description and other settings. In general, use this file to set essential information and defaults for your keyboard that will always work.
|
||||
|
||||
### `rules.mk`
|
||||
|
||||
The presence of this file means that the folder is a keyboard target and can be used in `make` commands. This is where you setup the build environment for your keyboard and configure the default set of features.
|
||||
|
||||
### `<keyboard_name.c>`
|
||||
|
||||
This is where you will write custom code for your keyboard. Typically you will write code to initialize and interface with the hardware in your keyboard. If your keyboard consists of only a key matrix with no LEDs, speakers, or other auxillary hardware this file can be blank.
|
||||
|
||||
The following functions are typically defined in this file:
|
||||
|
||||
* `void matrix_init_kb(void)`
|
||||
* `void matrix_scan_kb(void)`
|
||||
* `bool process_record_kb(uint16_t keycode, keyrecord_t *record)`
|
||||
* `void led_set_kb(uint8_t usb_led)`
|
||||
|
||||
### `<keyboard_name.h>`
|
||||
|
||||
This file is used to define the matrix for your keyboard. You should define at least one C macro which translates an array into a matrix representing the physical switch matrix for your keyboard. If it's possible to build your keyboard with multiple layouts you should define additional macros.
|
||||
|
||||
If you have only a single layout you should call this macro `LAYOUT`.
|
||||
|
||||
When defining multiple layouts you should have a base layout, named `LAYOUT_all`, that supports all possible switch positions on your matrix, even if that layout is impossible to build physically. This is the macro you should use in your `default` keymap. You should then have additional keymaps named `default_<layout>` that use your other layout macros. This will make it easier for people to use the layouts you define.
|
||||
|
||||
Layout macro names are entirely lowercase, except for the word `LAYOUT` at the front.
|
||||
|
||||
As an example, if you have a 60% PCB that supports ANSI and ISO you might define the following layouts and keymaps:
|
||||
|
||||
| Layout Name | Keymap Name | Description |
|
||||
|-------------|-------------|-------------|
|
||||
| LAYOUT_all | default | A layout that supports both ISO and ANSI |
|
||||
| LAYOUT_ansi | default_ansi | An ANSI layout |
|
||||
| LAYOUT_iso | default_iso | An ISO layout |
|
||||
|
||||
## Image/Hardware Files
|
||||
|
||||
In an effort to keep the repo size down, we're no longer accepting images of any format in the repo, with few exceptions. Hosting them elsewhere (imgur) and linking them in the `readme.md` is the preferred method.
|
||||
In an effort to keep the repo size down we're no longer accepting binary files of any format, with few exceptions. Hosting them elsewhere (such as <https://imgur.com>) and linking them in the `readme.md` is preferred.
|
||||
|
||||
Any sort of hardware file (plate, case, pcb) can't be stored in qmk_firmware, but we have the [qmk.fm repo](https://github.com/qmk/qmk.fm) where such files (as well as in-depth info) can be stored and viewed on [qmk.fm](http://qmk.fm). Downloadable files are stored in `/<keyboard>/` (name follows the same format as above) which are served at `http://qmk.fm/<keyboard>/`, and pages are generated from `/_pages/<keyboard>/` which are served at the same location (.md files are generated into .html files through Jekyll). Check out the `lets_split` directory for an example.
|
||||
Hardware files (such as plates, cases, pcb) can be contributed to the [qmk.fm repo](https://github.com/qmk/qmk.fm) and they will be made available on [qmk.fm](http://qmk.fm). Downloadable files are stored in `/<keyboard>/` (name follows the same format as above) which are served at `http://qmk.fm/<keyboard>/`, and pages are generated from `/_pages/<keyboard>/` which are served at the same location (.md files are generated into .html files through Jekyll). Check out the `lets_split` folder for an example.
|
||||
|
||||
## Keyboard Defaults
|
||||
|
||||
@ -32,77 +116,6 @@ If your keyboard does not have 2 shift keys you should provide a working default
|
||||
|
||||
As documented on [Customizing Functionality](custom_quantum_functions.md) you can define custom functions for your keyboard. Please keep in mind that your users may want to customize that behavior as well, and make it possible for them to do that. If you are providing a custom function, for example `process_record_kb()`, make sure that your function calls the `_user()` version of the call too. You should also take into account the return value of the `_user()` version, and only run your custom code if the user returns `true`.
|
||||
|
||||
## Keyboard Metadata
|
||||
|
||||
As QMK grows so does the ecosystem surrounding QMK. To make it easier for projects in that ecosystem to tie into QMK as we make changes we are developing a metadata system to expose information about keyboards in QMK.
|
||||
|
||||
You can create `info.json` files at every level under `qmk_firmware/keyboards/<name>` to specify this metadata. These files are combined, with more specific files overriding keys in less specific files. This means you do not need to duplicate your metadata information. For example, `qmk_firmware/keyboards/clueboard/info.json` specifies `manufacturer` and `maintainer`, while `qmk_firmware/keyboards/clueboard/66/info.json` specifies more specific information about Clueboard 66%.
|
||||
|
||||
### `info.json` Format
|
||||
|
||||
The `info.json` file is a JSON formatted dictionary with the following keys available to be set. You do not have to set all of them, merely the keys that apply to your keyboard.
|
||||
|
||||
* `keyboard_name`
|
||||
* A free-form text string describing the keyboard.
|
||||
* Example: `Clueboard 66%`
|
||||
* `url`
|
||||
* A URL to the keyboard's product page, [QMK.fm/keyboards](https://qmk.fm/keyboards) page, or other page describing information about the keyboard.
|
||||
* `maintainer`
|
||||
* GitHub username of the maintainer, or `qmk` for community maintained boards
|
||||
* `width`
|
||||
* Width of the board in Key Units
|
||||
* `height`
|
||||
* Height of the board in Key Units
|
||||
* `layouts`
|
||||
* Physical Layout representations. See the next section for more detail.
|
||||
|
||||
#### Layout Format
|
||||
|
||||
Within our `info.json` file the `layouts` portion of the dictionary contains several nested dictionaries. The outer layer consists of QMK layout macros, for example `LAYOUT_ansi` or `LAYOUT_iso`. Within each layout macro are keys for `width`, `height`, and `key_count`, each of which should be self-explanatory.
|
||||
|
||||
* `width`
|
||||
* Optional: The width of the layout in Key Units
|
||||
* `height`
|
||||
* Optional: The height of the layout in Key Units
|
||||
* `key_count`
|
||||
* **Required**: The number of keys in this layout
|
||||
* `layout`
|
||||
* A list of Key Dictionaries describing the physical layout. See the next section for more details.
|
||||
|
||||
#### Key Dictionary Format
|
||||
|
||||
Each Key Dictionary in a layout describes the physical properties of a key. If you are familiar with the Raw Code for <http://keyboard-layout-editor.com> you will find many of the concepts the same. We re-use the same key names and layout choices wherever possible, but unlike keyboard-layout-editor each key is stateless, inheriting no properties from the keys that came before it.
|
||||
|
||||
All key positions and rotations are specified in relation to the top-left corner of the keyboard, and the top-left corner of each key.
|
||||
|
||||
* `X`
|
||||
* **Required**: The absolute position of the key in the horizontal axis, in Key Units.
|
||||
* `Y`
|
||||
* **Required**: The absolute position of the key in the vertical axis, in Key Units.
|
||||
* `W`
|
||||
* The width of the key, in Key Units. Ignored if `ks` is provided. Default: `1`
|
||||
* `H`
|
||||
* The height of the key, in Key Units. Ignored if `ks` is provided. Default: `1`
|
||||
* `R`
|
||||
* How many degrees clockwise to rotate the key.
|
||||
* `RX`
|
||||
* The absolute position of the point to rotate the key around in the horizontal axis. Default: `x`
|
||||
* `RY`
|
||||
* The absolute position of the point to rotate the key around in the vertical axis. Default: `y`
|
||||
* `KS`
|
||||
* Key Shape: define a polygon by providing a list of points, in Key Units.
|
||||
* **Important**: These are relative to the top-left of the key, not absolute.
|
||||
* Example ISO Enter: `[ [0,0], [1.5,0], [1.5,2], [0.25,2], [0.25,1], [0,1], [0,0] ]`
|
||||
|
||||
### How is the Metadata Exposed?
|
||||
|
||||
This metadata is primarily used in two ways:
|
||||
|
||||
* To allow web-based configurators to dynamically generate UI
|
||||
* To support the new `make keyboard:keymap:qmk` target, which bundles this metadata up with the firmware to allow QMK Toolbox to be smarter.
|
||||
|
||||
Configurator authors can see the [QMK Compiler](https://docs.compile.qmk.fm/api_docs.html) docs for more information on using the JSON API.
|
||||
|
||||
## Non-Production/Handwired Projects
|
||||
|
||||
We're happy to accept any project that uses QMK, including prototypes and handwired ones, but we have a separate `/keyboards/handwired/` folder for them, so the main `/keyboards/` folder doesn't get overcrowded. If a prototype project becomes a production project at some point in the future, we'd be happy to move it to the main `/keyboards/` folder!
|
||||
|
@ -33,8 +33,8 @@ The following defines can be used to configure the I2C master driver.
|
||||
|
||||
|Variable |Description |Default|
|
||||
|------------------|---------------------------------------------------|-------|
|
||||
|`#F_SCL` |Clock frequency in Hz |400KHz |
|
||||
|`#Prescaler` |Divides master clock to aid in I2C clock selection |1 |
|
||||
|`F_SCL` |Clock frequency in Hz |400KHz |
|
||||
|`Prescaler` |Divides master clock to aid in I2C clock selection |1 |
|
||||
|
||||
AVRs usually have set GPIO which turn into I2C pins, therefore no further configuration is required.
|
||||
|
||||
@ -63,20 +63,24 @@ Lastly, we need to assign the correct GPIO pins depending on the I2C hardware dr
|
||||
|
||||
By default the I2C1 hardware driver is assumed to be used. If another hardware driver is used, `#define I2C_DRIVER I2CDX` should be added to the `config.h` file with X being the number of hardware driver used. For example is I2C3 is enabled, the `config.h` file should contain `#define I2C_DRIVER I2CD3`. This aligns the QMK I2C driver with the Chibios I2C driver.
|
||||
|
||||
STM32 MCUs allows a variety of pins to be configured as I2C pins depending on the hardware driver used. By default B6 and B7 are set to I2C.
|
||||
STM32 MCUs allows a variety of pins to be configured as I2C pins depending on the hardware driver used. By default B6 and B7 are set to I2C. You can use these defines to set your i2c pins:
|
||||
|
||||
This can be changed by declaring the `i2c_init` function which intentionally has a weak attribute. Please consult the datasheet of your MCU for the available GPIO configurations. The following is an example initialization function:
|
||||
| Variable | Description | Default |
|
||||
|-------------|----------------------------------------------|---------|
|
||||
| `I2C1_BANK` | The bank of pins (`GPIOA`, `GPIOB`, `GPIOC`) | `GPIOB` |
|
||||
| `I2C1_SCL` | The pin number for the SCL pin (0-9) | `6` |
|
||||
| `I2C1_SDA` | The pin number for the SDA pin (0-9) | `7` |
|
||||
|
||||
You can also overload the `void i2c_init(void)` function, which has a weak attribute. If you do this the configuration variables above will not be used. Please consult the datasheet of your MCU for the available GPIO configurations. The following is an example initialization function:
|
||||
|
||||
```C
|
||||
void i2c_init(void)
|
||||
{
|
||||
setPinInput(B6); // Try releasing special pins for a short time
|
||||
setPinInput(B7);
|
||||
chThdSleepMilliseconds(10); // Wait for the release to happen
|
||||
wait_ms(10); // Wait for the release to happen
|
||||
|
||||
palSetPadMode(GPIOB, 6, PAL_MODE_ALTERNATE(4) | PAL_STM32_OTYPE_OPENDRAIN | PAL_STM32_PUPDR_PULLUP); // Set B6 to I2C function
|
||||
palSetPadMode(GPIOB, 7, PAL_MODE_ALTERNATE(4) | PAL_STM32_OTYPE_OPENDRAIN | PAL_STM32_PUPDR_PULLUP); // Set B7 to I2C function
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
@ -6,10 +6,11 @@ Not sure if your keyboard can run QMK? If it's a mechanical keyboard you built y
|
||||
|
||||
## Overview
|
||||
|
||||
There are 6 main sections to this guide:
|
||||
There are 7 main sections to this guide:
|
||||
|
||||
* [Getting Started](newbs_getting_started.md)
|
||||
* [Building Your First Firmware](newbs_building_firmware.md)
|
||||
* [Building Your First Firmware using the command line](newbs_building_firmware.md)
|
||||
* [Building Your First Firmware using the online GUI](newbs_building_firmware_configurator.md)
|
||||
* [Flashing Firmware](newbs_flashing.md)
|
||||
* [Testing and Debugging](newbs_testing_debugging.md)
|
||||
* [Git Best Practices](newbs_best_practices.md)
|
||||
|
105
docs/newbs_building_firmware_configurator.md
Normal file
105
docs/newbs_building_firmware_configurator.md
Normal file
@ -0,0 +1,105 @@
|
||||
# QMK Configurator
|
||||
|
||||
The [QMK Configurator](https://config.qmk.fm) is an online graphical user interface that generates QMK Firmware hex files.
|
||||
|
||||
?> **Please follow these steps in order.**
|
||||
|
||||
Watch the [Video Tutorial](https://youtu.be/7RH-1pAbjvw)
|
||||
|
||||
The QMK Configurator works best with Chrome/Firefox.
|
||||
|
||||
|
||||
!> **Files from other tools such as KLE, or kbfirmware will not be compatible with QMK Configurator. Do not load them, do not import them. QMK Configurator is a DIFFERENT tool. **
|
||||
|
||||
## Selecting your keyboard
|
||||
|
||||
Click the drop down box and select the keyboard you want to create a keymap for.
|
||||
|
||||
?> If your keyboard has several versions, make sure you select the correct one.**
|
||||
|
||||
I'll say that again because it's important
|
||||
|
||||
!> **MAKE SURE YOU SELECT THE RIGHT VERSION!**
|
||||
|
||||
If your keyboard has been advertised to be powered by QMK but is not in the list, chances are a developer hasn't gotten to it yet or we haven't had a chance to merge it in yet. File an issue at [qmk_firmware](https://github.com/qmk/qmk_firmware/issues) requesting to support that particular keyboard, if there is no active [Pull Request](https://github.com/qmk/qmk_firmware/pulls?q=is%3Aopen+is%3Apr+label%3Akeyboard) for it. There are also QMK powered keyboards that are in their manufacturer's own github accounts. Double check for that as well.
|
||||
|
||||
## Selecting your keyboard layout
|
||||
|
||||
Choose the layout that best represents the keymap you want to create. Some keyboards do not have enough layouts or correct layouts defined yet. They will be supported in the future.
|
||||
|
||||
## Keymap Name
|
||||
|
||||
Call this keymap what you want.
|
||||
|
||||
?> If you are running into issues when compiling, it may be worth changing this name, as it may already exist in the QMK Firmware repo.
|
||||
|
||||
## Creating Your Keymap
|
||||
|
||||
Keycode Entry is accomplished in 3 ways.
|
||||
1. Drag and dropping
|
||||
2. Clicking on an empty spot on the layout and clicking the keycode you desire
|
||||
3. Clicking on an empty spot on the layout, pressing the physical key on your keyboard.
|
||||
|
||||
Hover your mouse over a key and a short blurb will tell you what that keycode does. For a more verbose description please see
|
||||
|
||||
[Basic Keycode Reference](https://docs.qmk.fm/#/keycodes_basic)
|
||||
[Advanced Keycode Reference](https://docs.qmk.fm/#/feature_advanced_keycodes)
|
||||
|
||||
In the event that you can't find a layout that supports your keymap, for example three spots for spacebar, or two spots for backspace, or 2 spots for shift etc etc, Fill them ALL up.
|
||||
|
||||
### Example:
|
||||
|
||||
3 spots for spacebar: Fill them ALL with spacebar
|
||||
|
||||
2 spots for backspace: Fill them BOTH with backspace
|
||||
|
||||
2 spots for right shift: Fill them BOTH with right shift
|
||||
|
||||
1 spot for left shift and 1 spot for iso support: Fill them both with left shift
|
||||
|
||||
5 spots, but only 4 keys: Guess and check or ask someone who has done it before.
|
||||
|
||||
## Saving Your Keymap for Future Edits
|
||||
|
||||
When you're satisfied with your keymap or just want to work on it later, press the `Export Keymap` button. It will save your keymap as the name you chose above appended with .json.
|
||||
|
||||
You can then load this .json file in the future by pressing the `Import Keymap` button.
|
||||
|
||||
!> **CAUTION:** This is not the same type of .json file used for kbfirmware.com or any other tool. If you try to use this for those tools, or the .json from those tools with QMK Configurator, there is a chance your keyboard will **explode**.
|
||||
|
||||
## Generating your firmware file
|
||||
|
||||
Press the green `Compile` button.
|
||||
|
||||
When the compilation is done, you will be able to press the green `Download Firmware` button.
|
||||
|
||||
## Flashing Your Keyboard
|
||||
|
||||
Please refer to [Flashing Firmware](newbs_flashing.md)
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
#### My .json file is not working
|
||||
|
||||
If the .json file was generated with QMK Configurator, congratulations you have stumbled upon a bug. File an issue at [qmk_configurator](https://github.com/qmk/qmk_configurator/issues)
|
||||
|
||||
If not....how did you miss my big bold message at the top saying not to use other .json files?
|
||||
|
||||
#### There are extra spaces in my layout? What do I do?
|
||||
|
||||
If you're referring to having three spots for space bar, the best course of action is to just fill them all with space bar. The same can be done for backspace and shifts
|
||||
|
||||
#### What is the keycode for.......
|
||||
|
||||
Please see
|
||||
|
||||
[Basic Keycode Reference](https://docs.qmk.fm/#/keycodes_basic)
|
||||
[Advanced Keycode Reference](https://docs.qmk.fm/#/feature_advanced_keycodes)
|
||||
|
||||
#### It won't compile
|
||||
|
||||
Please double check the other layers of your keymap to make sure there are no random keys present.
|
||||
|
||||
## Problems and Bugs
|
||||
|
||||
We are always accepting customer requests and bug reports. Please file them at [qmk_configurator](https://github.com/qmk/qmk_configurator/issues)
|
@ -6,7 +6,10 @@ QMK tries to put a lot of power into your hands by making easy things easy, and
|
||||
|
||||
# Getting Started
|
||||
|
||||
Before you can build keymaps, you need to install some software and set up your build environment. This only has to be done once no matter how many keyboards you plan to compile firmware for.
|
||||
Before you can build keymaps, you need to install some software and set up your build environment. This only has to be done once no matter how many keyboards you plan to compile firmware for.
|
||||
|
||||
If you would prefer a more graphical user interface approach, please consider using the online [QMK Configurator](https://config.qmk.fm). Please refer to [Building Your First Firmware using the online GUI](newbs_building_firmware_configurator.md).
|
||||
|
||||
|
||||
## Download Software
|
||||
|
||||
|
73
docs/reference_info_json.md
Normal file
73
docs/reference_info_json.md
Normal file
@ -0,0 +1,73 @@
|
||||
# `info.json`
|
||||
|
||||
This file is used by the [QMK API](https://github.com/qmk/qmk_api). It contains the information [QMK Configurator](https://config.qmk.fm/) needs to display a representation of your keyboard. You can also set metadata here.
|
||||
|
||||
You can create `info.json` files at every level under `qmk_firmware/keyboards/<name>` to specify this metadata. These files are combined, with more specific files overriding keys in less specific files. This means you do not need to duplicate your metadata information. For example, `qmk_firmware/keyboards/clueboard/info.json` specifies `manufacturer` and `maintainer`, while `qmk_firmware/keyboards/clueboard/66/info.json` specifies more specific information about Clueboard 66%.
|
||||
|
||||
## `info.json` Format
|
||||
|
||||
The `info.json` file is a JSON formatted dictionary with the following keys available to be set. You do not have to set all of them, merely the keys that apply to your keyboard.
|
||||
|
||||
* `keyboard_name`
|
||||
* A free-form text string describing the keyboard.
|
||||
* Example: `Clueboard 66%`
|
||||
* `url`
|
||||
* A URL to the keyboard's product page, [QMK.fm/keyboards](https://qmk.fm/keyboards) page, or other page describing information about the keyboard.
|
||||
* `maintainer`
|
||||
* GitHub username of the maintainer, or `qmk` for community maintained boards
|
||||
* `width`
|
||||
* Width of the board in Key Units
|
||||
* `height`
|
||||
* Height of the board in Key Units
|
||||
* `layouts`
|
||||
* Physical Layout representations. See the next section for more detail.
|
||||
|
||||
### Layout Format
|
||||
|
||||
Within our `info.json` file the `layouts` portion of the dictionary contains several nested dictionaries. The outer layer consists of QMK layout macros, for example `LAYOUT_ansi` or `LAYOUT_iso`. Within each layout macro are keys for `width`, `height`, and `key_count`, each of which should be self-explanatory.
|
||||
|
||||
* `width`
|
||||
* Optional: The width of the layout in Key Units
|
||||
* `height`
|
||||
* Optional: The height of the layout in Key Units
|
||||
* `key_count`
|
||||
* **Required**: The number of keys in this layout
|
||||
* `layout`
|
||||
* A list of Key Dictionaries describing the physical layout. See the next section for more details.
|
||||
|
||||
### Key Dictionary Format
|
||||
|
||||
Each Key Dictionary in a layout describes the physical properties of a key. If you are familiar with the Raw Code for <http://keyboard-layout-editor.com> you will find many of the concepts the same. We re-use the same key names and layout choices wherever possible, but unlike keyboard-layout-editor each key is stateless, inheriting no properties from the keys that came before it.
|
||||
|
||||
All key positions and rotations are specified in relation to the top-left corner of the keyboard, and the top-left corner of each key.
|
||||
|
||||
* `x`
|
||||
* **Required**: The absolute position of the key in the horizontal axis, in Key Units.
|
||||
* `y`
|
||||
* **Required**: The absolute position of the key in the vertical axis, in Key Units.
|
||||
* `w`
|
||||
* The width of the key, in Key Units. Ignored if `ks` is provided. Default: `1`
|
||||
* `h`
|
||||
* The height of the key, in Key Units. Ignored if `ks` is provided. Default: `1`
|
||||
* `r`
|
||||
* How many degrees clockwise to rotate the key.
|
||||
* `rx`
|
||||
* The absolute position of the point to rotate the key around in the horizontal axis. Default: `x`
|
||||
* `ry`
|
||||
* The absolute position of the point to rotate the key around in the vertical axis. Default: `y`
|
||||
* `ks`
|
||||
* Key Shape: define a polygon by providing a list of points, in Key Units.
|
||||
* **Important**: These are relative to the top-left of the key, not absolute.
|
||||
* Example ISO Enter: `[ [0,0], [1.5,0], [1.5,2], [0.25,2], [0.25,1], [0,1], [0,0] ]`
|
||||
* `label`
|
||||
* What to name this position in the matrix.
|
||||
* This should usually be the same name as what is silkscreened on the PCB at this location.
|
||||
|
||||
## How is the Metadata Exposed?
|
||||
|
||||
This metadata is primarily used in two ways:
|
||||
|
||||
* To allow web-based configurators to dynamically generate UI
|
||||
* To support the new `make keyboard:keymap:qmk` target, which bundles this metadata up with the firmware to allow QMK Toolbox to be smarter.
|
||||
|
||||
Configurator authors can see the [QMK Compiler](https://docs.api.qmk.fm/using-the-api) docs for more information on using the JSON API.
|
@ -46,13 +46,13 @@ __attribute__ ((weak))
|
||||
void i2c_init(void)
|
||||
{
|
||||
// Try releasing special pins for a short time
|
||||
palSetPadMode(GPIOB, 6, PAL_MODE_INPUT);
|
||||
palSetPadMode(GPIOB, 7, PAL_MODE_INPUT);
|
||||
palSetPadMode(I2C1_BANK, I2C1_SCL, PAL_MODE_INPUT);
|
||||
palSetPadMode(I2C1_BANK, I2C1_SDA, PAL_MODE_INPUT);
|
||||
|
||||
chThdSleepMilliseconds(10);
|
||||
|
||||
palSetPadMode(GPIOB, 6, PAL_MODE_ALTERNATE(4) | PAL_STM32_OTYPE_OPENDRAIN);
|
||||
palSetPadMode(GPIOB, 7, PAL_MODE_ALTERNATE(4) | PAL_STM32_OTYPE_OPENDRAIN);
|
||||
|
||||
palSetPadMode(I2C1_BANK, I2C1_SCL, PAL_MODE_ALTERNATE(4) | PAL_STM32_OTYPE_OPENDRAIN);
|
||||
palSetPadMode(I2C1_BANK, I2C1_SDA, PAL_MODE_ALTERNATE(4) | PAL_STM32_OTYPE_OPENDRAIN);
|
||||
|
||||
//i2cInit(); //This is invoked by halInit() so no need to redo it.
|
||||
}
|
||||
|
@ -26,6 +26,16 @@
|
||||
#include "ch.h"
|
||||
#include <hal.h>
|
||||
|
||||
#ifndef I2C1_BANK
|
||||
#define I2C1_BANK GPIOB
|
||||
#endif
|
||||
#ifndef I2C1_SCL
|
||||
#define I2C1_SCL 6
|
||||
#endif
|
||||
#ifndef I2C1_SDA
|
||||
#define I2C1_SDA 7
|
||||
#endif
|
||||
|
||||
#ifndef I2C_DRIVER
|
||||
#define I2C_DRIVER I2CD1
|
||||
#endif
|
||||
|
246
drivers/issi/is31fl3731-simple.c
Normal file
246
drivers/issi/is31fl3731-simple.c
Normal file
@ -0,0 +1,246 @@
|
||||
/* Copyright 2017 Jason Williams
|
||||
* Copyright 2018 Jack Humbert
|
||||
* Copyright 2019 Clueboard
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifdef __AVR__
|
||||
#include <avr/interrupt.h>
|
||||
#include <avr/io.h>
|
||||
#include <util/delay.h>
|
||||
#else
|
||||
#include "wait.h"
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
#include "is31fl3731-simple.h"
|
||||
#include "i2c_master.h"
|
||||
#include "progmem.h"
|
||||
#include "print.h"
|
||||
|
||||
// This is a 7-bit address, that gets left-shifted and bit 0
|
||||
// set to 0 for write, 1 for read (as per I2C protocol)
|
||||
// The address will vary depending on your wiring:
|
||||
// 0b1110100 AD <-> GND
|
||||
// 0b1110111 AD <-> VCC
|
||||
// 0b1110101 AD <-> SCL
|
||||
// 0b1110110 AD <-> SDA
|
||||
#define ISSI_ADDR_DEFAULT 0x74
|
||||
|
||||
#define ISSI_REG_CONFIG 0x00
|
||||
#define ISSI_REG_CONFIG_PICTUREMODE 0x00
|
||||
#define ISSI_REG_CONFIG_AUTOPLAYMODE 0x08
|
||||
#define ISSI_REG_CONFIG_AUDIOPLAYMODE 0x18
|
||||
|
||||
#define ISSI_CONF_PICTUREMODE 0x00
|
||||
#define ISSI_CONF_AUTOFRAMEMODE 0x04
|
||||
#define ISSI_CONF_AUDIOMODE 0x08
|
||||
|
||||
#define ISSI_REG_PICTUREFRAME 0x01
|
||||
|
||||
#define ISSI_REG_SHUTDOWN 0x0A
|
||||
#define ISSI_REG_AUDIOSYNC 0x06
|
||||
|
||||
#define ISSI_COMMANDREGISTER 0xFD
|
||||
#define ISSI_BANK_FUNCTIONREG 0x0B // helpfully called 'page nine'
|
||||
|
||||
#ifndef ISSI_TIMEOUT
|
||||
#define ISSI_TIMEOUT 100
|
||||
#endif
|
||||
|
||||
#ifndef ISSI_PERSISTENCE
|
||||
#define ISSI_PERSISTENCE 0
|
||||
#endif
|
||||
|
||||
// Transfer buffer for TWITransmitData()
|
||||
uint8_t g_twi_transfer_buffer[20];
|
||||
|
||||
// These buffers match the IS31FL3731 PWM registers 0x24-0xB3.
|
||||
// Storing them like this is optimal for I2C transfers to the registers.
|
||||
// We could optimize this and take out the unused registers from these
|
||||
// buffers and the transfers in IS31FL3731_write_pwm_buffer() but it's
|
||||
// probably not worth the extra complexity.
|
||||
uint8_t g_pwm_buffer[LED_DRIVER_COUNT][144];
|
||||
bool g_pwm_buffer_update_required = false;
|
||||
|
||||
/* There's probably a better way to init this... */
|
||||
#if LED_DRIVER_COUNT == 1
|
||||
uint8_t g_led_control_registers[LED_DRIVER_COUNT][18] = {{0}};
|
||||
#elif LED_DRIVER_COUNT == 2
|
||||
uint8_t g_led_control_registers[LED_DRIVER_COUNT][18] = {{0}, {0}};
|
||||
#elif LED_DRIVER_COUNT == 3
|
||||
uint8_t g_led_control_registers[LED_DRIVER_COUNT][18] = {{0}, {0}, {0}};
|
||||
#elif LED_DRIVER_COUNT == 4
|
||||
uint8_t g_led_control_registers[LED_DRIVER_COUNT][18] = {{0}, {0}, {0}, {0}};
|
||||
#endif
|
||||
bool g_led_control_registers_update_required = false;
|
||||
|
||||
// This is the bit pattern in the LED control registers
|
||||
// (for matrix A, add one to register for matrix B)
|
||||
//
|
||||
// reg - b7 b6 b5 b4 b3 b2 b1 b0
|
||||
// 0x00 - R08,R07,R06,R05,R04,R03,R02,R01
|
||||
// 0x02 - G08,G07,G06,G05,G04,G03,G02,R00
|
||||
// 0x04 - B08,B07,B06,B05,B04,B03,G01,G00
|
||||
// 0x06 - - , - , - , - , - ,B02,B01,B00
|
||||
// 0x08 - - , - , - , - , - , - , - , -
|
||||
// 0x0A - B17,B16,B15, - , - , - , - , -
|
||||
// 0x0C - G17,G16,B14,B13,B12,B11,B10,B09
|
||||
// 0x0E - R17,G15,G14,G13,G12,G11,G10,G09
|
||||
// 0x10 - R16,R15,R14,R13,R12,R11,R10,R09
|
||||
|
||||
|
||||
void IS31FL3731_write_register(uint8_t addr, uint8_t reg, uint8_t data) {
|
||||
g_twi_transfer_buffer[0] = reg;
|
||||
g_twi_transfer_buffer[1] = data;
|
||||
|
||||
#if ISSI_PERSISTENCE > 0
|
||||
for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) {
|
||||
if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT) == 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
#else
|
||||
i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT);
|
||||
#endif
|
||||
}
|
||||
|
||||
void IS31FL3731_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer) {
|
||||
// assumes bank is already selected
|
||||
|
||||
// transmit PWM registers in 9 transfers of 16 bytes
|
||||
// g_twi_transfer_buffer[] is 20 bytes
|
||||
|
||||
// iterate over the pwm_buffer contents at 16 byte intervals
|
||||
for (int i = 0; i < 144; i += 16) {
|
||||
// set the first register, e.g. 0x24, 0x34, 0x44, etc.
|
||||
g_twi_transfer_buffer[0] = 0x24 + i;
|
||||
// copy the data from i to i+15
|
||||
// device will auto-increment register for data after the first byte
|
||||
// thus this sets registers 0x24-0x33, 0x34-0x43, etc. in one transfer
|
||||
for (int j = 0; j < 16; j++) {
|
||||
g_twi_transfer_buffer[1 + j] = pwm_buffer[i + j];
|
||||
}
|
||||
|
||||
#if ISSI_PERSISTENCE > 0
|
||||
for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) {
|
||||
if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT) == 0)
|
||||
break;
|
||||
}
|
||||
#else
|
||||
i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
void IS31FL3731_init(uint8_t addr) {
|
||||
// In order to avoid the LEDs being driven with garbage data
|
||||
// in the LED driver's PWM registers, first enable software shutdown,
|
||||
// then set up the mode and other settings, clear the PWM registers,
|
||||
// then disable software shutdown.
|
||||
|
||||
// select "function register" bank
|
||||
IS31FL3731_write_register(addr, ISSI_COMMANDREGISTER, ISSI_BANK_FUNCTIONREG);
|
||||
|
||||
// enable software shutdown
|
||||
IS31FL3731_write_register(addr, ISSI_REG_SHUTDOWN, 0x00);
|
||||
// this delay was copied from other drivers, might not be needed
|
||||
wait_ms(10);
|
||||
|
||||
// picture mode
|
||||
IS31FL3731_write_register(addr, ISSI_REG_CONFIG, ISSI_REG_CONFIG_PICTUREMODE);
|
||||
// display frame 0
|
||||
IS31FL3731_write_register(addr, ISSI_REG_PICTUREFRAME, 0x00);
|
||||
// audio sync off
|
||||
IS31FL3731_write_register(addr, ISSI_REG_AUDIOSYNC, 0x00);
|
||||
|
||||
// select bank 0
|
||||
IS31FL3731_write_register(addr, ISSI_COMMANDREGISTER, 0);
|
||||
|
||||
// turn off all LEDs in the LED control register
|
||||
for (int i = 0x00; i <= 0x11; i++) {
|
||||
IS31FL3731_write_register(addr, i, 0x00);
|
||||
}
|
||||
|
||||
// turn off all LEDs in the blink control register (not really needed)
|
||||
for (int i = 0x12; i <= 0x23; i++) {
|
||||
IS31FL3731_write_register(addr, i, 0x00);
|
||||
}
|
||||
|
||||
// set PWM on all LEDs to 0
|
||||
for (int i = 0x24; i <= 0xB3; i++) {
|
||||
IS31FL3731_write_register(addr, i, 0x00);
|
||||
}
|
||||
|
||||
// select "function register" bank
|
||||
IS31FL3731_write_register(addr, ISSI_COMMANDREGISTER, ISSI_BANK_FUNCTIONREG);
|
||||
|
||||
// disable software shutdown
|
||||
IS31FL3731_write_register(addr, ISSI_REG_SHUTDOWN, 0x01);
|
||||
|
||||
// select bank 0 and leave it selected.
|
||||
// most usage after initialization is just writing PWM buffers in bank 0
|
||||
// as there's not much point in double-buffering
|
||||
IS31FL3731_write_register(addr, ISSI_COMMANDREGISTER, 0);
|
||||
|
||||
}
|
||||
|
||||
void IS31FL3731_set_value(int index, uint8_t value) {
|
||||
if (index >= 0 && index < LED_DRIVER_LED_COUNT) {
|
||||
is31_led led = g_is31_leds[index];
|
||||
|
||||
// Subtract 0x24 to get the second index of g_pwm_buffer
|
||||
g_pwm_buffer[led.driver][led.v - 0x24] = value;
|
||||
g_pwm_buffer_update_required = true;
|
||||
}
|
||||
}
|
||||
|
||||
void IS31FL3731_set_value_all(uint8_t value) {
|
||||
for (int i = 0; i < LED_DRIVER_LED_COUNT; i++) {
|
||||
IS31FL3731_set_value(i, value);
|
||||
}
|
||||
}
|
||||
|
||||
void IS31FL3731_set_led_control_register(uint8_t index, bool value) {
|
||||
is31_led led = g_is31_leds[index];
|
||||
|
||||
uint8_t control_register = (led.v - 0x24) / 8;
|
||||
uint8_t bit_value = (led.v - 0x24) % 8;
|
||||
|
||||
if (value) {
|
||||
g_led_control_registers[led.driver][control_register] |= (1 << bit_value);
|
||||
} else {
|
||||
g_led_control_registers[led.driver][control_register] &= ~(1 << bit_value);
|
||||
}
|
||||
|
||||
g_led_control_registers_update_required = true;
|
||||
}
|
||||
|
||||
void IS31FL3731_update_pwm_buffers(uint8_t addr, uint8_t index) {
|
||||
if (g_pwm_buffer_update_required) {
|
||||
IS31FL3731_write_pwm_buffer(addr, g_pwm_buffer[index]);
|
||||
g_pwm_buffer_update_required = false;
|
||||
}
|
||||
}
|
||||
|
||||
void IS31FL3731_update_led_control_registers(uint8_t addr, uint8_t index) {
|
||||
if (g_led_control_registers_update_required) {
|
||||
for (int i=0; i<18; i++) {
|
||||
IS31FL3731_write_register(addr, i, g_led_control_registers[index][i]);
|
||||
}
|
||||
}
|
||||
}
|
210
drivers/issi/is31fl3731-simple.h
Normal file
210
drivers/issi/is31fl3731-simple.h
Normal file
@ -0,0 +1,210 @@
|
||||
/* Copyright 2017 Jason Williams
|
||||
* Copyright 2018 Jack Humbert
|
||||
* Copyright 2019 Clueboard
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef IS31FL3731_DRIVER_H
|
||||
#define IS31FL3731_DRIVER_H
|
||||
|
||||
|
||||
typedef struct is31_led {
|
||||
uint8_t driver:2;
|
||||
uint8_t v;
|
||||
} __attribute__((packed)) is31_led;
|
||||
|
||||
extern const is31_led g_is31_leds[LED_DRIVER_LED_COUNT];
|
||||
|
||||
void IS31FL3731_init(uint8_t addr);
|
||||
void IS31FL3731_write_register(uint8_t addr, uint8_t reg, uint8_t data);
|
||||
void IS31FL3731_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer);
|
||||
|
||||
void IS31FL3731_set_value(int index, uint8_t value);
|
||||
void IS31FL3731_set_value_all(uint8_t value);
|
||||
|
||||
void IS31FL3731_set_led_control_register(uint8_t index, bool value);
|
||||
|
||||
// This should not be called from an interrupt
|
||||
// (eg. from a timer interrupt).
|
||||
// Call this while idle (in between matrix scans).
|
||||
// If the buffer is dirty, it will update the driver with the buffer.
|
||||
void IS31FL3731_update_pwm_buffers(uint8_t addr, uint8_t index);
|
||||
void IS31FL3731_update_led_control_registers(uint8_t addr, uint8_t index);
|
||||
|
||||
#define C1_1 0x24
|
||||
#define C1_2 0x25
|
||||
#define C1_3 0x26
|
||||
#define C1_4 0x27
|
||||
#define C1_5 0x28
|
||||
#define C1_6 0x29
|
||||
#define C1_7 0x2A
|
||||
#define C1_8 0x2B
|
||||
|
||||
#define C1_9 0x2C
|
||||
#define C1_10 0x2D
|
||||
#define C1_11 0x2E
|
||||
#define C1_12 0x2F
|
||||
#define C1_13 0x30
|
||||
#define C1_14 0x31
|
||||
#define C1_15 0x32
|
||||
#define C1_16 0x33
|
||||
|
||||
#define C2_1 0x34
|
||||
#define C2_2 0x35
|
||||
#define C2_3 0x36
|
||||
#define C2_4 0x37
|
||||
#define C2_5 0x38
|
||||
#define C2_6 0x39
|
||||
#define C2_7 0x3A
|
||||
#define C2_8 0x3B
|
||||
|
||||
#define C2_9 0x3C
|
||||
#define C2_10 0x3D
|
||||
#define C2_11 0x3E
|
||||
#define C2_12 0x3F
|
||||
#define C2_13 0x40
|
||||
#define C2_14 0x41
|
||||
#define C2_15 0x42
|
||||
#define C2_16 0x43
|
||||
|
||||
#define C3_1 0x44
|
||||
#define C3_2 0x45
|
||||
#define C3_3 0x46
|
||||
#define C3_4 0x47
|
||||
#define C3_5 0x48
|
||||
#define C3_6 0x49
|
||||
#define C3_7 0x4A
|
||||
#define C3_8 0x4B
|
||||
|
||||
#define C3_9 0x4C
|
||||
#define C3_10 0x4D
|
||||
#define C3_11 0x4E
|
||||
#define C3_12 0x4F
|
||||
#define C3_13 0x50
|
||||
#define C3_14 0x51
|
||||
#define C3_15 0x52
|
||||
#define C3_16 0x53
|
||||
|
||||
#define C4_1 0x54
|
||||
#define C4_2 0x55
|
||||
#define C4_3 0x56
|
||||
#define C4_4 0x57
|
||||
#define C4_5 0x58
|
||||
#define C4_6 0x59
|
||||
#define C4_7 0x5A
|
||||
#define C4_8 0x5B
|
||||
|
||||
#define C4_9 0x5C
|
||||
#define C4_10 0x5D
|
||||
#define C4_11 0x5E
|
||||
#define C4_12 0x5F
|
||||
#define C4_13 0x60
|
||||
#define C4_14 0x61
|
||||
#define C4_15 0x62
|
||||
#define C4_16 0x63
|
||||
|
||||
#define C5_1 0x64
|
||||
#define C5_2 0x65
|
||||
#define C5_3 0x66
|
||||
#define C5_4 0x67
|
||||
#define C5_5 0x68
|
||||
#define C5_6 0x69
|
||||
#define C5_7 0x6A
|
||||
#define C5_8 0x6B
|
||||
|
||||
#define C5_9 0x6C
|
||||
#define C5_10 0x6D
|
||||
#define C5_11 0x6E
|
||||
#define C5_12 0x6F
|
||||
#define C5_13 0x70
|
||||
#define C5_14 0x71
|
||||
#define C5_15 0x72
|
||||
#define C5_16 0x73
|
||||
|
||||
#define C6_1 0x74
|
||||
#define C6_2 0x75
|
||||
#define C6_3 0x76
|
||||
#define C6_4 0x77
|
||||
#define C6_5 0x78
|
||||
#define C6_6 0x79
|
||||
#define C6_7 0x7A
|
||||
#define C6_8 0x7B
|
||||
|
||||
#define C6_9 0x7C
|
||||
#define C6_10 0x7D
|
||||
#define C6_11 0x7E
|
||||
#define C6_12 0x7F
|
||||
#define C6_13 0x80
|
||||
#define C6_14 0x81
|
||||
#define C6_15 0x82
|
||||
#define C6_16 0x83
|
||||
|
||||
#define C7_1 0x84
|
||||
#define C7_2 0x85
|
||||
#define C7_3 0x86
|
||||
#define C7_4 0x87
|
||||
#define C7_5 0x88
|
||||
#define C7_6 0x89
|
||||
#define C7_7 0x8A
|
||||
#define C7_8 0x8B
|
||||
|
||||
#define C7_9 0x8C
|
||||
#define C7_10 0x8D
|
||||
#define C7_11 0x8E
|
||||
#define C7_12 0x8F
|
||||
#define C7_13 0x90
|
||||
#define C7_14 0x91
|
||||
#define C7_15 0x92
|
||||
#define C7_16 0x93
|
||||
|
||||
#define C8_1 0x94
|
||||
#define C8_2 0x95
|
||||
#define C8_3 0x96
|
||||
#define C8_4 0x97
|
||||
#define C8_5 0x98
|
||||
#define C8_6 0x99
|
||||
#define C8_7 0x9A
|
||||
#define C8_8 0x9B
|
||||
|
||||
#define C8_9 0x9C
|
||||
#define C8_10 0x9D
|
||||
#define C8_11 0x9E
|
||||
#define C8_12 0x9F
|
||||
#define C8_13 0xA0
|
||||
#define C8_14 0xA1
|
||||
#define C8_15 0xA2
|
||||
#define C8_16 0xA3
|
||||
|
||||
#define C9_1 0xA4
|
||||
#define C9_2 0xA5
|
||||
#define C9_3 0xA6
|
||||
#define C9_4 0xA7
|
||||
#define C9_5 0xA8
|
||||
#define C9_6 0xA9
|
||||
#define C9_7 0xAA
|
||||
#define C9_8 0xAB
|
||||
|
||||
#define C9_9 0xAC
|
||||
#define C9_10 0xAD
|
||||
#define C9_11 0xAE
|
||||
#define C9_12 0xAF
|
||||
#define C9_13 0xB0
|
||||
#define C9_14 0xB1
|
||||
#define C9_15 0xB2
|
||||
#define C9_16 0xB3
|
||||
|
||||
|
||||
#endif // IS31FL3731_DRIVER_H
|
@ -28,6 +28,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "micro_oled.h"
|
||||
#include <print.h>
|
||||
#include <stdlib.h>
|
||||
#include "util/font5x7.h"
|
||||
#include "util/font8x16.h"
|
||||
@ -309,12 +310,11 @@ static uint8_t micro_oled_screen_buffer[] = {
|
||||
#else
|
||||
//catchall for custom screen szies
|
||||
static uint8_t micro_oled_screen_buffer[LCDWIDTH*LCDWIDTH/8] = {0};
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
void micro_oled_init(void) {
|
||||
|
||||
i2c_init();
|
||||
i2c_start(I2C_ADDRESS_SA0_1);
|
||||
|
||||
|
18
keyboards/1upkeyboards/1up60hte/1up60hte.c
Normal file
18
keyboards/1upkeyboards/1up60hte/1up60hte.c
Normal file
@ -0,0 +1,18 @@
|
||||
/*
|
||||
Copyright 2019 Bubnick
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "1up60hte.h"
|
50
keyboards/1upkeyboards/1up60hte/1up60hte.h
Normal file
50
keyboards/1upkeyboards/1up60hte/1up60hte.h
Normal file
@ -0,0 +1,50 @@
|
||||
/*
|
||||
Copyright 2019 Bubnick
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "quantum.h"
|
||||
|
||||
#define LAYOUT_all( \
|
||||
K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, \
|
||||
K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, \
|
||||
K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, \
|
||||
K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, \
|
||||
K400, K401, K402, K406, K410, K411, K412, K413 \
|
||||
) { \
|
||||
{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013 }, \
|
||||
{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113 }, \
|
||||
{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, KC_NO }, \
|
||||
{ K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, KC_NO }, \
|
||||
{ K400, K401, K402, KC_NO, KC_NO, KC_NO, K406, KC_NO, KC_NO, KC_NO, K410, K411, K412, K413 } \
|
||||
}
|
||||
|
||||
/* HHKB Variant */
|
||||
#define LAYOUT_60_hhkb( \
|
||||
K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, \
|
||||
K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, \
|
||||
K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, \
|
||||
K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, \
|
||||
K401, K402, K406, K410, K411, K413 \
|
||||
) { \
|
||||
{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013 }, \
|
||||
{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113 }, \
|
||||
{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, KC_NO }, \
|
||||
{ K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, KC_NO }, \
|
||||
{ KC_NO, K401, K402, KC_NO, KC_NO, KC_NO, K406, KC_NO, KC_NO, KC_NO, K410, K411, KC_NO, K413 } \
|
||||
}
|
||||
|
65
keyboards/1upkeyboards/1up60hte/config.h
Normal file
65
keyboards/1upkeyboards/1up60hte/config.h
Normal file
@ -0,0 +1,65 @@
|
||||
/*
|
||||
Copyright 2019 Bubnick
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "config_common.h"
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define VENDOR_ID 0xFEED
|
||||
#define PRODUCT_ID 0x6060
|
||||
#define DEVICE_VER 0x0001
|
||||
#define MANUFACTURER 1upkeyboards
|
||||
#define PRODUCT 1up60hte
|
||||
#define DESCRIPTION A custom 60% keyboard
|
||||
|
||||
/* key matrix size */
|
||||
#define MATRIX_ROWS 5
|
||||
#define MATRIX_COLS 14
|
||||
|
||||
/* key matrix pins */
|
||||
#define MATRIX_ROW_PINS { B3, B2, B1, B0, D4 }
|
||||
#define MATRIX_COL_PINS { F6, F5, F4, F1, E6, D0, D1, D2, D3, D5, D6, D7, B4, B5 }
|
||||
#define UNUSED_PINS
|
||||
|
||||
/* COL2ROW or ROW2COL */
|
||||
#define DIODE_DIRECTION COL2ROW
|
||||
|
||||
/* number of backlight levels */
|
||||
#define BACKLIGHT_PIN B7
|
||||
#ifdef BACKLIGHT_PIN
|
||||
#define BACKLIGHT_LEVELS 3
|
||||
#endif
|
||||
|
||||
/* Set 0 if debouncing isn't needed */
|
||||
#define DEBOUNCING_DELAY 5
|
||||
|
||||
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
||||
#define LOCKING_SUPPORT_ENABLE
|
||||
|
||||
/* Locking resynchronize hack */
|
||||
#define LOCKING_RESYNC_ENABLE
|
||||
|
||||
#define RGB_DI_PIN F0
|
||||
#ifdef RGB_DI_PIN
|
||||
#define RGBLIGHT_ANIMATIONS
|
||||
#define RGBLED_NUM 14
|
||||
#define RGBLIGHT_HUE_STEP 8
|
||||
#define RGBLIGHT_SAT_STEP 8
|
||||
#define RGBLIGHT_VAL_STEP 8
|
||||
#endif
|
80
keyboards/1upkeyboards/1up60hte/keymaps/default/keymap.c
Normal file
80
keyboards/1upkeyboards/1up60hte/keymaps/default/keymap.c
Normal file
@ -0,0 +1,80 @@
|
||||
/*
|
||||
Copyright 2019 Bubnick
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
[0] = LAYOUT_all(
|
||||
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_GRV,
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS,
|
||||
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT, KC_NO,
|
||||
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_LALT, KC_LGUI, KC_LCTL, KC_BSPC),
|
||||
|
||||
[1] = LAYOUT_all(
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS)
|
||||
|
||||
};
|
||||
|
||||
void matrix_init_user(void) {
|
||||
setPinOutput(B6);
|
||||
}
|
||||
|
||||
void matrix_scan_user(void) {
|
||||
}
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
return true;
|
||||
}
|
||||
|
||||
void led_set_user(uint8_t usb_led) {
|
||||
|
||||
if (usb_led & (1 << USB_LED_NUM_LOCK)) {
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
|
||||
writePinLow(B6);
|
||||
} else {
|
||||
writePinHigh(B6);
|
||||
}
|
||||
|
||||
if (usb_led & (1 << USB_LED_SCROLL_LOCK)) {
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
if (usb_led & (1 << USB_LED_COMPOSE)) {
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
if (usb_led & (1 << USB_LED_KANA)) {
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
}
|
79
keyboards/1upkeyboards/1up60hte/keymaps/hhkb/keymap.c
Normal file
79
keyboards/1upkeyboards/1up60hte/keymaps/hhkb/keymap.c
Normal file
@ -0,0 +1,79 @@
|
||||
/*
|
||||
Copyright 2019 Bubnick
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
[0] = LAYOUT_all(
|
||||
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_GRV,
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS,
|
||||
KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT, MO(1),
|
||||
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_LALT, KC_LGUI, KC_LCTL, KC_BSPC),
|
||||
|
||||
[1] = LAYOUT_all(
|
||||
RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS,
|
||||
KC_CAPS, BL_TOGG, BL_DEC, BL_INC, BL_STEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_SLCK, KC_PAUS, KC_UP, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_MPLY, KC_MPRV, KC_MNXT, RGB_VAD, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_TRNS,
|
||||
KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, KC_END, KC_PGDN, KC_DOWN, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL)
|
||||
};
|
||||
|
||||
void matrix_init_user(void) {
|
||||
setPinOutput(B6);
|
||||
}
|
||||
|
||||
void matrix_scan_user(void) {
|
||||
}
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
return true;
|
||||
}
|
||||
|
||||
void led_set_user(uint8_t usb_led) {
|
||||
|
||||
if (usb_led & (1 << USB_LED_NUM_LOCK)) {
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
|
||||
writePinLow(B6);
|
||||
} else {
|
||||
writePinHigh(B6);
|
||||
}
|
||||
|
||||
if (usb_led & (1 << USB_LED_SCROLL_LOCK)) {
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
if (usb_led & (1 << USB_LED_COMPOSE)) {
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
if (usb_led & (1 << USB_LED_KANA)) {
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
}
|
18
keyboards/1upkeyboards/1up60hte/readme.md
Normal file
18
keyboards/1upkeyboards/1up60hte/readme.md
Normal file
@ -0,0 +1,18 @@
|
||||
|
||||
# 1up60hte (Hot Swap Tsangan Edition)
|
||||
|
||||

|
||||
|
||||
|
||||
A 60% PCB with USB C, RGB underglow, backlighting, hotswappable switches, and a Tsangan layout.
|
||||
|
||||
Keyboard Maintainer: [Bubnick](https://github.com/bubnick)
|
||||
Hardware Supported: 1up60hte 60% PCB
|
||||
|
||||
Hardware Availability: [1upkeyboards.com](https://www.1upkeyboards.com/shop/controllers/1up-rgb-60-pcb-hte/)
|
||||
|
||||
Make example for this keyboard (after setting up your build environment):
|
||||
|
||||
make 1upkeyboards/1up60hte:default
|
||||
|
||||
See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user