resolved conflicts

This commit is contained in:
William Chang 2019-05-09 21:16:06 -07:00
commit 4b2d3288d0
671 changed files with 22563 additions and 11435 deletions

1
.gitignore vendored
View File

@ -54,6 +54,7 @@ util/Win_Check_Output.txt
.vscode/tasks.json .vscode/tasks.json
.vscode/last.sql .vscode/last.sql
.vscode/temp.sql .vscode/temp.sql
.vscode/ipch/
.stfolder .stfolder
.tags .tags

View File

@ -13,10 +13,14 @@ env:
- MAKEFLAGS="-j3 --output-sync" - MAKEFLAGS="-j3 --output-sync"
before_install: before_install:
- wget http://ww1.microchip.com/downloads/en/DeviceDoc/avr8-gnu-toolchain-3.5.4.1709-linux.any.x86_64.tar.gz || wget http://qmk.fm/avr8-gnu-toolchain-3.5.4.1709-linux.any.x86_64.tar.gz - wget http://ww1.microchip.com/downloads/en/DeviceDoc/avr8-gnu-toolchain-3.5.4.1709-linux.any.x86_64.tar.gz || wget http://qmk.fm/avr8-gnu-toolchain-3.5.4.1709-linux.any.x86_64.tar.gz
# Need DFU > .5 for dfu-suffix
- sudo add-apt-repository --yes ppa:tormodvolden/ppa
- sudo apt-get update -qq
install: install:
- tar -zxf avr8-gnu-toolchain-3.5.4.1709-linux.any.x86_64.tar.gz - tar -zxf avr8-gnu-toolchain-3.5.4.1709-linux.any.x86_64.tar.gz
- export PATH="$PATH:$TRAVIS_BUILD_DIR/avr8-gnu-toolchain-linux_x86_64/bin" - export PATH="$PATH:$TRAVIS_BUILD_DIR/avr8-gnu-toolchain-linux_x86_64/bin"
- npm install -g moxygen - npm install -g moxygen
- sudo apt-get -y --force-yes install dfu-util
before_script: before_script:
- avr-gcc --version - avr-gcc --version
script: script:

View File

@ -534,6 +534,8 @@ endef
%: %:
# Check if we have the CMP tool installed # Check if we have the CMP tool installed
cmp $(ROOT_DIR)/Makefile $(ROOT_DIR)/Makefile >/dev/null 2>&1; if [ $$? -gt 0 ]; then printf "$(MSG_NO_CMP)"; exit 1; fi; cmp $(ROOT_DIR)/Makefile $(ROOT_DIR)/Makefile >/dev/null 2>&1; if [ $$? -gt 0 ]; then printf "$(MSG_NO_CMP)"; exit 1; fi;
# Ensure that python3 is installed. This check can be removed after python is used in more places.
if ! python3 --version 1> /dev/null 2>&1; then printf "$(MSG_PYTHON_MISSING)"; fi
# Check if the submodules are dirty, and display a warning if they are # Check if the submodules are dirty, and display a warning if they are
ifndef SKIP_GIT ifndef SKIP_GIT
if [ ! -e lib/chibios ]; then git submodule sync lib/chibios && git submodule update --depth 1 --init lib/chibios; fi if [ ! -e lib/chibios ]; then git submodule sync lib/chibios && git submodule update --depth 1 --init lib/chibios; fi

View File

@ -324,7 +324,6 @@ ifneq ("$(wildcard $(KEYMAP_PATH)/config.h)","")
endif endif
# # project specific files # # project specific files
SRC += $(patsubst %.c,%.clib,$(LIB_SRC))
SRC += $(KEYBOARD_SRC) \ SRC += $(KEYBOARD_SRC) \
$(KEYMAP_C) \ $(KEYMAP_C) \
$(QUANTUM_SRC) $(QUANTUM_SRC)
@ -334,15 +333,16 @@ SRC += $(KEYBOARD_SRC) \
# Search Path # Search Path
VPATH += $(KEYMAP_PATH) VPATH += $(KEYMAP_PATH)
VPATH += $(USER_PATH)
VPATH += $(KEYBOARD_PATHS) VPATH += $(KEYBOARD_PATHS)
VPATH += $(COMMON_VPATH) VPATH += $(COMMON_VPATH)
VPATH += $(USER_PATH)
include common_features.mk include common_features.mk
include $(TMK_PATH)/protocol.mk include $(TMK_PATH)/protocol.mk
include $(TMK_PATH)/common.mk include $(TMK_PATH)/common.mk
include bootloader.mk include bootloader.mk
SRC += $(patsubst %.c,%.clib,$(LIB_SRC))
SRC += $(patsubst %.c,%.clib,$(QUANTUM_LIB_SRC)) SRC += $(patsubst %.c,%.clib,$(QUANTUM_LIB_SRC))
SRC += $(TMK_COMMON_SRC) SRC += $(TMK_COMMON_SRC)
OPT_DEFS += $(TMK_COMMON_DEFS) OPT_DEFS += $(TMK_COMMON_DEFS)

View File

@ -105,6 +105,7 @@ endif
ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
POST_CONFIG_H += $(QUANTUM_DIR)/rgblight_post_config.h POST_CONFIG_H += $(QUANTUM_DIR)/rgblight_post_config.h
OPT_DEFS += -DRGBLIGHT_ENABLE OPT_DEFS += -DRGBLIGHT_ENABLE
SRC += $(QUANTUM_DIR)/color.c
SRC += $(QUANTUM_DIR)/rgblight.c SRC += $(QUANTUM_DIR)/rgblight.c
CIE1931_CURVE = yes CIE1931_CURVE = yes
LED_BREATHING_TABLE = yes LED_BREATHING_TABLE = yes
@ -178,6 +179,14 @@ ifeq ($(strip $(RGB_MATRIX_ENABLE)), WS2812)
SRC += ws2812.c SRC += ws2812.c
endif endif
ifeq ($(strip $(RGB_MATRIX_CUSTOM_KB)), yes)
OPT_DEFS += -DRGB_MATRIX_CUSTOM_KB
endif
ifeq ($(strip $(RGB_MATRIX_CUSTOM_USER)), yes)
OPT_DEFS += -DRGB_MATRIX_CUSTOM_USER
endif
ifeq ($(strip $(TAP_DANCE_ENABLE)), yes) ifeq ($(strip $(TAP_DANCE_ENABLE)), yes)
OPT_DEFS += -DTAP_DANCE_ENABLE OPT_DEFS += -DTAP_DANCE_ENABLE
SRC += $(QUANTUM_DIR)/process_keycode/process_tap_dance.c SRC += $(QUANTUM_DIR)/process_keycode/process_tap_dance.c
@ -343,3 +352,9 @@ ifeq ($(strip $(OLED_DRIVER_ENABLE)), yes)
QUANTUM_LIB_SRC += i2c_master.c QUANTUM_LIB_SRC += i2c_master.c
SRC += oled_driver.c SRC += oled_driver.c
endif endif
SPACE_CADET_ENABLE ?= yes
ifeq ($(strip $(SPACE_CADET_ENABLE)), yes)
SRC += $(QUANTUM_DIR)/process_keycode/process_space_cadet.c
OPT_DEFS += -DSPACE_CADET_ENABLE
endif

View File

@ -63,13 +63,13 @@
* [LED Matrix](feature_led_matrix.md) * [LED Matrix](feature_led_matrix.md)
* [Macros](feature_macros.md) * [Macros](feature_macros.md)
* [Mouse Keys](feature_mouse_keys.md) * [Mouse Keys](feature_mouse_keys.md)
* [OLED Driver](feature_oled_driver)
* [One Shot Keys](feature_advanced_keycodes.md#one-shot-keys) * [One Shot Keys](feature_advanced_keycodes.md#one-shot-keys)
* [Pointing Device](feature_pointing_device.md) * [Pointing Device](feature_pointing_device.md)
* [PS/2 Mouse](feature_ps2_mouse.md) * [PS/2 Mouse](feature_ps2_mouse.md)
* [RGB Lighting](feature_rgblight.md) * [RGB Lighting](feature_rgblight.md)
* [RGB Matrix](feature_rgb_matrix.md) * [RGB Matrix](feature_rgb_matrix.md)
* [Space Cadet Shift](feature_space_cadet_shift.md) * [Space Cadet](feature_space_cadet.md)
* [Space Cadet Shift Enter](feature_space_cadet_shift_enter.md)
* [Stenography](feature_stenography.md) * [Stenography](feature_stenography.md)
* [Swap Hands](feature_swap_hands.md) * [Swap Hands](feature_swap_hands.md)
* [Tap Dance](feature_tap_dance.md) * [Tap Dance](feature_tap_dance.md)

View File

@ -330,6 +330,8 @@ Use these to enable or disable building certain features. The more you have enab
* Forces the keyboard to wait for a USB connection to be established before it starts up * Forces the keyboard to wait for a USB connection to be established before it starts up
* `NO_USB_STARTUP_CHECK` * `NO_USB_STARTUP_CHECK`
* Disables usb suspend check after keyboard startup. Usually the keyboard waits for the host to wake it up before any tasks are performed. This is useful for split keyboards as one half will not get a wakeup call but must send commands to the master. * Disables usb suspend check after keyboard startup. Usually the keyboard waits for the host to wake it up before any tasks are performed. This is useful for split keyboards as one half will not get a wakeup call but must send commands to the master.
* `LINK_TIME_OPTIMIZATION_ENABLE`
= Enables Link Time Optimization (`LTO`) when compiling the keyboard. This makes the process take longer, but can significantly reduce the compiled size (and since the firmware is small, the added time is not noticable). However, this will automatically disable the old Macros and Functions features automatically, as these break when `LTO` is enabled. It does this by automatically defining `NO_ACTION_MACRO` and `NO_ACTION_FUNCTION`
## USB Endpoint Limitations ## USB Endpoint Limitations

View File

@ -30,7 +30,31 @@ You should then be able to use the keycodes below to change the backlight level.
This feature is distinct from both the [RGB underglow](feature_rgblight.md) and [RGB matrix](feature_rgb_matrix.md) features as it usually allows for only a single colour per switch, though you can obviously use multiple different coloured LEDs on a keyboard. This feature is distinct from both the [RGB underglow](feature_rgblight.md) and [RGB matrix](feature_rgb_matrix.md) features as it usually allows for only a single colour per switch, though you can obviously use multiple different coloured LEDs on a keyboard.
Hardware PWM is only supported on certain pins of the MCU, so if the backlighting is not connected to one of them, a software implementation will be used, and backlight breathing will not be available. Currently the supported pins are `B5`, `B6`, `B7`, and `C6`. Hardware PWM is only supported on certain pins of the MCU, so if the backlighting is not connected to one of them, a software PWM implementation triggered by hardware timer interrupts will be used.
Hardware PWM is supported according to the following table:
| Backlight Pin | Hardware timer |
|---------------|----------------|
|`B5` | Timer 1 |
|`B6` | Timer 1 |
|`B7` | Timer 1 |
|`C6` | Timer 3 |
| other | Software PWM |
The [audio feature](feature_audio.md) also uses hardware timers. Please refer to the following table to know what hardware timer the software PWM will use depending on the audio configuration:
| Audio Pin(s) | Audio Timer | Software PWM Timer |
|--------------|-------------|--------------------|
| `C4` | Timer 3 | Timer 1 |
| `C5` | Timer 3 | Timer 1 |
| `C6` | Timer 3 | Timer 1 |
| `B5` | Timer 1 | Timer 3 |
| `B6` | Timer 1 | Timer 3 |
| `B7` | Timer 1 | Timer 3 |
| `Bx` & `Cx` | Timer 1 & 3 | None |
When all timers are in use for [audio](feature_audio.md), the backlight software PWM will not use a hardware timer, but instead will be triggered during the matrix scan. In this case the backlight doesn't support breathing and might show lighting artifacts (for instance flickering), because the PWM computation might not be called with enough timing precision.
## Configuration ## Configuration
@ -39,11 +63,26 @@ To change the behaviour of the backlighting, `#define` these in your `config.h`:
|Define |Default |Description | |Define |Default |Description |
|---------------------|-------------|-------------------------------------------------------------------------------------------------------------| |---------------------|-------------|-------------------------------------------------------------------------------------------------------------|
|`BACKLIGHT_PIN` |`B7` |The pin that controls the LEDs. Unless you are designing your own keyboard, you shouldn't need to change this| |`BACKLIGHT_PIN` |`B7` |The pin that controls the LEDs. Unless you are designing your own keyboard, you shouldn't need to change this|
|`BACKLIGHT_PINS` |*Not defined*|experimental: see below for more information|
|`BACKLIGHT_LEVELS` |`3` |The number of brightness levels (maximum 15 excluding off) | |`BACKLIGHT_LEVELS` |`3` |The number of brightness levels (maximum 15 excluding off) |
|`BACKLIGHT_CAPS_LOCK`|*Not defined*|Enable Caps Lock indicator using backlight (for keyboards without dedicated LED) | |`BACKLIGHT_CAPS_LOCK`|*Not defined*|Enable Caps Lock indicator using backlight (for keyboards without dedicated LED) |
|`BACKLIGHT_BREATHING`|*Not defined*|Enable backlight breathing, if hardware PWM is used | |`BACKLIGHT_BREATHING`|*Not defined*|Enable backlight breathing, if supported |
|`BREATHING_PERIOD` |`6` |The length of one backlight "breath" in seconds | |`BREATHING_PERIOD` |`6` |The length of one backlight "breath" in seconds |
## Multiple backlight pins
Most keyboards have only one backlight pin which control all backlight LEDs (especially if the backlight is connected to an hardware PWM pin).
In software PWM, it is possible to define multiple backlight pins. All those pins will be turned on and off at the same time during the PWM duty cycle.
This feature allows to set for instance the Caps Lock LED (or any other controllable LED) brightness at the same level as the other LEDs of the backlight. This is useful if you have mapped LCTRL in place of Caps Lock and you need the Caps Lock LED to be part of the backlight instead of being activated when Caps Lock is on.
To activate multiple backlight pins, you need to add something like this to your user `config.h`:
~~~c
#define BACKLIGHT_LED_COUNT 2
#undef BACKLIGHT_PIN
#define BACKLIGHT_PINS { F5, B2 }
~~~
## Hardware PWM Implementation ## Hardware PWM Implementation
When using the supported pins for backlighting, QMK will use a hardware timer configured to output a PWM signal. This timer will count up to `ICRx` (by default `0xFFFF`) before resetting to 0. When using the supported pins for backlighting, QMK will use a hardware timer configured to output a PWM signal. This timer will count up to `ICRx` (by default `0xFFFF`) before resetting to 0.
@ -53,6 +92,15 @@ In this way `OCRxx` essentially controls the duty cycle of the LEDs, and thus th
The breathing effect is achieved by registering an interrupt handler for `TIMER1_OVF_vect` that is called whenever the counter resets, roughly 244 times per second. The breathing effect is achieved by registering an interrupt handler for `TIMER1_OVF_vect` that is called whenever the counter resets, roughly 244 times per second.
In this handler, the value of an incrementing counter is mapped onto a precomputed brightness curve. To turn off breathing, the interrupt handler is simply disabled, and the brightness reset to the level stored in EEPROM. In this handler, the value of an incrementing counter is mapped onto a precomputed brightness curve. To turn off breathing, the interrupt handler is simply disabled, and the brightness reset to the level stored in EEPROM.
## Software PWM Implementation
When `BACKLIGHT_PIN` is not set to a hardware backlight pin, QMK will use a hardware timer configured to trigger software interrupts. This time will count up to `ICRx` (by default `0xFFFF`) before resetting to 0.
When resetting to 0, the CPU will fire an OVF (overflow) interrupt that will turn the LEDs on, starting the duty cycle.
The desired brightness is calculated and stored in the `OCRxx` register. When the counter reaches this value, the CPU will fire a Compare Output match interrupt, which will turn the LEDs off.
In this way `OCRxx` essentially controls the duty cycle of the LEDs, and thus the brightness, where `0x0000` is completely off and `0xFFFF` is completely on.
The breathing effect is the same as in the hardware PWM implementation.
## Backlight Functions ## Backlight Functions
|Function |Description | |Function |Description |

View File

@ -230,7 +230,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
void matrix_scan_user(void) { # The very important timer. void matrix_scan_user(void) { # The very important timer.
if (is_alt_tab_active) { if (is_alt_tab_active) {
if (timer_elapsed(alt_tab_timer) > 1000) { if (timer_elapsed(alt_tab_timer) > 1000) {
unregister_code16(LALT(KC_TAB)); unregister_code(KC_LALT);
is_alt_tab_active = false; is_alt_tab_active = false;
} }
} }

View File

@ -124,30 +124,46 @@ Configure the hardware via your `config.h`:
--- ---
From this point forward the configuration is the same for all the drivers. From this point forward the configuration is the same for all the drivers. The `led_config_t` struct provides a key electrical matrix to led index lookup table, what the physical position of each LED is on the board, and what type of key or usage the LED if the LED represents. Here is a brief example:
```C ```C
const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { const led_config_t g_led_config = { {
/* {row | col << 4} // Key Matrix to LED Index
* | {x=0..224, y=0..64} { 5, NO_LED, NO_LED, 0 },
* | | modifier { NO_LED, NO_LED, NO_LED, NO_LED },
* | | | */ { 4, NO_LED, NO_LED, 1 },
{{0|(0<<4)}, {20.36*0, 21.33*0}, 1}, { 3, NO_LED, NO_LED, 2 }
{{0|(1<<4)}, {20.36*1, 21.33*0}, 1}, }, {
.... // LED Index to Physical Position
} { 188, 16 }, { 187, 48 }, { 149, 64 }, { 112, 64 }, { 37, 48 }, { 38, 16 }
}, {
// LED Index to Flag
1, 4, 4, 4, 4, 1
} };
``` ```
The format for the matrix position used in this array is `{row | (col << 4)}`. The `x` is between (inclusive) 0-224, and `y` is between (inclusive) 0-64. The easiest way to calculate these positions is: The first part, `// Key Matrix to LED Index`, tells the system what key this LED represents by using the key's electrical matrix row & col. The second part, `// LED Index to Physical Position` represents the LED's physical position on the keyboard. The first value, `x`, is between 0-224 (inclusive), and the second value, `y`, is between 0-64 (inclusive). This range is due to effect that calculate the center or halves for their animations. The easiest way to calculate these positions is imagine your keyboard is a grid, and the top left of the keyboard represents x, y coordinate 0, 0 and the bottom right of your keyboard represents 224, 64. Using this as a basis, you can use the following formula to calculate the physical position:
```C ```C
x = 224 / ( NUMBER_OF_COLS - 1 ) * ROW_POSITION x = 224 / (NUMBER_OF_COLS - 1) * COL_POSITION
y = 64 / (NUMBER_OF_ROWS - 1 ) * COL_POSITION y = 64 / (NUMBER_OF_ROWS - 1) * ROW_POSITION
``` ```
Where all variables are decimels/floats. Where NUMBER_OF_COLS, NUMBER_OF_ROWS, COL_POSITION, & ROW_POSITION are all based on the physical layout of your keyboard, not the electrical layout.
`modifier` is a boolean, whether or not a certain key is considered a modifier (used in some effects). `// LED Index to Flag` is a bitmask, whether or not a certain LEDs is of a certain type. It is recommended that LEDs are set to only 1 type.
## Flags
|Define |Description |
|------------------------------------|-------------------------------------------|
|`#define HAS_FLAGS(bits, flags)` |Returns true if `bits` has all `flags` set.|
|`#define HAS_ANY_FLAGS(bits, flags)`|Returns true if `bits` has any `flags` set.|
|`#define LED_FLAG_NONE 0x00` |If this LED has no flags. |
|`#define LED_FLAG_ALL 0xFF` |If this LED has all flags. |
|`#define LED_FLAG_MODIFIER 0x01` |If the Key for this LED is a modifier. |
|`#define LED_FLAG_UNDERGLOW 0x02` |If the LED is for underglow. |
|`#define LED_FLAG_KEYLIGHT 0x04` |If the LED is for key backlight. |
## Keycodes ## Keycodes
@ -185,10 +201,19 @@ enum rgb_matrix_effects {
RGB_MATRIX_RAINBOW_PINWHEELS, // Full dual gradients spinning two halfs of keyboard RGB_MATRIX_RAINBOW_PINWHEELS, // Full dual gradients spinning two halfs of keyboard
RGB_MATRIX_RAINDROPS, // Randomly changes a single key's hue RGB_MATRIX_RAINDROPS, // Randomly changes a single key's hue
RGB_MATRIX_JELLYBEAN_RAINDROPS, // Randomly changes a single key's hue and saturation RGB_MATRIX_JELLYBEAN_RAINDROPS, // Randomly changes a single key's hue and saturation
#if define(RGB_MATRIX_FRAMEBUFFER_EFFECTS)
RGB_MATRIX_TYPING_HEATMAP, // How hot is your WPM!
RGB_MATRIX_DIGITAL_RAIN, // That famous computer simulation RGB_MATRIX_DIGITAL_RAIN, // That famous computer simulation
#endif
#if defined(RGB_MATRIX_KEYPRESSES) || defined(RGB_MATRIX_KEYRELEASES) #if defined(RGB_MATRIX_KEYPRESSES) || defined(RGB_MATRIX_KEYRELEASES)
RGB_MATRIX_SOLID_REACTIVE_SIMPLE, // Pulses keys hit to hue & value then fades value out RGB_MATRIX_SOLID_REACTIVE_SIMPLE, // Pulses keys hit to hue & value then fades value out
RGB_MATRIX_SOLID_REACTIVE, // Static single hue, pulses keys hit to shifted hue then fades to current hue RGB_MATRIX_SOLID_REACTIVE, // Static single hue, pulses keys hit to shifted hue then fades to current hue
RGB_MATRIX_SOLID_REACTIVE_WIDE // Hue & value pulse near a single key hit then fades value out
RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE // Hue & value pulse near multiple key hits then fades value out
RGB_MATRIX_SOLID_REACTIVE_CROSS // Hue & value pulse the same column and row of a single key hit then fades value out
RGB_MATRIX_SOLID_REACTIVE_MULTICROSS // Hue & value pulse the same column and row of multiple key hits then fades value out
RGB_MATRIX_SOLID_REACTIVE_NEXUS // Hue & value pulse away on the same column and row of a single key hit then fades value out
RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS // Hue & value pulse away on the same column and row of multiple key hits then fades value out
RGB_MATRIX_SPLASH, // Full gradient & value pulse away from a single key hit then fades value out RGB_MATRIX_SPLASH, // Full gradient & value pulse away from a single key hit then fades value out
RGB_MATRIX_MULTISPLASH, // Full gradient & value pulse away from multiple key hits then fades value out RGB_MATRIX_MULTISPLASH, // Full gradient & value pulse away from multiple key hits then fades value out
RGB_MATRIX_SOLID_SPLASH, // Hue & value pulse away from a single key hit then fades value out RGB_MATRIX_SOLID_SPLASH, // Hue & value pulse away from a single key hit then fades value out
@ -202,7 +227,7 @@ You can disable a single effect by defining `DISABLE_[EFFECT_NAME]` in your `con
|Define |Description | |Define |Description |
|---------------------------------------------------|--------------------------------------------| |-------------------------------------------------------|-----------------------------------------------|
|`#define DISABLE_RGB_MATRIX_ALPHAS_MODS` |Disables `RGB_MATRIX_ALPHAS_MODS` | |`#define DISABLE_RGB_MATRIX_ALPHAS_MODS` |Disables `RGB_MATRIX_ALPHAS_MODS` |
|`#define DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN` |Disables `RGB_MATRIX_GRADIENT_UP_DOWN` | |`#define DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN` |Disables `RGB_MATRIX_GRADIENT_UP_DOWN` |
|`#define DISABLE_RGB_MATRIX_BREATHING` |Disables `RGB_MATRIX_BREATHING` | |`#define DISABLE_RGB_MATRIX_BREATHING` |Disables `RGB_MATRIX_BREATHING` |
@ -215,26 +240,105 @@ You can disable a single effect by defining `DISABLE_[EFFECT_NAME]` in your `con
|`#define DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS` |Disables `RGB_MATRIX_RAINBOW_PINWHEELS` | |`#define DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS` |Disables `RGB_MATRIX_RAINBOW_PINWHEELS` |
|`#define DISABLE_RGB_MATRIX_RAINDROPS` |Disables `RGB_MATRIX_RAINDROPS` | |`#define DISABLE_RGB_MATRIX_RAINDROPS` |Disables `RGB_MATRIX_RAINDROPS` |
|`#define DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS` |Disables `RGB_MATRIX_JELLYBEAN_RAINDROPS` | |`#define DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS` |Disables `RGB_MATRIX_JELLYBEAN_RAINDROPS` |
|`#define DISABLE_RGB_MATRIX_TYPING_HEATMAP` |Disables `RGB_MATRIX_TYPING_HEATMAP` |
|`#define DISABLE_RGB_MATRIX_DIGITAL_RAIN` |Disables `RGB_MATRIX_DIGITAL_RAIN` | |`#define DISABLE_RGB_MATRIX_DIGITAL_RAIN` |Disables `RGB_MATRIX_DIGITAL_RAIN` |
|`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE` |Disables `RGB_MATRIX_SOLID_REACTIVE` | |`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE` |Disables `RGB_MATRIX_SOLID_REACTIVE` |
|`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE` |Disables `RGB_MATRIX_SOLID_REACTIVE_SIMPLEE`| |`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE` |Disables `RGB_MATRIX_SOLID_REACTIVE_SIMPLE` |
|`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE` |Disables `RGB_MATRIX_SOLID_REACTIVE_WIDE` |
|`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE` |Disables `RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE` |
|`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS` |Disables `RGB_MATRIX_SOLID_REACTIVE_CROSS` |
|`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS` |Disables `RGB_MATRIX_SOLID_REACTIVE_MULTICROSS`|
|`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS` |Disables `RGB_MATRIX_SOLID_REACTIVE_NEXUS` |
|`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS` |Disables `RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS`|
|`#define DISABLE_RGB_MATRIX_SPLASH` |Disables `RGB_MATRIX_SPLASH` | |`#define DISABLE_RGB_MATRIX_SPLASH` |Disables `RGB_MATRIX_SPLASH` |
|`#define DISABLE_RGB_MATRIX_MULTISPLASH` |Disables `RGB_MATRIX_MULTISPLASH` | |`#define DISABLE_RGB_MATRIX_MULTISPLASH` |Disables `RGB_MATRIX_MULTISPLASH` |
|`#define DISABLE_RGB_MATRIX_SOLID_SPLASH` |Disables `RGB_MATRIX_SOLID_SPLASH` | |`#define DISABLE_RGB_MATRIX_SOLID_SPLASH` |Disables `RGB_MATRIX_SOLID_SPLASH` |
|`#define DISABLE_RGB_MATRIX_SOLID_MULTISPLASH` |Disables `RGB_MATRIX_SOLID_MULTISPLASH` | |`#define DISABLE_RGB_MATRIX_SOLID_MULTISPLASH` |Disables `RGB_MATRIX_SOLID_MULTISPLASH` |
## Custom layer effects ## Custom RGB Matrix Effects
Custom layer effects can be done by defining this in your `<keyboard>.c`: By setting `RGB_MATRIX_CUSTOM_USER` (and/or `RGB_MATRIX_CUSTOM_KB`) in `rule.mk`, new effects can be defined directly from userspace, without having to edit any QMK core files.
To declare new effects, create a new `rgb_matrix_user/kb.inc` that looks something like this:
`rgb_matrix_user.inc` should go in the root of the keymap directory.
`rgb_matrix_kb.inc` should go in the root of the keyboard directory.
```C ```C
void rgb_matrix_indicators_kb(void) { // !!! DO NOT ADD #pragma once !!! //
rgb_matrix_set_color(index, red, green, blue);
// Step 1.
// Declare custom effects using the RGB_MATRIX_EFFECT macro
// (note the lack of semicolon after the macro!)
RGB_MATRIX_EFFECT(my_cool_effect)
RGB_MATRIX_EFFECT(my_cool_effect2)
// Step 2.
// Define effects inside the `RGB_MATRIX_CUSTOM_EFFECT_IMPLS` ifdef block
#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS
// e.g: A simple effect, self-contained within a single method
static bool my_cool_effect(effect_params_t* params) {
RGB_MATRIX_USE_LIMITS(led_min, led_max);
for (uint8_t i = led_min; i < led_max; i++) {
rgb_matrix_set_color(i, 0xff, 0xff, 0x00);
} }
return led_max < DRIVER_LED_TOTAL;
}
// e.g: A more complex effect, relying on external methods and state, with
// dedicated init and run methods
static uint8_t some_global_state;
static void my_cool_effect2_complex_init(effect_params_t* params) {
some_global_state = 1;
}
static bool my_cool_effect2_complex_run(effect_params_t* params) {
RGB_MATRIX_USE_LIMITS(led_min, led_max);
for (uint8_t i = led_min; i < led_max; i++) {
rgb_matrix_set_color(i, 0xff, some_global_state++, 0xff);
}
return led_max < DRIVER_LED_TOTAL;
}
static bool my_cool_effect2(effect_params_t* params) {
if (params->init) my_cool_effect2_complex_init(params);
return my_cool_effect2_complex_run(params);
}
#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS
``` ```
A similar function works in the keymap as `rgb_matrix_indicators_user`. For inspiration and examples, check out the built-in effects under `quantum/rgb_matrix_animation/`
## Colors
These are shorthands to popular colors. The `RGB` ones can be passed to the `setrgb` functions, while the `HSV` ones to the `sethsv` functions.
|RGB |HSV |
|-------------------|-------------------|
|`RGB_WHITE` |`HSV_WHITE` |
|`RGB_RED` |`HSV_RED` |
|`RGB_CORAL` |`HSV_CORAL` |
|`RGB_ORANGE` |`HSV_ORANGE` |
|`RGB_GOLDENROD` |`HSV_GOLDENROD` |
|`RGB_GOLD` |`HSV_GOLD` |
|`RGB_YELLOW` |`HSV_YELLOW` |
|`RGB_CHARTREUSE` |`HSV_CHARTREUSE` |
|`RGB_GREEN` |`HSV_GREEN` |
|`RGB_SPRINGGREEN` |`HSV_SPRINGGREEN` |
|`RGB_TURQUOISE` |`HSV_TURQUOISE` |
|`RGB_TEAL` |`HSV_TEAL` |
|`RGB_CYAN` |`HSV_CYAN` |
|`RGB_AZURE` |`HSV_AZURE` |
|`RGB_BLUE` |`HSV_BLUE` |
|`RGB_PURPLE` |`HSV_PURPLE` |
|`RGB_MAGENTA` |`HSV_MAGENTA` |
|`RGB_PINK` |`HSV_PINK` |
These are defined in [`rgblight_list.h`](https://github.com/qmk/qmk_firmware/blob/master/quantum/rgblight_list.h). Feel free to add to this list!
## Additional `config.h` Options ## Additional `config.h` Options

View File

@ -114,7 +114,7 @@ The following options can be used to tweak the various animations:
|`RGBLIGHT_EFFECT_RGB_TEST` |*Not defined*|If defined, enable RGB test animation mode. | |`RGBLIGHT_EFFECT_RGB_TEST` |*Not defined*|If defined, enable RGB test animation mode. |
|`RGBLIGHT_EFFECT_ALTERNATING` |*Not defined*|If defined, enable alternating animation mode. | |`RGBLIGHT_EFFECT_ALTERNATING` |*Not defined*|If defined, enable alternating animation mode. |
|`RGBLIGHT_ANIMATIONS` |*Not defined*|If defined, enables all additional animation modes | |`RGBLIGHT_ANIMATIONS` |*Not defined*|If defined, enables all additional animation modes |
|`RGBLIGHT_EFFECT_BREATHE_CENTER` |`1.85` |Used to calculate the curve for the breathing animation. Valid values are 1.0 to 2.7 | |`RGBLIGHT_EFFECT_BREATHE_CENTER` |*Not defined*|If defined, used to calculate the curve for the breathing animation. Valid values are 1.0 to 2.7 |
|`RGBLIGHT_EFFECT_BREATHE_MAX` |`255` |The maximum brightness for the breathing mode. Valid values are 1 to 255 | |`RGBLIGHT_EFFECT_BREATHE_MAX` |`255` |The maximum brightness for the breathing mode. Valid values are 1 to 255 |
|`RGBLIGHT_EFFECT_SNAKE_LENGTH` |`4` |The number of LEDs to light up for the "Snake" animation | |`RGBLIGHT_EFFECT_SNAKE_LENGTH` |`4` |The number of LEDs to light up for the "Snake" animation |
|`RGBLIGHT_EFFECT_KNIGHT_LENGTH` |`3` |The number of LEDs to light up for the "Knight" animation | |`RGBLIGHT_EFFECT_KNIGHT_LENGTH` |`3` |The number of LEDs to light up for the "Knight" animation |
@ -145,7 +145,7 @@ const uint8_t RGBLED_SNAKE_INTERVALS[] PROGMEM = {100, 50, 20};
const uint8_t RGBLED_KNIGHT_INTERVALS[] PROGMEM = {127, 63, 31}; const uint8_t RGBLED_KNIGHT_INTERVALS[] PROGMEM = {127, 63, 31};
// These control which hues are selected for each of the "Static gradient" modes // These control which hues are selected for each of the "Static gradient" modes
const uint16_t RGBLED_GRADIENT_RANGES[] PROGMEM = {360, 240, 180, 120, 90}; const uint8_t RGBLED_GRADIENT_RANGES[] PROGMEM = {255, 170, 127, 85, 64};
``` ```
## Functions ## Functions
@ -191,7 +191,40 @@ If you need to change your RGB lighting in code, for example in a macro to chang
|`rgblight_decrease_val_noeeprom()` |Decrease the value for all LEDs. This wraps around at minimum value (not written to EEPROM) | |`rgblight_decrease_val_noeeprom()` |Decrease the value for all LEDs. This wraps around at minimum value (not written to EEPROM) |
|`rgblight_set_clipping_range(pos, num)` |Set clipping Range | |`rgblight_set_clipping_range(pos, num)` |Set clipping Range |
Additionally, [`rgblight_list.h`](https://github.com/qmk/qmk_firmware/blob/master/quantum/rgblight_list.h) defines several predefined shortcuts for various colors. Feel free to add to this list! ## Colors
These are shorthands to popular colors. The `RGB` ones can be passed to the `setrgb` functions, while the `HSV` ones to the `sethsv` functions.
|RGB |HSV |
|-------------------|-------------------|
|`RGB_WHITE` |`HSV_WHITE` |
|`RGB_RED` |`HSV_RED` |
|`RGB_CORAL` |`HSV_CORAL` |
|`RGB_ORANGE` |`HSV_ORANGE` |
|`RGB_GOLDENROD` |`HSV_GOLDENROD` |
|`RGB_GOLD` |`HSV_GOLD` |
|`RGB_YELLOW` |`HSV_YELLOW` |
|`RGB_CHARTREUSE` |`HSV_CHARTREUSE` |
|`RGB_GREEN` |`HSV_GREEN` |
|`RGB_SPRINGGREEN` |`HSV_SPRINGGREEN` |
|`RGB_TURQUOISE` |`HSV_TURQUOISE` |
|`RGB_TEAL` |`HSV_TEAL` |
|`RGB_CYAN` |`HSV_CYAN` |
|`RGB_AZURE` |`HSV_AZURE` |
|`RGB_BLUE` |`HSV_BLUE` |
|`RGB_PURPLE` |`HSV_PURPLE` |
|`RGB_MAGENTA` |`HSV_MAGENTA` |
|`RGB_PINK` |`HSV_PINK` |
```c
rgblight_setrgb(RGB_ORANGE);
rgblight_sethsv_noeeprom(HSV_GREEN);
rgblight_setrgb_at(RGB_GOLD, 3);
rgblight_sethsv_range(HSV_WHITE, 0, 6);
```
These are defined in [`rgblight_list.h`](https://github.com/qmk/qmk_firmware/blob/master/quantum/rgblight_list.h). Feel free to add to this list!
## Changing the order of the LEDs ## Changing the order of the LEDs

View File

@ -0,0 +1,59 @@
# Space Cadet: The Future, Built In
Steve Losh described the [Space Cadet Shift](http://stevelosh.com/blog/2012/10/a-modern-space-cadet/) quite well. Essentially, when you tap Left Shift on its own, you get an opening parenthesis; tap Right Shift on its own and you get the closing one. When held, the Shift keys function as normal. Yes, it's as cool as it sounds, and now even cooler supporting Control and Alt as well!
## Usage
Firstly, in your keymap, do one of the following:
- Replace the Left Shift key with `KC_LSPO` (Left Shift, Parenthesis Open), and Right Shift with `KC_RSPC` (Right Shift, Parenthesis Close).
- Replace the Left Control key with `KC_LCPO` (Left Control, Parenthesis Open), and Right Control with `KC_RCPC` (Right Control, Parenthesis Close).
- Replace the Left Alt key with `KC_LAPO` (Left Alt, Parenthesis Open), and Right Alt with `KC_RAPC` (Right Alt, Parenthesis Close).
- Replace any Shift key in your keymap with `KC_SFTENT` (Right Shift, Enter).
## Keycodes
|Keycode |Description |
|-----------|-------------------------------------------|
|`KC_LSPO` |Left Shift when held, `(` when tapped |
|`KC_RSPC` |Right Shift when held, `)` when tapped |
|`KC_LCPO` |Left Control when held, `(` when tapped |
|`KC_RCPC` |Right Control when held, `)` when tapped |
|`KC_LAPO` |Left Alt when held, `(` when tapped |
|`KC_RAPC` |Right Alt when held, `)` when tapped |
|`KC_SFTENT`|Right Shift when held, `Enter` when tapped |
## Caveats
Space Cadet's functionality can conflict with the default Command functionality when both Shift keys are held at the same time. See the [Command feature](feature_command.md) for info on how to change it, or make sure that Command is disabled in your `rules.mk` with:
```make
COMMAND_ENABLE = no
```
## Configuration
By default Space Cadet assumes a US ANSI layout, but if your layout uses different keys for parentheses, you can redefine them in your `config.h`. In addition, you can redefine the modifier to send on tap, or even send no modifier at all. The new configuration defines bundle all options up into a single define of 3 key codes in this order: the `Modifier` when held or when used with other keys, the `Tap Modifer` sent when tapped (no modifier if `KC_TRNS`), finally the `Keycode` sent when tapped. Now keep in mind, mods from other keys will still apply to the `Keycode` if say `KC_RSFT` is held while tapping `KC_LSPO` key with `KC_TRNS` as the `Tap Modifer`.
|Define |Default |Description |
|----------------|-------------------------------|---------------------------------------------------------------------------------|
|`LSPO_KEYS` |`KC_LSFT, LSPO_MOD, LSPO_KEY` |Send `KC_LSFT` when held, the mod and key defined by `LSPO_MOD` and `LSPO_KEY`. |
|`RSPC_KEYS` |`KC_RSFT, RSPC_MOD, RSPC_KEY` |Send `KC_RSFT` when held, the mod and key defined by `RSPC_MOD` and `RSPC_KEY`. |
|`LCPO_KEYS` |`KC_LCTL, KC_LCTL, KC_9` |Send `KC_LCTL` when held, the mod `KC_LCTL` with the key `KC_9` when tapped. |
|`RCPC_KEYS` |`KC_RCTL, KC_RCTL, KC_0` |Send `KC_RCTL` when held, the mod `KC_RCTL` with the key `KC_0` when tapped. |
|`LAPO_KEYS` |`KC_LALT, KC_LALT, KC_9` |Send `KC_LALT` when held, the mod `KC_LALT` with the key `KC_9` when tapped. |
|`RAPC_KEYS` |`KC_RALT, KC_RALT, KC_0` |Send `KC_RALT` when held, the mod `KC_RALT` with the key `KC_0` when tapped. |
|`SFTENT_KEYS` |`KC_RSFT, KC_TRNS, SFTENT_KEY` |Send `KC_RSFT` when held, no mod with the key `SFTENT_KEY` when tapped. |
## Obsolete Configuration
These defines are used in the above defines internally to support backwards compatibility, so you may continue to use them, however the above defines open up a larger range of flexibility than before. As an example, say you want to not send any modifier when you tap just `KC_LSPO`, with the old defines you had an all or nothing choice of using the `DISABLE_SPACE_CADET_MODIFIER` define. Now you can define that key as: `#define LSPO_KEYS KC_LSFT, KC_TRNS, KC_9`. This tells the system to set Left Shift if held or used with other keys, then on tap send no modifier (transparent) with the `KC_9`.
|Define |Default |Description |
|------------------------------|-------------|------------------------------------------------------------------|
|`LSPO_KEY` |`KC_9` |The keycode to send when Left Shift is tapped |
|`RSPC_KEY` |`KC_0` |The keycode to send when Right Shift is tapped |
|`LSPO_MOD` |`KC_LSFT` |The modifier to apply to `LSPO_KEY` |
|`RSPC_MOD` |`KC_RSFT` |The modifier to apply to `RSPC_KEY` |
|`SFTENT_KEY` |`KC_ENT` |The keycode to send when the Shift key is tapped |
|`DISABLE_SPACE_CADET_MODIFIER`|*Not defined*|If defined, prevent the Space Cadet from applying a modifier |

View File

@ -1,37 +0,0 @@
# Space Cadet Shift: The Future, Built In
Steve Losh described the [Space Cadet Shift](http://stevelosh.com/blog/2012/10/a-modern-space-cadet/) quite well. Essentially, when you tap Left Shift on its own, you get an opening parenthesis; tap Right Shift on its own and you get the closing one. When held, the Shift keys function as normal. Yes, it's as cool as it sounds.
## Usage
Replace the Left Shift key in your keymap with `KC_LSPO` (Left Shift, Parenthesis Open), and Right Shift with `KC_RSPC` (Right Shift, Parenthesis Close).
## Keycodes
|Keycode |Description |
|---------|--------------------------------------|
|`KC_LSPO`|Left Shift when held, `(` when tapped |
|`KC_RSPC`|Right Shift when held, `)` when tapped|
## Caveats
Space Cadet's functionality can conflict with the default Command functionality when both Shift keys are held at the same time. Make sure that Command is disabled in your `rules.mk` with:
```make
COMMAND_ENABLE = no
```
## Configuration
By default Space Cadet assumes a US ANSI layout, but if your layout uses different keys for parentheses, you can redefine them in your `config.h`.
You can also disable the rollover, allowing you to use the opposite Shift key to cancel the Space Cadet state in the event of an erroneous press, instead of emitting a pair of parentheses when the keys are released.
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 |
|`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|

View File

@ -1,31 +0,0 @@
# Space Cadet Shift Enter
Based on the [Space Cadet Shift](feature_space_cadet_shift.md) feature. Tap the Shift key on its own, and it behaves like Enter. When held, the Shift functions as normal.
## Usage
Replace any Shift key in your keymap with `KC_SFTENT` (Shift, Enter), and you're done.
## Keycodes
|Keycode |Description |
|-----------|----------------------------------------|
|`KC_SFTENT`|Right Shift when held, Enter when tapped|
## Caveats
As with Space Cadet Shift, this feature may conflict with Command, so it should be disabled in your `rules.mk` with:
```make
COMMAND_ENABLE = no
```
This feature also uses the same timers as Space Cadet Shift, so using them in tandem may produce strange results.
## Configuration
By default Space Cadet assumes a US ANSI layout, but if you'd like to use a different key for Enter, you can redefine it in your `config.h`:
|Define |Default |Description |
|------------|--------|------------------------------------------------|
|`SFTENT_KEY`|`KC_ENT`|The keycode to send when the Shift key is tapped|

View File

@ -4,11 +4,11 @@ There are three Unicode keymap definition methods available in QMK:
## `UNICODE_ENABLE` ## `UNICODE_ENABLE`
Supports Unicode up to `0x7FFF`. This covers characters for most modern languages, as well as symbols, but it doesn't cover emoji. The keycode function is `UC(c)` in the keymap file, where _c_ is the code point's number (preferably hexadecimal, up to 4 digits long). For example: `UC(0x45B)`, `UC(0x30C4)`. Supports Unicode up to `0x7FFF`. This covers characters for most modern languages, as well as symbols, but it doesn't cover emoji. The keycode function is `UC(c)` in the keymap, where _c_ is the code point's number (preferably hexadecimal, up to 4 digits long). For example: `UC(0x45B)`, `UC(0x30C4)`.
## `UNICODEMAP_ENABLE` ## `UNICODEMAP_ENABLE`
Supports Unicode up to `0x10FFFF` (all possible code points). You need to maintain a separate mapping table `const uint32_t PROGMEM unicode_map[] = {...}` in your keymap file. The keycode function is `X(i)`, where _i_ is an array index into the mapping table. The table may contain at most 1024 entries. Supports Unicode up to `0x10FFFF` (all possible code points). You need to maintain a separate mapping table `const uint32_t PROGMEM unicode_map[] = {...}` in your keymap file. The keycode function is `X(i)`, where _i_ is an array index into the mapping table. The table may contain at most 16384 entries.
You may want to have an enum to make referencing easier. So, you could add something like this to your keymap file: You may want to have an enum to make referencing easier. So, you could add something like this to your keymap file:
@ -26,13 +26,21 @@ const uint32_t PROGMEM unicode_map[] = {
}; };
``` ```
Then you can use `X(BANG)` etc. in your keymap. Then you can use `X(BANG)`, `X(SNEK)` etc. in your keymap.
### Lower and Upper Case
Characters often come in lower and upper case pairs, for example: å, Å. To make inputting these characters easier, you can use `XP(i, j)` in your keymap, where _i_ and _j_ are the mapping table indices of the lower and upper case character, respectively. If you're holding down Shift or have Caps Lock turned on when you press the key, the second (upper case) character will be inserted; otherwise, the first (lower case) version will appear.
This is most useful when creating a keymap for an international layout with special characters. Instead of having to put the lower and upper case versions of a character on separate keys, you can have them both on the same key by using `XP`. This blends Unicode keys in with regular alphas.
Due to keycode size constraints, _i_ and _j_ can each only refer to one of the first 128 characters in your `unicode_map`. In other words, 0 ≤ _i_ ≤ 127 and 0 ≤ _j_ ≤ 127. This is enough for most use cases, but if you'd like to customize the index calculation, you can override the [`unicodemap_index()`](https://github.com/qmk/qmk_firmware/blob/71f640d47ee12c862c798e1f56392853c7b1c1a8/quantum/process_keycode/process_unicodemap.c#L40) function. This also allows you to, say, check Ctrl instead of Shift/Caps.
## `UCIS_ENABLE` ## `UCIS_ENABLE`
Supports Unicode up to `0x10FFFF` (all possible code points). As with `UNICODEMAP`, you need to maintain a mapping table in your keymap file. However, there are no built-in keycodes for this feature — you will have to add a keycode or function that calls `qk_ucis_start()`. Once this function's been called, you can type the corresponding mnemonic for your character, then hit Space or Enter to complete it, or Esc to cancel. If the mnemonic matches an entry in your table, the typed text will automatically be erased and the corresponding Unicode character inserted. Supports Unicode up to `0x10FFFF` (all possible code points). As with `UNICODEMAP`, you need to maintain a mapping table in your keymap file. However, there are no built-in keycodes for this feature — you have to add a keycode or function that calls `qk_ucis_start()`. Once this function has been called, you can type the corresponding mnemonic for your character, then hit Space or Enter to complete it, or Esc to cancel. If the mnemonic matches an entry in your table, the typed text will automatically be erased and the corresponding Unicode character inserted.
For instance, you would define a table like this in your keymap file: For instance, you could define a table like this in your keymap file:
```c ```c
const qk_ucis_symbol_t ucis_symbol_table[] = UCIS_TABLE( const qk_ucis_symbol_t ucis_symbol_table[] = UCIS_TABLE(
@ -42,7 +50,7 @@ const qk_ucis_symbol_t ucis_symbol_table[] = UCIS_TABLE(
); );
``` ```
You call `qk_ucis_start()`, then type "rofl" and hit Enter. QMK should erase the "rofl" text and input the laughing emoji. To use it, call `qk_ucis_start()`, then type "rofl" and hit Enter. QMK should erase the "rofl" text and insert the laughing emoji.
### Customization ### Customization
@ -60,28 +68,29 @@ Unicode input in QMK works by inputting a sequence of characters to the OS, sort
The following input modes are available: The following input modes are available:
* **`UC_OSX`**: Mac OS X built-in Unicode hex input. Supports code points up to `0xFFFF` (`0x10FFFF` with `UNICODEMAP`). * **`UC_OSX`**: macOS built-in Unicode hex input. Supports code points up to `0xFFFF` (`0x10FFFF` with `UNICODEMAP`).
To enable, go to _System Preferences > Keyboard > Input Sources_, add _Unicode Hex Input_ to the list (it's under _Other_), then activate it from the input dropdown in the Menu Bar. To enable, go to _System Preferences > Keyboard > Input Sources_, add _Unicode Hex Input_ to the list (it's under _Other_), then activate it from the input dropdown in the Menu Bar.
By default, this mode uses the left Option key (`KC_LALT`), but this can be changed by defining [`UNICODE_OSX_KEY`](#input-key-configuration) with another keycode. By default, this mode uses the left Option key (`KC_LALT`) for Unicode input, but this can be changed by defining [`UNICODE_KEY_OSX`](#input-key-configuration) with another keycode.
**Note:** Using the _Unicode Hex Input_ input source may disable some Option based shortcuts, such as: Option + Left Arrow (`moveWordLeftAndModifySelection`) and Option + Right Arrow (`moveWordRightAndModifySelection`). !> Using the _Unicode Hex Input_ input source may disable some Option based shortcuts, such as Option + Left Arrow and Option + Right Arrow.
* **`UC_LNX`**: Linux built-in IBus Unicode input. Supports code points up to `0x10FFFF` (all possible code points). * **`UC_LNX`**: Linux built-in IBus Unicode input. Supports code points up to `0x10FFFF` (all possible code points).
Enabled by default and works almost anywhere on IBus-enabled distros. Without IBus, this mode works under GTK apps, but rarely anywhere else. Enabled by default and works almost anywhere on IBus-enabled distros. Without IBus, this mode works under GTK apps, but rarely anywhere else.
By default, this mode uses Ctrl+Shift+U (`LCTL(LSFT(KC_U))`) to start Unicode input, but this can be changed by defining [`UNICODE_KEY_LNX`](#input-key-configuration) with another keycode. This might be required for IBus versions ≥1.5.15, where Ctrl+Shift+U behavior is consolidated into Ctrl+Shift+E.
* **`UC_WIN`**: _(not recommended)_ Windows built-in hex numpad Unicode input. Supports code points up to `0xFFFF`. * **`UC_WIN`**: _(not recommended)_ Windows built-in hex numpad Unicode input. Supports code points up to `0xFFFF`.
To enable, create a registry key under `HKEY_CURRENT_USER\Control Panel\Input Method\EnableHexNumpad` of type `REG_SZ` called `EnableHexNumpad` and set its value to `1`. This can be done from the Command Prompt by running `reg add "HKCU\Control Panel\Input Method" -v EnableHexNumpad -t REG_SZ -d 1` with administrator privileges. Afterwards, reboot. To enable, create a registry key under `HKEY_CURRENT_USER\Control Panel\Input Method\EnableHexNumpad` of type `REG_SZ` called `EnableHexNumpad` and set its value to `1`. This can be done from the Command Prompt by running `reg add "HKCU\Control Panel\Input Method" -v EnableHexNumpad -t REG_SZ -d 1` with administrator privileges. Reboot afterwards.
This mode is not recommended because of reliability and compatibility issues; use the `UC_WINC` mode instead. This mode is not recommended because of reliability and compatibility issues; use the `UC_WINC` mode instead.
* **`UC_BSD`**: _(non implemented)_ Unicode input under BSD. Not implemented at this time. If you're a BSD user and want to help add support for it, please [open an issue on GitHub](https://github.com/qmk/qmk_firmware/issues). * **`UC_BSD`**: _(non implemented)_ Unicode input under BSD. Not implemented at this time. If you're a BSD user and want to help add support for it, please [open an issue on GitHub](https://github.com/qmk/qmk_firmware/issues).
* **`UC_WINC`**: Windows Unicode input using [WinCompose](https://github.com/samhocevar/wincompose). As of v0.8.2, supports code points up to `0xFFFFF` (all currently assigned code points). * **`UC_WINC`**: Windows Unicode input using [WinCompose](https://github.com/samhocevar/wincompose). As of v0.9.0, supports code points up to `0x10FFFF` (all possible code points).
To enable, install the [latest release](https://github.com/samhocevar/wincompose/releases/latest). Once installed, WinCompose will automatically run on startup. Works reliably under all version of Windows supported by the app. To enable, install the [latest release](https://github.com/samhocevar/wincompose/releases/latest). Once installed, WinCompose will automatically run on startup. Works reliably under all version of Windows supported by the app.
By default, this mode uses the right Alt key (`KC_RALT`), but this can be changed in the WinCompose settings and by defining [`UNICODE_WINC_KEY`](#input-key-configuration) with another keycode. By default, this mode uses right Alt (`KC_RALT`) as the Compose key, but this can be changed in the WinCompose settings and by defining [`UNICODE_KEY_WINC`](#input-key-configuration) with another keycode.
### Switching Input Modes ### Switching Input Modes
@ -89,17 +98,17 @@ There are two ways to set the input mode for Unicode: by keycode or by function.
You can switch the input mode at any time by using one of the following keycodes. The easiest way is to add the ones you use to your keymap. You can switch the input mode at any time by using one of the following keycodes. The easiest way is to add the ones you use to your keymap.
|Keycode |Alias |Input mode |Description | |Keycode |Alias |Input Mode |Description |
|-----------------------|---------|-------------|-----------------------------------------| |----------------------|---------|------------|--------------------------------------------------------------|
|`UNICODE_MODE_FORWARD` |`UC_MOD` | |Cycles forwards through the available modes. [(Disabled by default)](#input-method-cycling)| |`UNICODE_MODE_FORWARD`|`UC_MOD` |Next in list|[Cycle](#input-mode-cycling) through selected modes |
|`UNICODE_MODE_REVERSE` |`UC_RMOD`| |Cycles forwards through the available modes. [(Disabled by default)](#input-method-cycling)| |`UNICODE_MODE_REVERSE`|`UC_RMOD`|Prev in list|[Cycle](#input-mode-cycling) through selected modes in reverse|
|`UNICODE_MODE_OSX` |`UC_M_OS`|`UC_OSX` |Switch to Mac OS X input. | |`UNICODE_MODE_OSX` |`UC_M_OS`|`UC_OSX` |Switch to macOS input |
|`UNICODE_MODE_LNX` |`UC_M_LN`|`UC_LNX` |Switch to Linux input. | |`UNICODE_MODE_LNX` |`UC_M_LN`|`UC_LNX` |Switch to Linux input |
|`UNICODE_MODE_WIN` |`UC_M_WI`|`UC_WIN` |Switch to Windows input. | |`UNICODE_MODE_WIN` |`UC_M_WI`|`UC_WIN` |Switch to Windows input |
|`UNICODE_MODE_BSD` |`UC_M_BS`|`UC_BSD` |Switch to BSD input (not implemented). | |`UNICODE_MODE_BSD` |`UC_M_BS`|`UC_BSD` |Switch to BSD input (not implemented) |
|`UNICODE_MODE_WINC` |`UC_M_WC`|`UC_WINC` |Switch to Windows input using WinCompose.| |`UNICODE_MODE_WINC` |`UC_M_WC`|`UC_WINC` |Switch to Windows input using WinCompose |
You can also switch the input mode by calling `set_unicode_input_mode(x)` in your code, where _x_ is one of the above input mode constants (e.g. `UC_LNX`). Since the function only needs to be called once, it's recommended that you do it in `eeconfig_init_user` (or a similar function). For example: You can also switch the input mode by calling `set_unicode_input_mode(x)` in your code, where _x_ is one of the above input mode constants (e.g. `UC_LNX`). Since the function only needs to be called once, it's recommended that you do it in `eeconfig_init_user()` (or a similar function). For example:
```c ```c
void eeconfig_init_user(void) { void eeconfig_init_user(void) {
@ -123,35 +132,45 @@ For instance, you can add these definitions to your `config.h` file:
### Additional Customization ### Additional Customization
Because Unicode is such a large and variable feature, there are a number of options that you can customize to work better on your system. Because Unicode is a large and versatile feature, there are a number of options you can customize to make it work better on your system.
#### Start and Finish input functions #### Start and Finish Input Functions
The functions for starting and finishing Unicode input on your platform can be overridden locally. Possible uses include customizing input mode behavior if you don't use the default keys, or adding extra visual/audio feedback to Unicode input. The functions for starting and finishing Unicode input on your platform can be overridden locally. Possible uses include customizing input mode behavior if you don't use the default keys, or adding extra visual/audio feedback to Unicode input.
* `void unicode_input_start(void)` This sends the initial sequence that tells your platform to enter Unicode input mode. For example, it presses Ctrl+Shift+U on Linux and holds the Option key on Mac. * `void unicode_input_start(void)` This sends the initial sequence that tells your platform to enter Unicode input mode. For example, it presses Ctrl+Shift+U on Linux and holds the Option key on macOS.
* `void unicode_input_finish(void)` This is called to exit Unicode input mode, for example by pressing Space or releasing the Option key. * `void unicode_input_finish(void)` This is called to exit Unicode input mode, for example by pressing Space or releasing the Option key.
You can find the default implementations of these functions in [`process_unicode_common.c`](https://github.com/qmk/qmk_firmware/blob/master/quantum/process_keycode/process_unicode_common.c). You can find the default implementations of these functions in [`process_unicode_common.c`](https://github.com/qmk/qmk_firmware/blob/master/quantum/process_keycode/process_unicode_common.c).
#### Input Key Configuration #### Input Key Configuration
Additionally, you can customize the keys used to trigger the unicode input for macOS and WinCompose by adding defines to your `config.h` You can customize the keys used to trigger Unicode input for macOS, Linux and WinCompose by adding corresponding defines to your `config.h`. The default values match the platforms' default settings, so you shouldn't need to change this unless Unicode input isn't working, or you want to use a different key (e.g. in order to free up left or right Alt).
|Define |Type |Default |Example |
|------------------|----------|------------------|-------------------------------------------|
|`UNICODE_KEY_OSX` |`uint8_t` |`KC_LALT` |`#define UNICODE_KEY_OSX KC_RALT` |
|`UNICODE_KEY_LNX` |`uint16_t`|`LCTL(LSFT(KC_U))`|`#define UNICODE_KEY_LNX LCTL(LSFT(KC_E))`|
|`UNICODE_KEY_WINC`|`uint8_t` |`KC_RALT` |`#define UNICODE_KEY_WINC KC_RGUI` |
#### Input Mode Cycling
You can choose which input modes are available for cycling through. By default, this is disabled. If you want to enable it, limiting it to just the modes you use makes sense. Note that the values in the list are comma-delimited.
```c ```c
#define UNICODE_OSX_KEY KC_LALT #define UNICODE_SELECTED_MODES UC_OSX, UC_LNX, UC_WIN, UC_WINC
#define UNICODE_WINC_KEY KC_RALT
``` ```
#### Input Method Cycling You can cycle through the selected modes by using the `UC_MOD`/`UC_RMOD` keycodes, or by calling `cycle_unicode_input_mode(offset)` in your code (`offset` is how many modes to move forward by, so +1 corresponds to `UC_MOD`).
Also, you can choose which input methods are availble for cycling through. By default, this is disabled. But if you want to enabled it, then limiting it to just those modes makes sense. Note that `UNICODE_SELECTED_MODES` define is comma delimited. By default, when the keyboard boots, it will initialize the input mode to the last one you used. You can disable this and make it start with the first mode in the list every time by adding the following to your `config.h`:
```c ```c
#define UNICODE_SELECTED_MODES UC_OSX, UC_LNX, UC_WIN, UC_BSD, UC_WINC #define UNICODE_CYCLE_PERSIST false
``` ```
!> Using `UNICODE_SELECTED_MODES` means you don't have to initially set the input mode in `matrix_init_user()` (or a similar function); the Unicode system will do that for you on startup. This has the added benefit of avoiding unnecessary writes to EEPROM.
## `send_unicode_hex_string` ## `send_unicode_hex_string`
To type multiple characters for things like (ノಠ痊ಠ)ノ彡┻━┻, you can use `send_unicode_hex_string()` much like `SEND_STRING()` except you would use hex values separate by spaces. To type multiple characters for things like (ノಠ痊ಠ)ノ彡┻━┻, you can use `send_unicode_hex_string()` much like `SEND_STRING()` except you would use hex values separate by spaces.

View File

@ -25,7 +25,7 @@ QMK has a staggering number of features for building your keyboard. It can take
* [PS2 Mouse](feature_ps2_mouse.md) - Driver for connecting a PS/2 mouse directly to your keyboard. * [PS2 Mouse](feature_ps2_mouse.md) - Driver for connecting a PS/2 mouse directly to your keyboard.
* [RGB Light](feature_rgblight.md) - RGB lighting for your keyboard. * [RGB Light](feature_rgblight.md) - RGB lighting for your keyboard.
* [RGB Matrix](feature_rgb_matrix.md) - RGB Matrix lights for per key lighting. * [RGB Matrix](feature_rgb_matrix.md) - RGB Matrix lights for per key lighting.
* [Space Cadet](feature_space_cadet_shift.md) - Use your left/right shift keys to type parenthesis and brackets. * [Space Cadet](feature_space_cadet.md) - Use your left/right shift keys to type parenthesis and brackets.
* [Stenography](feature_stenography.md) - Put your keyboard into Plover mode for stenography use. * [Stenography](feature_stenography.md) - Put your keyboard into Plover mode for stenography use.
* [Swap Hands](feature_swap_hands.md) - Mirror your keyboard for one handed usage. * [Swap Hands](feature_swap_hands.md) - Mirror your keyboard for one handed usage.
* [Tap Dance](feature_tap_dance.md) - Make a single key do as many things as you want. * [Tap Dance](feature_tap_dance.md) - Make a single key do as many things as you want.

View File

@ -198,15 +198,17 @@ From here, you should have a working keyboard once you program a firmware. Befor
To start out, download [the firmware](https://github.com/qmk/qmk_firmware/) - we'll be using my (Jack's) fork of TMK called QMK/Quantum. We'll be doing a lot from the Terminal/command prompt, so get that open, along with a decent text editor like [Sublime Text](http://www.sublimetext.com/) (paid) or [Visual Studio Code](https://code.visualstudio.com) (free). To start out, download [the firmware](https://github.com/qmk/qmk_firmware/) - we'll be using my (Jack's) fork of TMK called QMK/Quantum. We'll be doing a lot from the Terminal/command prompt, so get that open, along with a decent text editor like [Sublime Text](http://www.sublimetext.com/) (paid) or [Visual Studio Code](https://code.visualstudio.com) (free).
The first thing we're going to do is create a new project using the script in the root directory of the firmware. In your terminal, run this command with `<project_name>` replaced by the name of your project - it'll need to be different from any other project in the `keyboards/` folder: The first thing we're going to do is create a new keyboard. In your terminal, run this command, which will ask you some questions and generate a basic keyboard project:
``` ```
util/new_project.sh <project_name> ./util/new_keyboard.sh
``` ```
You'll want to navigate to the `keyboards/<project_name>/` folder by typing, like the print-out from the script specifies: You'll want to navigate to the `keyboards/<project_name>/` folder by typing, like the print-out from the script specifies:
```
cd keyboards/<project_name> cd keyboards/<project_name>
```
### `config.h` ### `config.h`
@ -326,7 +328,7 @@ Carefully flip your keyboard over, open up a new text document, and try typing -
2. Check the solder joints on the diode - if the diode is loose, part of your row may register, while the other may not. 2. Check the solder joints on the diode - if the diode is loose, part of your row may register, while the other may not.
3. Check the solder joints on the columns - if your column wiring is loose, part or all of the column may not work. 3. Check the solder joints on the columns - if your column wiring is loose, part or all of the column may not work.
4. Check the solder joints on both sides of the wires going to/from the Teensy - the wires need to be fully soldered and connect to both sides. 4. Check the solder joints on both sides of the wires going to/from the Teensy - the wires need to be fully soldered and connect to both sides.
5. Check the <project_name>.h file for errors and incorrectly placed `KC_NO`s - if you're unsure where they should be, instead duplicate a k*xy* variable. 5. Check the `<project_name>.h` file for errors and incorrectly placed `KC_NO`s - if you're unsure where they should be, instead duplicate a k*xy* variable.
6. Check to make sure you actually compiled the firmware and flashed the Teensy correctly. Unless you got error messages in the terminal, or a pop-up during flashing, you probably did everything correctly. 6. Check to make sure you actually compiled the firmware and flashed the Teensy correctly. Unless you got error messages in the terminal, or a pop-up during flashing, you probably did everything correctly.
If you've done all of these things, keep in mind that sometimes you might have had multiple things affecting the keyswitch, so it doesn't hurt to test the keyswitch by shorting it out at the end. If you've done all of these things, keep in mind that sometimes you might have had multiple things affecting the keyswitch, so it doesn't hurt to test the keyswitch by shorting it out at the end.
@ -335,4 +337,4 @@ If you've done all of these things, keep in mind that sometimes you might have h
Now that you have a working board, it's time to get things in their permanent positions. I've often used liberal amounts of hot glue to secure and insulate things, so if that's your style, start spreading that stuff like butter. Otherwise, double-sided tape is always an elegant solution, and electrical tape is a distant second. Due to the nature of these builds, a lot of this part is up to you and how you planned (or didn't plan) things out. Now that you have a working board, it's time to get things in their permanent positions. I've often used liberal amounts of hot glue to secure and insulate things, so if that's your style, start spreading that stuff like butter. Otherwise, double-sided tape is always an elegant solution, and electrical tape is a distant second. Due to the nature of these builds, a lot of this part is up to you and how you planned (or didn't plan) things out.
There are a lot of possibilities inside the firmware - explore [docs.qmk.fm](http://docs.qmk.fm) for a full feature list, and dive into the different project (Planck, Clueboard, Ergodox EZ, etc) to see how people use all of them. You can always stop by [the OLKB subreddit for help!](http://reddit.com/r/olkb) There are a lot of possibilities inside the firmware - explore [docs.qmk.fm](http://docs.qmk.fm) for a full feature list, and dive into the different keyboards (Planck, Clueboard, Ergodox EZ, etc) to see how people use all of them. You can always stop by [the OLKB subreddit for help!](http://reddit.com/r/olkb)

View File

@ -6,14 +6,26 @@ If you have not yet you should read the [Keyboard Guidelines](hardware_keyboard_
## Adding Your AVR Keyboard to QMK ## Adding Your AVR Keyboard to QMK
QMK has a number of features to simplify working with AVR keyboards. For most keyboards you don't have to write a single line of code. To get started run the `util/new_project.sh` script: QMK has a number of features to simplify working with AVR keyboards. For most keyboards you don't have to write a single line of code. To get started, run the `util/new_keyboard.sh` script:
```bash ```
$ util/new_project.sh my_awesome_keyboard $ ./util/new_keyboard.sh
###################################################### Generating a new QMK keyboard directory
# /keyboards/my_awesome_keyboard project created. To start
# working on things, cd into keyboards/my_awesome_keyboard Keyboard Name: mycoolkb
###################################################### Keyboard Type [avr]:
Your Name [John Smith]:
Copying base template files... done
Copying avr template files... done
Renaming keyboard files... done
Replacing %KEYBOARD% with mycoolkb... done
Replacing %YOUR_NAME% with John Smith... done
Created a new keyboard called mycoolkb.
To start working on things, cd into keyboards/mycoolkb,
or open the directory in your favourite text editor.
``` ```
This will create all the files needed to support your new keyboard, and populate the settings with default values. Now you just need to customize it for your keyboard. This will create all the files needed to support your new keyboard, and populate the settings with default values. Now you just need to customize it for your keyboard.

View File

@ -450,7 +450,15 @@ This is a reference only. Each group of keys links to the page documenting their
## [Unicode Support](feature_unicode.md) ## [Unicode Support](feature_unicode.md)
|Key |Description | |Key |Aliases |Description |
|-------|---------------------------------------------------------------------------| |----------------------|---------|----------------------------------------------------------------|
|`UC(c)`|Send Unicode code point `c` (`UNICODE_ENABLE`) | |`UC(c)` | |Send Unicode code point `c` |
|`X(i)` |Send Unicode code point at index `i` in `unicode_map` (`UNICODEMAP_ENABLE`)| |`X(i)` | |Send Unicode code point at index `i` in `unicode_map` |
|`XP(i, j)` | |Send Unicode code point at index `i`, or `j` if Shift/Caps is on|
|`UNICODE_MODE_FORWARD`|`UC_MOD` |Cycle through selected input modes |
|`UNICODE_MODE_REVERSE`|`UC_RMOD`|Cycle through selected input modes in reverse |
|`UNICODE_MODE_OSX` |`UC_M_OS`|Switch to macOS input |
|`UNICODE_MODE_LNX` |`UC_M_LN`|Switch to Linux input |
|`UNICODE_MODE_WIN` |`UC_M_WI`|Switch to Windows input |
|`UNICODE_MODE_BSD` |`UC_M_BS`|Switch to BSD input (not implemented) |
|`UNICODE_MODE_WINC` |`UC_M_WC`|Switch to Windows input using WinCompose |

View File

@ -13,9 +13,9 @@ Note: These programs are not provided by or endorsed by QMK.
* [Keyboard Tester](http://www.keyboardtester.com) (Web Based) * [Keyboard Tester](http://www.keyboardtester.com) (Web Based)
* [Keyboard Checker](http://keyboardchecker.com) (Web Based) * [Keyboard Checker](http://keyboardchecker.com) (Web Based)
## Debugging With QMK Toolbox ## Debugging
[QMK Toolbox](https://github.com/qmk/qmk_toolbox) will show messages from your keyboard if you have `CONSOLE_ENABLE = yes` in your `rules.mk`. By default the output is very limited, but you can turn on debug mode to increase the amount of debug output. Use the `DEBUG` keycode in your keymap, use the [Command](feature_command.md) feature to enable debug mode, or add the following code to your keymap. Your keyboard will output debug information if you have `CONSOLE_ENABLE = yes` in your `rules.mk`. By default the output is very limited, but you can turn on debug mode to increase the amount of debug output. Use the `DEBUG` keycode in your keymap, use the [Command](feature_command.md) feature to enable debug mode, or add the following code to your keymap.
```c ```c
void keyboard_post_init_user(void) { void keyboard_post_init_user(void) {
@ -27,6 +27,14 @@ void keyboard_post_init_user(void) {
} }
``` ```
### Debugging With QMK Toolbox
For compatible platforms, [QMK Toolbox](https://github.com/qmk/qmk_toolbox) can be used to display debug messages from your keyboard.
### Debugging With hid_listen
Prefer a terminal based solution? [hid_listen](https://www.pjrc.com/teensy/hid_listen.html), provided by PJRC, can also be used to display debug messages. Prebuilt binaries for Windows,Linux,and MacOS are available.
<!-- FIXME: Describe the debugging messages here. --> <!-- FIXME: Describe the debugging messages here. -->
## Sending Your Own Debug Messages ## Sending Your Own Debug Messages
@ -41,3 +49,51 @@ After that you can use a few different print functions:
* `uprintf("%s string", var)`: Print a formatted string * `uprintf("%s string", var)`: Print a formatted string
* `dprint("string")` Print a simple string, but only when debug mode is enabled * `dprint("string")` Print a simple string, but only when debug mode is enabled
* `dprintf("%s string", var)`: Print a formatted string, but only when debug mode is enabled * `dprintf("%s string", var)`: Print a formatted string, but only when debug mode is enabled
## Debug Examples
Below is a collection of real world debugging examples. For additional information, refer to [Debugging/Troubleshooting QMK](faq_debug.md).
### Which matrix position is this keypress?
When porting, or when attempting to diagnose pcb issues, it can be useful to know if a keypress is scanned correctly. To enable logging for this scenario, add the following code to your keymaps `keymap.c`
```c
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
// If console is enabled, it will print the matrix position and status of each key pressed
#ifdef CONSOLE_ENABLE
uprintf("KL: kc: %u, col: %u, row: %u, pressed: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed);
#endif
return true;
}
```
Example output
```text
Waiting for device:.......
Listening:
KL: kc: 169, col: 0, row: 0, pressed: 1
KL: kc: 169, col: 0, row: 0, pressed: 0
KL: kc: 174, col: 1, row: 0, pressed: 1
KL: kc: 174, col: 1, row: 0, pressed: 0
KL: kc: 172, col: 2, row: 0, pressed: 1
KL: kc: 172, col: 2, row: 0, pressed: 0
```
### How long did it take to scan for a keypress?
When testing performance issues, it can be useful to know the frequency at which the switch matrix is being scanned. To enable logging for this scenario, add the following code to your keymaps `config.h`
```c
#define DEBUG_MATRIX_SCAN_RATE
```
Example output
```text
> matrix scan frequency: 315
> matrix scan frequency: 313
> matrix scan frequency: 316
> matrix scan frequency: 316
> matrix scan frequency: 316
> matrix scan frequency: 316
```

View File

@ -1,15 +1,25 @@
Setting up your ARM based PCB is a little more involved than an Atmel MCU, but is easy enough. Start by using `util/new_project.sh <keyboard>` to create a new project: Setting up your ARM based PCB is a little more involved than an Atmel MCU, but is easy enough. Start by running `util/new_keyboard.sh`:
``` ```
$ util/new_project.sh simontester $ ./util/new_keyboard.sh
###################################################### Generating a new QMK keyboard directory
# /keyboards/simontester project created. To start
# working on things, cd into keyboards/simontester Keyboard Name: mycoolkb
###################################################### Keyboard Type [avr]:
Your Name [John Smith]:
Copying base template files... done
Copying avr template files... done
Renaming keyboard files... done
Replacing %KEYBOARD% with mycoolkb... done
Replacing %YOUR_NAME% with John Smith... done
Created a new keyboard called mycoolkb.
To start working on things, cd into keyboards/mycoolkb,
or open the directory in your favourite text editor.
``` ```
# END OF NEW ARM DOC, OLD ATMEL DOC FOLLOWS # END OF NEW ARM DOC, OLD ATMEL DOC FOLLOWS
## `/keyboards/<keyboard>/config.h` ## `/keyboards/<keyboard>/config.h`

32
docs/zh-cn/README.md Normal file
View File

@ -0,0 +1,32 @@
# QMK机械键盘固件
[![当前版本](https://img.shields.io/github/tag/qmk/qmk_firmware.svg)](https://github.com/qmk/qmk_firmware/tags)
[![开发状态](https://travis-ci.org/qmk/qmk_firmware.svg?branch=master)](https://travis-ci.org/qmk/qmk_firmware)
[![异议](https://img.shields.io/discord/440868230475677696.svg)](https://discord.gg/Uq7gcHh)
[![文档状态](https://img.shields.io/badge/docs-ready-orange.svg)](https://docs.qmk.fm)
[![GitHub贡献者](https://img.shields.io/github/contributors/qmk/qmk_firmware.svg)](https://github.com/qmk/qmk_firmware/pulse/monthly)
[![GitHub分支](https://img.shields.io/github/forks/qmk/qmk_firmware.svg?style=social&label=Fork)](https://github.com/qmk/qmk_firmware/)
## 什么是 QMK 固件?
QMK (*Quantum Mechanical Keyboard*) 是一个社区维护的开源软件,包括 QMK 固件, QMK 工具箱, qmk.fm网站, 和这些文档。QMK 固件是一个基于[tmk\_keyboard](http://github.com/tmk/tmk_keyboard)的键盘固件它在爱特梅尔AVR微控制器实现一些有用的功能,确切地说, 是在 [OLKB product line](http://olkb.com), 在 [ErgoDox EZ](http://www.ergodox-ez.com) 键盘, 和 [Clueboard product line](http://clueboard.co/). 上。它被移植到使用ChibiOS的ARM芯片上. 它可以在飞线键盘或定制PCB键盘中发挥功能.
## 如何得到它
如果你打算贡献布局, 键盘, 或者其他QMK特性, 一下是最简单的方法:[从Github获得repo分支](https://github.com/qmk/qmk_firmware#fork-destination-box), 并克隆你的repo到本地进行编辑推送然后从你的分支打开 [Pull Request](https://github.com/qmk/qmk_firmware/pulls).
此外, 你也可以直接下载 ([zip](https://github.com/qmk/qmk_firmware/zipball/master), [tar](https://github.com/qmk/qmk_firmware/tarball/master)), 或者从git克隆 (`git@github.com:qmk/qmk_firmware.git`), 或 https (`https://github.com/qmk/qmk_firmware.git`).
## 如何编译
在你能编译之前, 你需要[部署环境](getting_started_build_tools.md) 用于 AVR or/and ARM 开发。完成后, 你可以使用 `make` 命令来编译一个键盘和布局使用以下命令:
make planck/rev4:default
这将建立 `planck`的`rev4` 修订版本并使用 `default`布局。并非所有键盘都有修订版本 (也叫做子项目或文件夹),在此情况下,修订版本可以省略,如下:
make preonic:default
## 如何定制
QMK 有许多 [特性](features.md)来探索,也有很多 [参考文档](http://docs.qmk.fm) 供您发掘。你可以通过修改 [布局](keymap.md)和[键码](keycodes.md)来利用许多特性。

106
docs/zh-cn/_summary.md Normal file
View File

@ -0,0 +1,106 @@
* [完全菜鸟指南](newbs.md)
* [入门](newbs_getting_started.md)
* [构建你的第一个固件](newbs_building_firmware.md)
* [刷新固件](newbs_flashing.md)
* [测试和调试](newbs_testing_debugging.md)
* [Git最佳实践](newbs_best_practices.md)
* [学习资源](newbs_learn_more_resources.md)
* [QMK基础](README.md)
* [QMK 简介](getting_started_introduction.md)
* [贡献 QMK](contributing.md)
* [如何使用Github](getting_started_github.md)
* [获得帮助](getting_started_getting_help.md)
* [问题解答](faq.md)
* [一般问题](faq_general.md)
* [构建/编译QMK](faq_build.md)
* [调试/故障排除 QMK](faq_debug.md)
* [键盘布局](faq_keymap.md)
* 详细指南
* [安装构建工具](getting_started_build_tools.md)
* [流浪者指南](getting_started_vagrant.md)
* [构建/编译指令](getting_started_make_guide.md)
* [刷新固件](flashing.md)
* [定制功能](custom_quantum_functions.md)
* [布局概述](keymap.md)
* [硬件](hardware.md)
* [AVR 处理器](hardware_avr.md)
* [驱动](hardware_drivers.md)
* 参考
* [键盘指南](hardware_keyboard_guidelines.md)
* [配置选项](config_options.md)
* [键码](keycodes.md)
* [记录最佳实践](documentation_best_practices.md)
* [文档指南](documentation_templates.md)
* [词汇表](reference_glossary.md)
* [单元测试](unit_testing.md)
* [有用的功能](ref_functions.md)
* [配置器支持](reference_configurator_support.md)
* [info.json 格式](reference_info_json.md)
* [特性](features.md)
* [基本键码](keycodes_basic.md)
* [US ANSI 控制键](keycodes_us_ansi_shifted.md)
* [量子键码](quantum_keycodes.md)
* [高级键码](feature_advanced_keycodes.md)
* [音频](feature_audio.md)
* [自动控制](feature_auto_shift.md)
* [背光](feature_backlight.md)
* [蓝牙](feature_bluetooth.md)
* [Bootmagic](feature_bootmagic.md)
* [组合](feature_combo)
* [命令](feature_command.md)
* [动态宏指令](feature_dynamic_macros.md)
* [编码器](feature_encoders.md)
* [Grave Escape](feature_grave_esc.md)
* [键锁](feature_key_lock.md)
* [](feature_layouts.md)
* [引导键](feature_leader_key.md)
* [LED 阵列](feature_led_matrix.md)
* [宏指令](feature_macros.md)
* [鼠标键](feature_mouse_keys.md)
* [一键功能](feature_advanced_keycodes.md#one-shot-keys)
* [指针设备](feature_pointing_device.md)
* [PS/2 鼠标](feature_ps2_mouse.md)
* [RGB 光](feature_rgblight.md)
* [RGB 矩阵](feature_rgb_matrix.md)
* [空格候补换挡](feature_space_cadet_shift.md)
* [空格候补换挡回车](feature_space_cadet_shift_enter.md)
* [速录机](feature_stenography.md)
* [换手](feature_swap_hands.md)
* [踢踏舞](feature_tap_dance.md)
* [终端](feature_terminal.md)
* [热敏打印机](feature_thermal_printer.md)
* [Unicode](feature_unicode.md)
* [用户空间](feature_userspace.md)
* [速度键](feature_velocikey.md)
* 针对制造者和定制者
* [飞线指南](hand_wire.md)
* [ISP 刷新指南](isp_flashing_guide.md)
* [ARM 调试指南](arm_debugging.md)
* [I2C 驱动](i2c_driver.md)
* [GPIO 控制器](internals_gpio_control.md)
* [Proton C 转换](proton_c_conversion.md)
* 深入了解
* [键盘如何工作](how_keyboards_work.md)
* [理解 QMK](understanding_qmk.md)
* 其他话题
* [使用Eclipse开发QMK](other_eclipse.md)
* [使用VSCode开发QMK](other_vscode.md)
* [支持](support.md)
* QMK 内构 (正在编写)
* [定义](internals_defines.md)
* [输入回调寄存器](internals_input_callback_reg.md)
* [Midi 设备](internals_midi_device.md)
* [Midi 设备设置过程](internals_midi_device_setup_process.md)
* [Midi 工具库](internals_midi_util.md)
* [发送函数](internals_send_functions.md)
* [Sysex 工具](internals_sysex_tools.md)

View File

@ -0,0 +1,54 @@
# 介绍
本页解释了使用QMK项目所需的基本信息。它假定您能熟练使用Unix shell但您不熟悉C语言也不熟悉使用make编译。
## 基本QMK结构
QMK是[Jun Wako](https://github.com/tmk)的[tmk_keyboard](https://github.com/tmk/tmk_keyboard)工程的一个分叉。经过更改的TMK原始代码放在`tmk` 文件夹中。 QMK增加的新东西可以在 `quantum` 文件夹中找到。 键盘项目可以在 `handwired`(手动飞线) 和 `keyboard`PCB键盘这两个文件夹找到。
### 用户空间结构
在`users`文件夹里面的目录是每个用户的目录。这个文件夹里面放的是用户们在不同键盘都能用到的代码。详见[用户空间特性](feature_userspace.md)
### 键盘项目结构
在`keyboards`文件夹和他的子文件夹`handwired`中就是各个键盘的项目了,比如`qmk_firmware/keyboards/clueboard`。内部结构与如下:
* `keymaps/`: 可以构建的不同布局
* `rules.mk`: 用来设置 "make" 命令默认选项的文件。别直接编辑这个文件,你应该使用具体某个布局的 `rules.mk`.
* `config.h`: 用于设置默认编译选项的文件。别直接编辑这个文件, 你应该使用具体某个布局的 `config.h`.
### 布局结构
在各个布局的文件夹,你能找到以下文件。只有 `keymap.c` 是必要的, 如果其他文件找不到就会直接选择默认选项。
* `config.h`: 配置布局的选项
* `keymap.c`: 布局的全部代码, 必要文件
* `rules.mk`: 使能的QMK特性
* `readme.md`:介绍你的布局,告诉别人怎么使用附上功能说明。请将图片上传到imgur等图床译者注imgur可能已被墙为了方便国人访问建议使用国内可以直接访问的图床
# `config.h` 文件
有三个重要的`config.h` 位置:
* 键盘 (`/keyboards/<keyboard>/config.h`)
* 用户空间 (`/users/<user>/config.h`)
* 布局 (`/keyboards/<keyboard>/keymaps/<keymap>/config.h`)
构建系统按照上述顺序自动获取配置文件。如果要覆盖由上一个 `config.h` 所做的设置,您需要首先为要更改的设置包含一些样板代码。
```
#pragma once
```
要覆盖上一个 `config.h` 所做的设置,你要先 `#undef` 然后再 `#define` 这个设置.
样板代码和设置看起来像这样:
```
#pragma once
// 像下面那样覆盖设置MY_SETTING指的是你要覆盖的设置项!
#undef MY_SETTING
#define MY_SETTING 4
```

View File

@ -0,0 +1,163 @@
# 最佳实践
## 或者说, "我应如何学会不再担心并开始爱上Git。"
本文档旨在指导新手以最佳方式获得为QMK做出贡献的丝滑体验。我们将介绍为QMK做出贡献的过程详细介绍使这项任务更容易的一些方法然后我们将制造一些问题来教你如何解决它们。
本文假设了一些内容:
1. 一有个GitHub账户, 并[创建qmk_firmware仓库分叉](getting_started_github.md)到你的帐户.
2. 你已经[建立你的构建环境](newbs_getting_started.md?id=environment-setup).
## 你分叉的主分支: 一直在上传,但不要提交
十分推荐您在QMK开发过程中无论开发是否完成都要保持你的 `master` 分支更新,但是 ***一定不要*** 提交。相反你应该在一个开发分叉中做出你所有修改并在开发时提交pull request。
减少合并冲突的可能性 &mdash; 两个或多个用户同时编辑文件的同一部分的实例 &mdash; 保持 `master` 分支最新,并创建一个新的分支来开始新的开发。
### 更新你的主分支
保持你的 `master` 更新, 推荐你添加QMK Firmware仓库作为Git的远程仓库想这么做的话, 你可以打开你的Git命令行接口然后输入:
```
git remote add upstream https://github.com/qmk/qmk_firmware.git
```
运行 `git remote -v`, 来确定这个仓库已经添加,以下是回显:
```
$ git remote -v
origin https://github.com/<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)
```
现在添加已完成,你可以用`git fetch upstream`来检查仓库的更新. 这会检索branches 和 tags &mdash; 统称为"refs" &mdash; 从QMK仓库, 也就是 `upstream`。我们可以比较我们的分叉和QMK的 `origin` 数据的不同。
要更新你的分叉的主分支请运行以下命令在每行之后按Enter键:
```
git checkout master
git fetch upstream
git pull upstream master
git push origin master
```
这回切换到你的`master` 分支, 检索你QMK仓库的refs, 下载当前QMK `master` 分支到你的电脑, 并上传到你的分叉.
### 做改动
你可以输入以下命令来创建一个新的分支来做改动:
```
git checkout -b dev_branch
git push --set-upstream origin dev_branch
```
这回建立一个叫做 `dev_branch`的新分支, 检查一下, 然后想你的分叉保存分支. 使用 `--set-upstream` 参数来告诉git使用你的分叉并且当每次你对你的分支用`git push` 或 `git pull`时要使用`dev_branch`。 它仅需要在第一次push的时候使用然后你就可以很安全的用 `git push``git pull`, 并不需要其他参数了。
!> 使用 `git push`, 你可以用 `-u` 来代替 `--set-upstream` &mdash; `-u`是`--set-upstream`的简写。
您可以将您的分支命名为您想要的任何名称,但建议将其命名为与您要进行的更改相关的内容。
默认情况下 `git checkout -b` 在已经检出的分支上建立新的分支。您可以将新的分支建立在未检出的现有分支的基础上,方法是将现有分支的名称添加到命令:
```
git checkout -b dev_branch master
```
现在您已经有了一个开发分支那么就打开您的文本编辑器并进行您需要做的任何更改。建议对您的分支进行许多小的提交这样任何引起问题的更改都可以在需要时更容易地跟踪和撤消。要进行更改编辑并保存任何需要更新的文件请将它们添加到Git的 *staging area* ,然后将它们提交到您的分支:
```
git add path/to/updated_file
git commit -m "My commit message."
```
` git add`添加已更改到Git的*临时区域*也就是Git的“加载区域”的文件。其中包含使用 `git commit` 命令 *提交* 的并已经保存到仓库的更改。建议您使用描述性的提交消息,这样您就可以一目了然地知道更改了什么。
!> 如果你修改了很多文件,但所有的文件都是同一个更改的一部分,你可以用 `git add .` 来添加当前目录中所有已更改的文件而不是单独添加每个文件.
### 发布更改
最后一步是将更改推送到您的分叉。 输入 `git push`来推送. 现在Git将`dev_branch`的当前状态发布到您的分叉。
## 解决合并冲突
有时当您在某个分支中的工作需要很长时间才能完成时其他人所做的更改与您在打开pull request时对该分支所做的更改相冲突。这称为*rebase* 即合并冲突,当多个人编辑同一文件的同一部分时会发生这种情况。
### 重新调整您的更改
*rebase*是Git的一种方法它获取在某一点上应用的更改撤销它们然后将相同的更改应用到另一点。在合并冲突的情况下您可以重新设置您的分支以获取在创建分支时和当前时间之间的那段时间所做的更改。
运行以下命令来开始:
```
git fetch upstream
git rev-list --left-right --count HEAD...upstream/master
```
这里的`git rev-list` 命令返回当前分支和qmk的主分支之间不同的提交数。我们首先运行`git fetch`以确保我们有代表upstream仓库的refs。 `git rev-list` 命令的回显有两个数字:
```
$ git rev-list --left-right --count HEAD...upstream/master
7 35
```
第一个数字表示自创建以来当前分支的提交数, 第二个数字是自创建当前分支以来对 `upstream/master` 进行的提交数, 因此, 当前分支中未记录变动。
既然知道当前分支和upstream仓库的当前状态我们可以开始一个rebase操作
```
git rebase upstream/master
```
这就是让Git撤销当前分支上的提交然后根据QMK的主分支重新应用它们。
```
$ git rebase upstream/master
First, rewinding head to replay your work on top of it...
Applying: Commit #1
Using index info to reconstruct a base tree...
M conflicting_file_1.txt
Falling back to patching base and 3-way merge...
Auto-merging conflicting_file_1.txt
CONFLICT (content): Merge conflict in conflicting_file_1.txt
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch' to see the failed patch
Patch failed at 0001 Commit #1
Resolve all conflicts manually, mark them as resolved with
"git add/rm <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".
```
这告诉我们有一个合并冲突,并给出带有冲突的文件的名称。在文本编辑器中打开冲突的文件,在该文件的某个位置,您会发现如下内容:
```
<<<<<<< HEAD
<p>For help with any issues, email us at support@webhost.us.</p>
=======
<p>Need help? Email support@webhost.us.</p>
>>>>>>> Commit #1
```
`<<<<<<< HEAD`行标记合并冲突的开始, `>>>>>>> Commit #1` 行标记结束, 冲突选项被 `=======`分隔。`HEAD`那端的部分来自文件的qmk master版本标记有commit消息的部分来自当前的分支持和提交。
因为Git跟踪 *对文件的更改* 而不是直接跟踪文件的内容所以如果Git在提交之前找不到文件中的文本它将不知道如何编辑该文件。重新编辑文件将解决冲突。进行更改然后保存文件。
```
<p>Need help? Email support@webhost.us.</p>
```
现在运行:
```
git add conflicting_file_1.txt
git rebase --continue
```
Git记录对冲突文件的更改并继续应用来自我们的分支的提交直到它到达末尾。

View File

@ -0,0 +1,81 @@
# 构建第一个固件
现在您已经建立了构建环境就可以开始构建自定义固件了。对于本指南的这一部分我们将在3个程序之间切换——文件管理器、文本编辑器和终端窗口。请保持所有3个程序打开直到您完成并对键盘固件满意。
如果您在按照指南第一部分的操作之后关闭并重新打开了终端窗口请不要忘记输入“cd qmk_firmware”来使您的终端位于正确的目录。
## 导航到您的keymaps文件夹
首先导航到键盘的 `keymaps` 文件夹.
?> 如果您使用的是MacOS或Windows可以使用以下命令轻松地打开keymaps文件夹。
?> macOS:
open keyboards/<keyboard_folder>/keymaps
?> Windows:
start .\\keyboards\\<keyboard_folder>\\keymaps
## 创建`default` 布局副本
打开`keymaps`文件夹后,您将需要创建`default`文件夹的副本。我们强烈建议您将文件夹命名为与Github用户名相同的名称但您也可以使用任何您想使用的名称只要它只包含小写字母、数字和下划线字符。
要自动执行此过程,您还可以选择运行`new_keymap.sh`脚本。
导航到`qmk_firmware/util` 目录然后输入以下命令:
```
./new_keymap.sh <keyboard path> <username>
```
例如一个名字叫ymzcdg的用户要创建1up60hse的布局他需要输入
```
./new_keymap.sh 1upkeyboards/1up60hse ymzcdg
```
## 在你最钟爱的文本编辑器中打开`keymap.c`
打开你的`keymap.c`. 在这个文件中,您可以找到控制键盘行为的结构。 在你的`keymap.c` 的顶部有一些让布局更易读的define和enum。在靠下的位置你会找到一行和下面这句很像的:
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
从这一行开始便是层列表。这行下面你会看到包括 `LAYOUT``KEYMAP`这两个词的几行, 从这些行开始就是层。在这一行下面是组成该特定层的键的列表。
!> 编辑您的keymap文件时注意不要添加或删除任何逗号。如果这样做您将阻止您的固件编译并且您可能不容易找出多余的或缺少的逗号在哪里。
## 根据您的喜好自定义布局
如何完成这一步骤完全取决于您。改变一直困扰着你的问题或者完全重做所有的事情。如果您不需要全部图层可以删除图层或者将图层总数增加到32个。查看以下文档了解可以在此处定义的内容:
* [键码](keycodes.md)
* [特性](features.md)
* [问题与解答](faq.md)
?> 当你明白布局是怎么工作时,您也要让每次改变尽可能小。一次改变很大在调试时找出问题会十分困难。
## 构建你的固件
完成对布局的更改后您就要构建固件了。为此请返回终端窗口并运行build命令:
make <my_keyboard>:<my_keymap>
例如如果您的keymap名为“xyverz”并且您正在为rev5 planck构建一个keymap那么您将使用此命令
make planck/rev5:xyverz
在编译过程中,你将看到屏幕上有很多输出,通知您正在编译哪些文件他应该以与下文类似的输出结束:
```
Linking: .build/planck_rev5_xyverz.elf [OK]
Creating load file for flashing: .build/planck_rev5_xyverz.hex [OK]
Copying planck_rev5_xyverz.hex to qmk_firmware folder [OK]
Checking file size of planck_rev5_xyverz.hex [OK]
* File size is fine - 18392/28672
```
## 刷新你的固件
请移步 [Flashing Firmware](newbs_flashing.md) 来继续。

View File

@ -0,0 +1,307 @@
# 刷新你的键盘
现在您已经构建了一个自定义固件文件,那么您就需要刷新键盘了。
## 用QMK工具箱刷新键盘
刷新键盘的最简单方法是使用[QMK 工具箱](https://github.com/qmk/qmk_toolbox/releases).
但是QMK工具箱目前仅适用于Windows和MacOS。如果您使用的是Linux或者只是希望从命令行刷新固件则必须使用 [方法概述](newbs_flashing.md#flash-your-keyboard-from-the-command-line).
### 将文件加载到QMK工具箱中
首先打开QMK工具箱应用程序。您将要在访达或资源管理器中找到固件文件。您的键盘固件可能是两种格式之一`.hex`或`.bin`。qmk会尝试将键盘的相应文件复制到“qmk_firmware”根目录中。
?> 如果您在Windows或MacOS上可以使用以下命令轻松地在资源管理器或访达中打开当前固件文件夹。
?> Windows:
start .
?> macOS:
open .
固件文件始终遵循此命名格式:
<keyboard_name>_<keymap_name>.{bin,hex}
例如,使用 `default` 布局的 `plank/rev5` 将使用以下名字:
planck_rev5_default.hex
找到固件文件后将其拖到QMK工具箱中的“Local file”框中或单击“Open”并导航到固件文件的存储位置。
### 将键盘置于DFUBootloader模式
要刷新自定义固件,您必须将键盘置于特殊的刷新模式。在此模式下,您将无法键入或使用键盘。在写入固件时,不要拔下键盘插头或以其他方式中断刷新过程,这一点非常重要。
不同的键盘有不同的方式进入这种特殊模式。如果您的键盘当前运行的是QMK或TMK而您没有得到特定的指示请按顺序尝试以下操作:
* 按住两个shift键并按 `Pause`
* 按住两个shift键并按 `B`
* 拔下键盘插头, 同时按住空格键和 `B` , 插上键盘然后等一会再放开按键
* 按下PCB底部的 `RESET` 物理键
* 找到PCB上标记有 `BOOT0``RESET`的金属点, 在插入PCB的同时短接它们
成功后您将在QMK工具箱中看到类似以下内容的消息:
```
*** Clueboard - Clueboard 66% HotSwap disconnected -- 0xC1ED:0x2390
*** DFU device connected
```
### 刷新你的键盘
单击QMK工具箱中的 `Flash` 按钮。您将看到类似以下内容的输出:
```
*** Clueboard - Clueboard 66% HotSwap disconnected -- 0xC1ED:0x2390
*** DFU device connected
*** Attempting to flash, please don't remove device
>>> dfu-programmer atmega32u4 erase --force
Erasing flash... Success
Checking memory from 0x0 to 0x6FFF... Empty.
>>> dfu-programmer atmega32u4 flash /Users/skully/qmk_firmware/clueboard_66_hotswap_gen1_skully.hex
Checking memory from 0x0 to 0x55FF... Empty.
0% 100% Programming 0x5600 bytes...
[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] Success
0% 100% Reading 0x7000 bytes...
[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] Success
Validating... Success
0x5600 bytes written into 0x7000 bytes memory (76.79%).
>>> dfu-programmer atmega32u4 reset
*** DFU device disconnected
*** Clueboard - Clueboard 66% HotSwap connected -- 0xC1ED:0x2390
```
## 使用命令行刷新键盘
首先您需要知道您的键盘使用的是哪个bootloader。通常是以下四个常见的bootloader。Pro-Micro 和 clones 使用 CATERINA, Teensy 使用 Halfkay, OLKB 键盘使用 QMK-DFU, 其他的atmega32u4芯片使用DFU。
您可以在以下文章中了解更多关于bootloader[刷新指令和Bootloader信息](flashing.md)。
如果您知道正在使用的bootloader是哪种那么在编译固件时可以向“make”命令里添加一些额外参数以自动执行刷新过程。
### DFU
对于DFU引导加载程序当您准备好编译和刷新固件时打开终端窗口并运行构建命令:
make <my_keyboard>:<my_keymap>:dfu
例如如果您的布局名为“xyverz”并且您正在为rev5 planck构建一个布局那么您可以使用此命令
make planck/rev5:xyverz:dfu
编译完成后,应输出以下内容:
```
Linking: .build/planck_rev5_xyverz.elf [OK]
Creating load file for flashing: .build/planck_rev5_xyverz.hex [OK]
Copying planck_rev5_xyverz.hex to qmk_firmware folder [OK]
Checking file size of planck_rev5_xyverz.hex
* File size is fine - 18574/28672
```
到了这个时候, 构建脚本将每隔5秒查找一次DFU。它将重复以下操作直到找到设备或将其取消。
dfu-programmer: no device present.
Error: Bootloader not found. Trying again in 5s.
一旦出现以上回显,您将需要重置控制器。然后,它应该显示与以下类似的输出:
```
*** Attempting to flash, please don't remove device
>>> dfu-programmer atmega32u4 erase --force
Erasing flash... Success
Checking memory from 0x0 to 0x6FFF... Empty.
>>> dfu-programmer atmega32u4 flash /Users/skully/qmk_firmware/clueboard_66_hotswap_gen1_skully.hex
Checking memory from 0x0 to 0x55FF... Empty.
0% 100% Programming 0x5600 bytes...
[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] Success
0% 100% Reading 0x7000 bytes...
[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] Success
Validating... Success
0x5600 bytes written into 0x7000 bytes memory (76.79%).
>>> dfu-programmer atmega32u4 reset
```
如果您对此有任何问题,您可能需要这样做:
sudo make <my_keyboard>:<my_keymap>:dfu
#### DFU命令
有许多DFU命令可用于将固件下载到DFU设备
* `:dfu` - 这是正常选项等待DFU设备可用然后刷新固件。这将每隔5秒检查一次以查看是否出现了DFU设备。
* `:dfu-ee` - 这将刷新一个`eep`文件,而不是普通的十六进制文件。这很不常见。
* `:dfu-split-left` - 这将刷新正常固件,就像默认选项 (`:dfu`)一样. 但是这也会刷新“左侧”EEPROM文件用于分割键盘。 _这是基于Elite C的键盘的推荐选择。_
* `:dfu-split-right` - 这将刷新正常固件,就像默认选项(`:dfu`). 但是这也会刷新“右侧”EEPROM文件用于分割键盘。 _这是基于Elite C的键盘的推荐选择。_
### Caterina
对于Arduino板以及其克隆版来说(比如SparkFun和ProMicro), 准备好编译和刷新固件后,打开终端窗口并运行构建命令:
make <my_keyboard>:<my_keymap>:avrdude
比如, 你的布局叫"xyverz"你要创建一个rev2 Lets Split的布局,你要用以下命令:
make lets_split/rev2:xyverz:avrdude
固件完成编译后,它将输出类似以下的内容:
```
Linking: .build/lets_split_rev2_xyverz.elf [OK]
Creating load file for flashing: .build/lets_split_rev2_xyverz.hex [OK]
Checking file size of lets_split_rev2_xyverz.hex [OK]
* File size is fine - 27938/28672
Detecting USB port, reset your controller now..............
```
此时复位然后脚本将检测bootloader然后刷新固件。输出应该像这样:
```
Detected controller on USB port at /dev/ttyS15
Connecting to programmer: .
Found programmer: Id = "CATERIN"; type = S
Software Version = 1.0; No Hardware Version given.
Programmer supports auto addr increment.
Programmer supports buffered memory access with buffersize=128 bytes.
Programmer supports the following devices:
Device code: 0x44
avrdude.exe: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00s
avrdude.exe: Device signature = 0x1e9587 (probably m32u4)
avrdude.exe: NOTE: "flash" memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude.exe: erasing chip
avrdude.exe: reading input file "./.build/lets_split_rev2_xyverz.hex"
avrdude.exe: input file ./.build/lets_split_rev2_xyverz.hex auto detected as Intel Hex
avrdude.exe: writing flash (27938 bytes):
Writing | ################################################## | 100% 2.40s
avrdude.exe: 27938 bytes of flash written
avrdude.exe: verifying flash memory against ./.build/lets_split_rev2_xyverz.hex:
avrdude.exe: load data flash data from input file ./.build/lets_split_rev2_xyverz.hex:
avrdude.exe: input file ./.build/lets_split_rev2_xyverz.hex auto detected as Intel Hex
avrdude.exe: input file ./.build/lets_split_rev2_xyverz.hex contains 27938 bytes
avrdude.exe: reading on-chip flash data:
Reading | ################################################## | 100% 0.43s
avrdude.exe: verifying ...
avrdude.exe: 27938 bytes of flash verified
avrdude.exe: safemode: Fuses OK (E:CB, H:D8, L:FF)
avrdude.exe done. Thank you.
```
如果您对此有任何问题,您可能需要这样做:
sudo make <my_keyboard>:<my_keymap>:avrdude
此外,如果要刷新多个板,请使用以下命令:
make <keyboard>:<keymap>:avrdude-loop
当你完成了刷新后你需要按下ctrl+c或者其他正确的按键来让你的操作系统终止循环。
## HalfKay
对于PJRC设备Teensy当您准备好编译和刷新固件时打开终端窗口并运行构建命令:
make <my_keyboard>:<my_keymap>:teensy
比如, 如果你的布局叫做"xyverz"你想创建Ergodox or Ergodox EZ的布局,你要使用以下命令:
make erdogox_ez:xyverz:teensy
固件完成编译后,它将输出如下内容:
```
Linking: .build/ergodox_ez_xyverz.elf [OK]
Creating load file for flashing: .build/ergodox_ez_xyverz.hex [OK]
Checking file size of ergodox_ez_xyverz.hex [OK]
* File size is fine - 25584/32256
Teensy Loader, Command Line, Version 2.1
Read "./.build/ergodox_ez_xyverz.hex": 25584 bytes, 79.3% usage
Waiting for Teensy device...
(hint: press the reset button)
```
此时,复位键盘。完成后,您将看到如下输出:
```
Found HalfKay Bootloader
Read "./.build/ergodox_ez_xyverz.hex": 28532 bytes, 88.5% usage
Programming............................................................................................................................................................................
...................................................
Booting
```
## STM32 (ARM)
对于大多数ARM板包括Proton C、Planck Rev 6和Preonic Rev 3当您准备好编译和刷新固件时打开终端窗口并运行构建命令
make <my_keyboard>:<my_keymap>:dfu-util
例如如果您的keymap被命名为“xyverz”并且您正在为Planck Revision 6键盘构建一个布局那么您需要使用以下命令然后将键盘重新启动到bootloader在完成编译之前
make planck/rev6:xyverz:dfu-util
固件完成编译后,它将输出如下内容:
```
Linking: .build/planck_rev6_xyverz.elf [OK]
Creating binary load file for flashing: .build/planck_rev6_xyverz.bin [OK]
Creating load file for flashing: .build/planck_rev6_xyverz.hex [OK]
Size after:
text data bss dec hex filename
0 41820 0 41820 a35c .build/planck_rev6_xyverz.hex
Copying planck_rev6_xyverz.bin to qmk_firmware folder [OK]
dfu-util 0.9
Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2016 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/
Invalid DFU suffix signature
A valid DFU suffix will be required in a future dfu-util release!!!
Opening DFU capable USB device...
ID 0483:df11
Run-time device DFU version 011a
Claiming USB DFU Interface...
Setting Alternate Setting #0 ...
Determining device status: state = dfuERROR, status = 10
dfuERROR, clearing status
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 011a
Device returned transfer size 2048
DfuSe interface name: "Internal Flash "
Downloading to address = 0x08000000, size = 41824
Download [=========================] 100% 41824 bytes
Download done.
File downloaded successfully
Transitioning to dfuMANIFEST state
```
## 试一试吧!
恭喜您! 您的自定义固件已经刷写到您的键盘
试一试,确保一切按你想的方式进行。我们写了[测试和调试](newbs_testing_debugging.md)来完善新手引导。 因此,请前往那里了解如何排除自定义功能的故障。

View File

@ -0,0 +1,102 @@
# 介绍
你的电脑键盘里面包含一个处理器, 这个处理器和你电脑里面的不太一样。这个处理器负责运行一些特殊的软件这些软件可以监测按钮按下并将按钮处于按下还是释放状态的数据发送出去。QMK就是这样一种软件即监测按钮被按下并发送这样的信息到作为主机的计算机上。当你创建了你的布局, 你也就创建了你的键盘运行的的可执行程序。
QMK试图通过使简单的事情变得更简单使使不可能成为可能来把大量的权力交给你。你不需要懂如何通过程序创建强大的布局——你只需要遵循简单的语法规则。
# 新手上路
在你能创建布局前,你要安装一些软件来建立你的开发环境。无论你想编译多少固件,这个操作都只需要进行一次。
如果您更喜欢图形化界面, 请考虑使用在线工具[QMK配置器](https://config.qmk.fm)。 请参考 [使用在线GUI构建您的第一个固件](newbs_building_firmware_configurator.md)。
## 下载软件
### 文本编辑器
你需要一个可以编辑 **纯文本** 文件的程序。在Windows上你可以用Notepad, 在Linux上使用gedit这两个都是简单又实用的文本编辑工具。 在macOS上, 请小心使用 “文本编辑” 这个默认软件: 如果你不明确的选择_格式_菜单中的 _制作纯文本_ 的话文本将不会被保存为纯文本。
你也可以下载并安装一个专用编辑器 [Sublime Text](https://www.sublimetext.com/) 或 [VS Code](https://code.visualstudio.com/)。 这大概是跨平台的最好方法了, 这些编辑器是专门为了编辑代码设计的。
?>搞不清用哪种编辑器? Laurence Bradford 写了篇关于编辑器选择的文章 [a great introduction](https://learntocodewith.me/programming/basics/text-editors/)。
### QMK 工具箱
QMK 工具箱 是一种可选的Windows和macOS下的图形化工具它可以对你的定制键盘进行编程和调试。你可能会发现它就是你能简单的刷新你的键盘固件并查看调试信息的稀世珍宝。
[在这里下载最新发布版本](https://github.com/qmk/qmk_toolbox/releases/latest)
* Windows用户: `qmk_toolbox.exe` (绿色版) 或 `qmk_toolbox_install.exe` (安装版)
* macOS用户: `QMK.Toolbox.app.zip` (绿色版) or `QMK.Toolbox.pkg` (安装版)
## 建立你的环境
我们为了使QMK环境变得更容易建立已竭尽所能。你只需要准备Linux 或 Unix 环境, 然后让QMK安装剩余部分。
?> 如果你从未使用过Linux/Unix的命令行,有一些你需要学习的基础概念和命令以下资料将教会您使用QMK环境的必要能力:<br>
[必会Linux命令](https://www.guru99.com/must-know-linux-commands.html)<br>
[一些基本的Unix命令](https://www.tjhsst.edu/~dhyatt/superap/unixcmd.html)
### Windows
你需要安装MSYS2和Git.
* 按照以下安装说明进行操作[MSYS2 主页](http://www.msys2.org)。
* 关闭所有打开的MSYS2终端并打开新的MSYS2 MinGW 64-bit终端。
* 使用以下命令安装Git: `pacman -S git`
### macOS
你需要安装Homebrew。按照以下说明进行操作 [Homebrew 主页](https://brew.sh)。
在Homebrew安装完成后, 继续 _同步QMK工程_. 这一步你将会通过运行一个脚本安装其他包。
### Linux
你将需要安装Git.你很有可能已经安装,但若你尚未安装,可以使用以下命令进行安装:
* Debian / Ubuntu / Devuan: `apt-get install git`
* Fedora / Red Hat / CentOS: `yum install git`
* Arch: `pacman -S git`
?> 无论你使用哪种平台Docker都可以是你的选择[点这里进一步了解](getting_started_build_tools.md#docker)
## 同步QMK工程
当你建立Linux/Unix环境后,你就已经可以下载QMK了.下载时我们可以用Git来 "clone" QMK仓库. 打开一个终端或MSYS2 MinGW 窗口,在阅读剩余的指南时请保持窗口打开。在窗口里面运行以下两句命令:
```shell
git clone --recurse-submodules https://github.com/qmk/qmk_firmware.git
cd qmk_firmware
```
?> 如果您已经知道[如何使用GitHub](getting_started_github.md), 我们推荐您创建您自己的分支并克隆。 如果您不知道这是什么, 您完全可以忽略这句无关紧要的话。
QMK附带一个脚本可帮助您设置剩余的所需内容.您可以通过输入此命令来运行它:
util/qmk_install.sh
## 测试你的开发环境
现在你的QMK环境已经建立完毕, 你可以为你的键盘创建固件了。开始试着创建键盘的默认固件吧。 你需要使用以下格式的命令创建固件:
make <keyboard>:default
比如, 制作一个Clueboard 66%的固件,需要用:
make clueboard/66/rev3:default
当完成后你要看到一些回显,尾部如下:
```
Linking: .build/clueboard_66_rev3_default.elf [OK]
Creating load file for flashing: .build/clueboard_66_rev3_default.hex [OK]
Copying clueboard_66_rev3_default.hex to qmk_firmware folder [OK]
Checking file size of clueboard_66_rev3_default.hex [OK]
* The firmware size is fine - 26356/28672 (2316 bytes free)
```
# 创建你的布局
现在你可以创建属于你自己的布局了! 请移步 [构建你的第一个固件](newbs_building_firmware.md)来继续。

View File

@ -0,0 +1,15 @@
# 学习资源
这些资源旨在让QMK社区的新成员更了解新成员文档中提供的信息。
Git 资源:
* [很好的通用教程](https://www.codecademy.com/learn/learn-git)
* [从例子中学习Git游戏](https://learngitbranching.js.org/)
* [了解有关GitHub的更多信息的Git资源](getting_started_github.md)
* [专门针对QMK的Git资源](contributing.md)
命令行资源:
* [超棒的命令行通用教程](https://www.codecademy.com/learn/learn-the-command-line)

View File

@ -0,0 +1,43 @@
# 测试和调试
使用自定义固件刷新键盘后,您就可以测试它了。如果您幸运,一切都会完美运行,但如果没有,这份文件将帮助您找出问题所在。
## 测试
测试键盘通常非常简单。按下每一个键并确保它发送的是您期望的键。甚至有一些程序可以帮助您确保没有任何键失效。
注意这些程序不是由QMK提供或认可的。
* [Switch Hitter](https://elitekeyboards.com/switchhitter.php) (仅Windows)
* [Keyboard Viewer](https://www.imore.com/how-use-keyboard-viewer-your-mac) (仅Mac)
* [Keyboard Tester](http://www.keyboardtester.com) (网页版)
* [Keyboard Checker](http://keyboardchecker.com) (网页版)
## 使用QMK工具箱进行调试
[QMK工具箱](https://github.com/qmk/qmk_toolbox) 将会在你的`rules.mk`中有`CONSOLE_ENABLE = yes`的时候显示你键盘发来的消息。 默认情况下,输出极为有限,不过您可以打开调试模式来增加输出信息量。使用你键盘布局中的`DEBUG`键码,使用 [命令](feature_command.md) 特性来使能调试模式, 或者向你的布局中添加以下代码。
```c
void keyboard_post_init_user(void) {
// Customise these values to desired behaviour
debug_enable=true;
debug_matrix=true;
//debug_keyboard=true;
//debug_mouse=true;
}
```
<!-- 需要修改之处:这里要添加调试回显。 -->
## 发送您自己的调试消息
有时用[custom code](custom_quantum_functions.md)发送自定义调试信息很有用. 这么做很简单. 首先在你文件头部包含`print.h`:
#include <print.h>
之后,您可以使用一些不同的打印功能:
* `print("string")`: 打印简单字符串.
* `uprintf("%s string", var)`: 打印格式化字符串
* `dprint("string")`: 仅在调试模式使能时打印简单字符串
* `dprintf("%s string", var)`: 仅在调试模式使能时打印格式化字符串

View File

@ -158,7 +158,7 @@ void inline ws2812_setled(int i, uint8_t r, uint8_t g, uint8_t b)
void ws2812_setled_all (uint8_t r, uint8_t g, uint8_t b) void ws2812_setled_all (uint8_t r, uint8_t g, uint8_t b)
{ {
for (int i = 0; i < RGBLED_NUM; i++) { for (int i = 0; i < sizeof(led)/sizeof(led[0]); i++) {
led[i].r = r; led[i].r = r;
led[i].g = g; led[i].g = g;
led[i].b = b; led[i].b = b;

19
keyboards/adkb96/adkb96.c Normal file
View File

@ -0,0 +1,19 @@
#include "adkb96.h"
#ifdef SWAP_HANDS_ENABLE
__attribute__ ((weak))
const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = {
{{0, 6}, {1, 6}, {2, 6}, {3, 6}, {4, 6}, {5, 6}, {6, 6}, {7, 6}},
{{0, 7}, {1, 7}, {2, 7}, {3, 7}, {4, 7}, {5, 7}, {6, 7}, {7, 7}},
{{0, 8}, {1, 8}, {2, 8}, {3, 8}, {4, 8}, {5, 8}, {6, 8}, {7, 8}},
{{0, 9}, {1, 9}, {2, 9}, {3, 9}, {4, 9}, {5, 9}, {6, 9}, {7, 9}},
{{0,10}, {1,10}, {2,10}, {3,10}, {4,10}, {5,10}, {6,10}, {7,10}},
{{0,11}, {1,11}, {2,11}, {3,11}, {4,11}, {5,11}, {6,11}, {7,11}},
{{0, 0}, {1, 0}, {2, 0}, {3, 0}, {4, 0}, {5, 0}, {6, 0}, {7, 0}},
{{0, 1}, {1, 1}, {2, 1}, {3, 1}, {4, 1}, {5, 1}, {6, 1}, {7, 1}},
{{0, 2}, {1, 2}, {2, 2}, {3, 2}, {4, 2}, {5, 2}, {6, 2}, {7, 2}},
{{0, 3}, {1, 3}, {2, 3}, {3, 3}, {4, 3}, {5, 3}, {6, 3}, {7, 3}},
{{0, 4}, {1, 4}, {2, 4}, {3, 4}, {4, 4}, {5, 4}, {6, 4}, {7, 4}},
{{0, 5}, {1, 5}, {2, 5}, {3, 5}, {4, 5}, {5, 5}, {6, 5}, {7, 5}}
};
#endif

28
keyboards/adkb96/adkb96.h Normal file
View File

@ -0,0 +1,28 @@
#pragma once
#include "quantum.h"
#ifdef KEYBOARD_adkb96_rev1
#include "rev1.h"
#endif
// Used to create a keymap using only KC_ prefixed keys
#define LAYOUT_kc_ortho_6x16( \
L00, L01, L02, L03, L04, L05, L06, L07, R00, R01, R02, R03, R04, R05, R06, R07, \
L10, L11, L12, L13, L14, L15, L16, L17, R10, R11, R12, R13, R14, R15, R16, R17, \
L20, L21, L22, L23, L24, L25, L26, L27, R20, R21, R22, R23, R24, R25, R26, R27, \
L30, L31, L32, L33, L34, L35, L36, L37, R30, R31, R32, R33, R34, R35, R36, R37, \
L40, L41, L42, L43, L44, L45, L46, L47, R40, R41, R42, R43, R44, R45, R46, R47, \
L50, L51, L52, L53, L54, L55, L56, L57, R50, R51, R52, R53, R54, R55, R56, R57 \
) \
LAYOUT( \
KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##L06, KC_##L07, KC_##R00, KC_##R01, KC_##R02, KC_##R03, KC_##R04, KC_##R05, KC_##R06, KC_##R07, \
KC_##L10, KC_##L11, KC_##L12, KC_##L13, KC_##L14, KC_##L15, KC_##L16, KC_##L17, KC_##R10, KC_##R11, KC_##R12, KC_##R13, KC_##R14, KC_##R15, KC_##R16, KC_##R17, \
KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##L26, KC_##L27, KC_##R20, KC_##R21, KC_##R22, KC_##R23, KC_##R24, KC_##R25, KC_##R26, KC_##R27, \
KC_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##L34, KC_##L35, KC_##L36, KC_##L37, KC_##R30, KC_##R31, KC_##R32, KC_##R33, KC_##R34, KC_##R35, KC_##R36, KC_##R37, \
KC_##L40, KC_##L41, KC_##L42, KC_##L43, KC_##L44, KC_##L45, KC_##L46, KC_##L47, KC_##R40, KC_##R41, KC_##R42, KC_##R43, KC_##R44, KC_##R45, KC_##R46, KC_##R47, \
KC_##L50, KC_##L51, KC_##L52, KC_##L53, KC_##L54, KC_##L55, KC_##L56, KC_##L57, KC_##R50, KC_##R51, KC_##R52, KC_##R53, KC_##R54, KC_##R55, KC_##R56 ,KC_##R57 \
)
#define LAYOUT_kc LAYOUT_kc_ortho_6x16

22
keyboards/adkb96/config.h Normal file
View File

@ -0,0 +1,22 @@
/*
Copyright 2012 Jun Wako <wakojun@gmail.com>
Copyright 2015 Jack Humbert
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "config_common.h"

494
keyboards/adkb96/info.json Normal file
View File

@ -0,0 +1,494 @@
{
"keyboard_name": "adkb96",
"url": "",
"maintainer": "qmk",
"width": 16,
"height": 6,
"layouts": {
"LAYOUT_ortho_6x16": {
"key_count": 96,
"layout": [
{
"label": "L00",
"x": 0,
"y": 0
},
{
"label": "L01",
"x": 1,
"y": 0
},
{
"label": "L02",
"x": 2,
"y": 0
},
{
"label": "L03",
"x": 3,
"y": 0
},
{
"label": "L04",
"x": 4,
"y": 0
},
{
"label": "L05",
"x": 5,
"y": 0
},
{
"label": "L06",
"x": 6,
"y": 0
},
{
"label": "L07",
"x": 7,
"y": 0
},
{
"label": "R00",
"x": 8,
"y": 0
},
{
"label": "R01",
"x": 9,
"y": 0
},
{
"label": "R02",
"x": 10,
"y": 0
},
{
"label": "R03",
"x": 11,
"y": 0
},
{
"label": "R04",
"x": 12,
"y": 0
},
{
"label": "R05",
"x": 13,
"y": 0
},
{
"label": "R06",
"x": 14,
"y": 0
},
{
"label": "R07",
"x": 15,
"y": 0
},
{
"label": "L10",
"x": 0,
"y": 1
},
{
"label": "L11",
"x": 1,
"y": 1
},
{
"label": "L12",
"x": 2,
"y": 1
},
{
"label": "L13",
"x": 3,
"y": 1
},
{
"label": "L14",
"x": 4,
"y": 1
},
{
"label": "L15",
"x": 5,
"y": 1
},
{
"label": "L16",
"x": 6,
"y": 1
},
{
"label": "L17",
"x": 7,
"y": 1
},
{
"label": "R10",
"x": 8,
"y": 1
},
{
"label": "R11",
"x": 9,
"y": 1
},
{
"label": "R12",
"x": 10,
"y": 1
},
{
"label": "R13",
"x": 11,
"y": 1
},
{
"label": "R14",
"x": 12,
"y": 1
},
{
"label": "R15",
"x": 13,
"y": 1
},
{
"label": "R16",
"x": 14,
"y": 1
},
{
"label": "R17",
"x": 15,
"y": 1
},
{
"label": "L20",
"x": 0,
"y": 2
},
{
"label": "L21",
"x": 1,
"y": 2
},
{
"label": "L22",
"x": 2,
"y": 2
},
{
"label": "L23",
"x": 3,
"y": 2
},
{
"label": "L24",
"x": 4,
"y": 2
},
{
"label": "L25",
"x": 5,
"y": 2
},
{
"label": "L26",
"x": 6,
"y": 2
},
{
"label": "L27",
"x": 7,
"y": 2
},
{
"label": "R20",
"x": 8,
"y": 2
},
{
"label": "R21",
"x": 9,
"y": 2
},
{
"label": "R22",
"x": 10,
"y": 2
},
{
"label": "R23",
"x": 11,
"y": 2
},
{
"label": "R24",
"x": 12,
"y": 2
},
{
"label": "R25",
"x": 13,
"y": 2
},
{
"label": "R26",
"x": 14,
"y": 2
},
{
"label": "R27",
"x": 15,
"y": 2
},
{
"label": "L30",
"x": 0,
"y": 3
},
{
"label": "L31",
"x": 1,
"y": 3
},
{
"label": "L32",
"x": 2,
"y": 3
},
{
"label": "L33",
"x": 3,
"y": 3
},
{
"label": "L34",
"x": 4,
"y": 3
},
{
"label": "L35",
"x": 5,
"y": 3
},
{
"label": "L36",
"x": 6,
"y": 3
},
{
"label": "L37",
"x": 7,
"y": 3
},
{
"label": "R30",
"x": 8,
"y": 3
},
{
"label": "R31",
"x": 9,
"y": 3
},
{
"label": "R32",
"x": 10,
"y": 3
},
{
"label": "R33",
"x": 11,
"y": 3
},
{
"label": "R34",
"x": 12,
"y": 3
},
{
"label": "R35",
"x": 13,
"y": 3
},
{
"label": "R36",
"x": 14,
"y": 3
},
{
"label": "R37",
"x": 15,
"y": 3
},
{
"label": "L40",
"x": 0,
"y": 4
},
{
"label": "L41",
"x": 1,
"y": 4
},
{
"label": "L42",
"x": 2,
"y": 4
},
{
"label": "L43",
"x": 3,
"y": 4
},
{
"label": "L44",
"x": 4,
"y": 4
},
{
"label": "L45",
"x": 5,
"y": 4
},
{
"label": "L46",
"x": 6,
"y": 4
},
{
"label": "L47",
"x": 7,
"y": 4
},
{
"label": "R40",
"x": 8,
"y": 4
},
{
"label": "R41",
"x": 9,
"y": 4
},
{
"label": "R42",
"x": 10,
"y": 4
},
{
"label": "R43",
"x": 11,
"y": 4
},
{
"label": "R44",
"x": 12,
"y": 4
},
{
"label": "R45",
"x": 13,
"y": 4
},
{
"label": "R46",
"x": 14,
"y": 4
},
{
"label": "R47",
"x": 15,
"y": 4
},
{
"label": "L50",
"x": 0,
"y": 5
},
{
"label": "L51",
"x": 1,
"y": 5
},
{
"label": "L52",
"x": 2,
"y": 5
},
{
"label": "L53",
"x": 3,
"y": 5
},
{
"label": "L54",
"x": 4,
"y": 5
},
{
"label": "L55",
"x": 5,
"y": 5
},
{
"label": "L56",
"x": 6,
"y": 5
},
{
"label": "L57",
"x": 7,
"y": 5
},
{
"label": "R50",
"x": 8,
"y": 5
},
{
"label": "R51",
"x": 9,
"y": 5
},
{
"label": "R52",
"x": 10,
"y": 5
},
{
"label": "R53",
"x": 11,
"y": 5
},
{
"label": "R54",
"x": 12,
"y": 5
},
{
"label": "R55",
"x": 13,
"y": 5
},
{
"label": "R56",
"x": 14,
"y": 5
},
{
"label": "R57",
"x": 15,
"y": 5
}
]
}
}
}

View File

@ -0,0 +1,34 @@
/*
This is the c configuration file for the keymap
Copyright 2012 Jun Wako <wakojun@gmail.com>
Copyright 2015 Jack Humbert
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
/* Use I2C or Serial, not both */
#define USE_SERIAL
//#define USE_I2C
/* Select hand configuration */
#define MASTER_LEFT
// #define MASTER_RIGHT
// #define EE_HANDS
#define FORCE_NKRO

View File

@ -0,0 +1,15 @@
#include QMK_KEYBOARD_H
extern keymap_config_t keymap_config;
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT(
KC_ESC, XXXXXXX,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DELT,
KC_ZKHK,KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,KC_EQL, KC_JYEN,KC_BSPC,KC_BSPC,
KC_TAB, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,KC_RBRC,KC_ENT, KC_ENT,
KC_CAPS,KC_CAPS,KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT,KC_BSLS,KC_ENT, KC_ENT,
KC_LSFT,KC_LSFT,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,KC_RO, KC_UP, KC_RSFT,KC_RSFT,
KC_LCTL,KC_LALT,KC_LGUI,KC_MHEN,KC_SPC, KC_SPC, KC_SPC, KC_SPC, KC_HENK,KC_KANA,KC_RALT,KC_RCTL,KC_LEFT,KC_DOWN,KC_RGHT,XXXXXXX
)
};

View File

@ -0,0 +1,17 @@
# ADKB96
![ADKB96](http://btoshop.jp/wp-content/uploads/sites/3/2019/04/ADKB96_ALL.png)
A 16x6 ortholinear keyboard kit made and sold by Bit Trade One Ltd. [More info on Web](http://bit-trade-one.co.jp/selfmadekb/adkb96/)
Keyboard Maintainer: [Bit Trade One Ltd.](http://bit-trade-one.co.jp/)
Hardware Supported: ADKB96 PCB, Pro Micro
Hardware Availability: [PCB & case Data](https://github.com/bit-trade-one/ADKB96-hardware), [BTOS Shop](http://btoshop.jp/2019/04/11/4562469772424/)
Make example for this keyboard (after setting up your build environment):
```sh
make adkb96/rev1:default
```
See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).

View File

@ -16,44 +16,33 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef REV2_CONFIG_H
#define REV2_CONFIG_H
#include "config_common.h"
/* USB Device descriptor parameter */ /* USB Device descriptor parameter */
#define VENDOR_ID 0xFEED #define VENDOR_ID 0x00a5
#define PRODUCT_ID 0x6060 #define PRODUCT_ID 0xad96
#define DEVICE_VER 0x0100 #define DEVICE_VER 0x0001
#define MANUFACTURER Omkbd #define MANUFACTURER Bit Trade One
#define PRODUCT ErgoDash #define PRODUCT ADKB96
#define DESCRIPTION Power #define DESCRIPTION
/* key matrix size */ /* key matrix size */
// Rows are doubled-up // Rows are doubled-up
#define MATRIX_ROWS 10 #define MATRIX_ROWS 12
#define MATRIX_COLS 7 #define MATRIX_COLS 8
// wiring of each half // wiring of each half
#define MATRIX_ROW_PINS { D4, D7, E6, B4, B5 } #define MATRIX_ROW_PINS { D4, C6, D7, E6, B4, B5 }
#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, B2 } #define MATRIX_COL_PINS { B6, B2, B3, B1, F7, F6, F5, F4 }
// #define MATRIX_COL_PINS { B2, B3, B1, F7, F6, F5, F4 } //uncomment this line and comment line above if you need to reverse left-to-right key order
#define SOFT_SERIAL_PIN D0
/* define tapping term */ /* define tapping term */
#define TAPPING_TERM 120 #define TAPPING_TERM 100
/* define if matrix has ghost */ /* define if matrix has ghost */
//#define MATRIX_HAS_GHOST //#define MATRIX_HAS_GHOST
#define C6_AUDIO
/* number of backlight levels */ /* number of backlight levels */
#ifdef BACKLIGHT_ENABLE // #define BACKLIGHT_LEVELS 3
#define BACKLIGHT_PIN B6
#define BACKLIGHT_LEVELS 7
// #define BACKLIGHT_BREATHING
// #define BREATHING_PERIOD 4
#endif
/* Set 0 if debouncing isn't needed */ /* Set 0 if debouncing isn't needed */
#define DEBOUNCING_DELAY 5 #define DEBOUNCING_DELAY 5
@ -64,10 +53,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define LOCKING_RESYNC_ENABLE #define LOCKING_RESYNC_ENABLE
/* ws2812 RGB LED */ /* ws2812 RGB LED */
/*
#define RGB_DI_PIN D3 #define RGB_DI_PIN D3
#define RGBLED_NUM 24 // Number of LEDs #define RGBLED_NUM 12 // Number of LEDs
*/
/* /*
* Feature disable options * Feature disable options
* These options are also useful to firmware size reduction. * These options are also useful to firmware size reduction.
@ -86,4 +76,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
//#define NO_ACTION_MACRO //#define NO_ACTION_MACRO
//#define NO_ACTION_FUNCTION //#define NO_ACTION_FUNCTION
#endif

View File

@ -0,0 +1,15 @@
#include "adkb96.h"
void matrix_init_kb(void) {
// // green led on
// DDRD |= (1<<5);
// PORTD &= ~(1<<5);
// // orange led on
// DDRB |= (1<<0);
// PORTB &= ~(1<<0);
matrix_init_user();
};

View File

@ -0,0 +1,44 @@
#pragma once
#include "adkb96.h"
//void promicro_bootloader_jmp(bool program);
#ifdef USE_I2C
#include <stddef.h>
#ifdef __AVR__
#include <avr/io.h>
#include <avr/interrupt.h>
#endif
#endif
//void promicro_bootloader_jmp(bool program);
// Keymap with right side flipped
// (TRRS jack on both halves are to the right)
#define LAYOUT_ortho_6x16( \
L00, L01, L02, L03, L04, L05, L06, L07, R00, R01, R02, R03, R04, R05, R06, R07, \
L10, L11, L12, L13, L14, L15, L16, L17, R10, R11, R12, R13, R14, R15, R16, R17, \
L20, L21, L22, L23, L24, L25, L26, L27, R20, R21, R22, R23, R24, R25, R26, R27, \
L30, L31, L32, L33, L34, L35, L36, L37, R30, R31, R32, R33, R34, R35, R36, R37, \
L40, L41, L42, L43, L44, L45, L46, L47, R40, R41, R42, R43, R44, R45, R46, R47, \
L50, L51, L52, L53, L54, L55, L56, L57, R50, R51, R52, R53, R54, R55, R56, R57 \
) \
{ \
{ L00, L01, L02, L03, L04, L05, L06, L07 }, \
{ L10, L11, L12, L13, L14, L15, L16, L17 }, \
{ L20, L21, L22, L23, L24, L25, L26, L27 }, \
{ L30, L31, L32, L33, L34, L35, L36, L37 }, \
{ L40, L41, L42, L43, L44, L45, L46, L47 }, \
{ L50, L51, L52, L53, L54, L55, L56, L57 }, \
{ R00, R01, R02, R03, R04, R05, R06, R07 }, \
{ R10, R11, R12, R13, R14, R15, R16, R17 }, \
{ R20, R21, R22, R23, R24, R25, R26, R27 }, \
{ R30, R31, R32, R33, R34, R35, R36, R37 }, \
{ R40, R41, R42, R43, R44, R45, R46, R47 }, \
{ R50, R51, R52, R53, R54, R55, R56, R57 } \
}
#define LAYOUT LAYOUT_ortho_6x16

View File

@ -1,5 +1,3 @@
# MCU name # MCU name
#MCU = at90usb1287 #MCU = at90usb1287
MCU = atmega32u4 MCU = atmega32u4
@ -36,20 +34,26 @@ ARCH = AVR8
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. # CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
F_USB = $(F_CPU) F_USB = $(F_CPU)
# Bootloader
# This definition is optional, and if your keyboard supports multiple bootloaders of
# different sizes, comment this out, and the correct address will be loaded
# automatically (+60). See bootloader.mk for all options.
ifeq ($(strip $(KEYBOARD)), preonic/rev1)
BOOTLOADER = atmel-dfu
endif
ifeq ($(strip $(KEYBOARD)), preonic/rev2)
BOOTLOADER = qmk-dfu
endif
# Interrupt driven control endpoint task(+60) # Interrupt driven control endpoint task(+60)
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
# Bootloader selection
# Teensy halfkay
# Pro Micro caterina
# Atmel DFU atmel-dfu
# LUFA DFU lufa-dfu
# QMK DFU qmk-dfu
# atmega32a bootloadHID
BOOTLOADER = caterina
# Boot Section Size in *bytes*
# Teensy halfKay 512
# Teensy++ halfKay 1024
# Atmel DFU loader 4096
# LUFA bootloader 4096
# USBaspLoader 2048
# OPT_DEFS += -DBOOTLOADER_SIZE=4096
# Build Options # Build Options
# change to "no" to disable the options, or define them in the Makefile in # change to "no" to disable the options, or define them in the Makefile in
# the appropriate keymap folder that will get included automatically # the appropriate keymap folder that will get included automatically
@ -57,18 +61,18 @@ OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE = no # Mouse keys(+4700) MOUSEKEY_ENABLE = no # Mouse keys(+4700)
EXTRAKEY_ENABLE = yes # Audio control and System control(+450) EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
CONSOLE_ENABLE = yes # Console for debug(+400) CONSOLE_ENABLE = no # Console for debug(+400)
COMMAND_ENABLE = no # Commands for debug and configuration COMMAND_ENABLE = yes # Commands for debug and configuration
NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
MIDI_ENABLE = no # MIDI controls MIDI_ENABLE = no # MIDI controls
AUDIO_ENABLE = yes # Audio output on port C6 AUDIO_ENABLE = no # Audio output on port C6
UNICODE_ENABLE = no # Unicode UNICODE_ENABLE = no # Unicode
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
API_SYSEX_ENABLE = no
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
LAYOUTS = ortho_5x12 SPLIT_KEYBOARD = yes
DEFAULT_FOLDER = adkb96/rev1

View File

@ -1,21 +1,24 @@
Atreus Atreus
=== ======
A small mechanical keyboard that is based around the shape of the human hand. A small mechanical keyboard that is based around the shape of the human hand.
These configuration files are specifically for the Atreus keyboards created by Phil Hagelberg (@technomancy). This keyboard is available in two variants: one powered by a Teensy 2, (usually hand-wired) one powered by an A-Star. (usually using a PCB) This repository currently assumes that you have an A-Star powered Atreus. If you are using a Teensy2, specify that by adding `TEENSY2=yes` to your `make` commands.
Keyboard Maintainer: [Phil Hagelberg](https://github.com/technomancy) Keyboard Maintainer: [Phil Hagelberg](https://github.com/technomancy)
Hardware Supported: Atreus, PCB-based or hand-wired Hardware Supported: Atreus, PCB-based or hand-wired
Hardware Availability: https://atreus.technomancy.us Hardware Availability: https://atreus.technomancy.us
Make example for this keyboard (after setting up your build environment): These configuration files are specifically for the Atreus keyboards created by Phil Hagelberg (@technomancy). This keyboard is available in two variants: one powered by a Teensy 2 (usually hand-wired), one powered by an A-Star (usually using a PCB). You will need to use different `make` commands depending on the variant you have; see examples below.
make atreus:default:avrdude A-Star:\
`make atreus:default:avrdude`
Unlike the TMK firmware, this command should be run from the root of Teensy:\
the repository, not the directory containing this readme. `make TEENSY2=yes atreus:default:teensy`
If your keyboard layout is a mirror image of what you expected (i.e. you do not get QWERTY on the left but YTREWQ on the right), then you have an A-Star powered Atreus (older than March 2016) with PCB labels facing *down* instead of up. Specify that by adding `PCBDOWN=yes` to your `make` commands. If your keyboard layout is a mirror image of what you expected (i.e. you do not get QWERTY on the left but YTREWQ on the right), then you have an A-Star powered Atreus (older than March 2016) with PCB labels facing *down* instead of up. Specify that by adding `PCBDOWN=yes` to your `make` commands, e.g.
See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. `make PCBDOWN=yes atreus:default:avrdude`
*Unlike the TMK firmware, these commands should be run from the root of the repository, not the directory containing this readme.*
See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools), then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information.

View File

@ -1,19 +1,4 @@
ifdef TEENSY2
OPT_DEFS += -DATREUS_TEENSY2
ATREUS_UPLOAD_COMMAND = teensy_loader_cli -w -mmcu=$(MCU) $(TARGET).hex
else
OPT_DEFS += -DATREUS_ASTAR
ifdef PCBDOWN
OPT_DEFS += -DPCBDOWN
endif
ATREUS_UPLOAD_COMMAND = while [ ! -r $(USB) ]; do sleep 1; done; \
avrdude -p $(MCU) -c avr109 -U flash:w:$(TARGET).hex -P $(USB)
endif
# MCU name # MCU name
#MCU = at90usb1287
MCU = atmega32u4 MCU = atmega32u4
# Processor frequency. # Processor frequency.
@ -48,34 +33,56 @@ ARCH = AVR8
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. # CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
F_USB = $(F_CPU) F_USB = $(F_CPU)
# Bootloader
# This definition is optional, and if your keyboard supports multiple bootloaders of
# different sizes, comment this out, and the correct address will be loaded
# automatically (+60). See bootloader.mk for all options.
ifdef TEENSY2
BOOTLOADER = halfkay
else
BOOTLOADER = caterina
endif
# Interrupt driven control endpoint task(+60) # Interrupt driven control endpoint task(+60)
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
# Bootloader selection
# Teensy halfkay
# Pro Micro caterina
# Atmel DFU atmel-dfu
# LUFA DFU lufa-dfu
# QMK DFU qmk-dfu
# atmega32a bootloadHID
ifdef TEENSY2
BOOTLOADER = halfkay
OPT_DEFS += -DATREUS_TEENSY2
else
BOOTLOADER = caterina
OPT_DEFS += -DATREUS_ASTAR
ifdef PCBDOWN
OPT_DEFS += -DPCBDOWN
endif
endif
# If you don't know the bootloader type, then you can specify the
# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line
# Teensy halfKay 512
# Teensy++ halfKay 1024
# Atmel DFU loader 4096
# LUFA bootloader 4096
# USBaspLoader 2048
# OPT_DEFS += -DBOOTLOADER_SIZE=4096
# Build Options # Build Options
# comment out to disable the options. # change yes to no to disable
# #
#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE = yes # Mouse keys(+4700) MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
EXTRAKEY_ENABLE = yes # Audio control and System control(+450) EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
CONSOLE_ENABLE = yes # Console for debug(+400) CONSOLE_ENABLE = yes # Console for debug(+400)
COMMAND_ENABLE = yes # Commands for debug and configuration COMMAND_ENABLE = yes # Commands for debug and configuration
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
# SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA # if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
# BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality NKRO_ENABLE = yes # USB Nkey Rollover
# MIDI_ENABLE = YES # MIDI controls BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default
UNICODE_ENABLE = YES # Unicode RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
# BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config)
UNICODE_ENABLE = yes # Unicode
USB = /dev/cu.usbmodem1411 BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
AUDIO_ENABLE = no # Audio output on port C6
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400)

View File

@ -123,7 +123,7 @@
{"label":";", "x":10.75, "y":2}, {"label":";", "x":10.75, "y":2},
{"label":"'", "x":11.75, "y":2}, {"label":"'", "x":11.75, "y":2},
{"label":"ISO #", "x":12.75, "y":2}, {"label":"ISO #", "x":12.75, "y":2},
{"label":"Enter", "x":13.75, "y":2, "w":1.25, "h":2}, {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2},
{"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"Shift", "x":0, "y":3, "w":1.25},
{"label":"ISO \\", "x":1.25, "y":3}, {"label":"ISO \\", "x":1.25, "y":3},
{"label":"Z", "x":2.25, "y":3}, {"label":"Z", "x":2.25, "y":3},

15
keyboards/bm16s/bm16s.h Executable file
View File

@ -0,0 +1,15 @@
#pragma once
#include "quantum.h"
#define LAYOUT_ortho_4x4( \
K00, K01, K02, K03, \
K10, K11, K12, K13, \
K20, K21, K22, K23, \
K30, K31, K32, K33 \
) { \
{ K00, K01, K02, K03 }, \
{ K10, K11, K12, K13 }, \
{ K20, K21, K22, K23 }, \
{ K30, K31, K32, K33 } \
}

46
keyboards/bm16s/config.h Executable file
View File

@ -0,0 +1,46 @@
#pragma once
#include "config_common.h"
/* USB Device descriptor parameter */
#define VENDOR_ID 0xFEED
#define PRODUCT_ID 0x6060
#define DEVICE_VER 0x0001
#define MANUFACTURER KPrepublic
#define PRODUCT bm16s
#define DESCRIPTION KPrepublic bm16s
/* key matrix size */
#define MATRIX_ROWS 4
#define MATRIX_COLS 4
/* key matrix pins */
#define MATRIX_ROW_PINS { D1, D0, D3, D2 }
#define MATRIX_COL_PINS { F7, F6, D4, D6 }
#define UNUSED_PINS
/* COL2ROW or ROW2COL */
#define DIODE_DIRECTION COL2ROW
/* number of backlight levels */
#ifdef BACKLIGHT_PIN
#define BACKLIGHT_LEVELS 3
#endif
/* Set 0 if debouncing isn't needed */
#define 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 E2
#ifdef RGB_DI_PIN
#define RGBLIGHT_ANIMATIONS
#define RGBLED_NUM 16
#define RGBLIGHT_HUE_STEP 8
#define RGBLIGHT_SAT_STEP 8
#define RGBLIGHT_VAL_STEP 8
#endif

30
keyboards/bm16s/info.json Normal file
View File

@ -0,0 +1,30 @@
{
"keyboard_name": "bm16s",
"url": "",
"maintainer": "qmk",
"width": 4,
"height": 4,
"layouts": {
"LAYOUT_ortho_4x4": {
"key_count": 16,
"layout": [
{"x":0, "y":0},
{"x":1, "y":0},
{"x":2, "y":0},
{"x":3, "y":0},
{"x":0, "y":1},
{"x":1, "y":1},
{"x":2, "y":1},
{"x":3, "y":1},
{"x":0, "y":2},
{"x":1, "y":2},
{"x":2, "y":2},
{"x":3, "y":2},
{"x":0, "y":3},
{"x":1, "y":3},
{"x":2, "y":3},
{"x":3, "y":3}
]
}
}
}

View File

@ -0,0 +1,16 @@
#include QMK_KEYBOARD_H
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT_ortho_4x4(
KC_KP_7, KC_KP_8, KC_KP_9, MO(1), \
KC_KP_4, KC_KP_5, KC_KP_6, KC_PMNS, \
KC_KP_1, KC_KP_2, KC_KP_3, KC_PPLS, \
KC_KP_0, KC_PDOT, KC_PCMM, KC_PENT \
),
[1] = LAYOUT_ortho_4x4(
RESET, BL_STEP, _______, KC_VOLU, \
BL_TOGG, BL_DEC, BL_INC, KC_VOLD, \
RGB_TOG, RGB_MOD, RGB_HUI, KC_MUTE, \
RGB_SAI, RGB_SAD, RGB_HUD, _______ \
),
};

View File

@ -0,0 +1,20 @@
#include QMK_KEYBOARD_H
#define RGB_BRU RGB_VAI
#define RGB_BRD RGB_VAD
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT_ortho_4x4(
KC_BRIU, _______, _______, KC_VOLU, \
KC_BRID, _______, _______, KC_VOLD, \
_______, _______, _______, KC_MUTE, \
KC_MPRV, KC_MPLY, KC_MNXT, MO(1) \
),
[1] = LAYOUT_ortho_4x4(
RESET, _______, _______, _______, \
RGB_SPD, RGB_BRU, RGB_SPI, _______, \
RGB_RMOD, RGB_BRD, RGB_MOD, _______, \
RGB_TOG, _______, _______, _______ \
),
};

13
keyboards/bm16s/readme.md Normal file
View File

@ -0,0 +1,13 @@
# bm16s
A 16-key macropad, with USB C and per-key RGB backlighting. This is a variant of the BM16A, but with low profile Choc switches.
Keyboard Maintainer: QMK Community
Hardware Supported: The PCBs, controllers supported
Hardware Availability: [KPrepublic](https://kprepublic.com/collections/pcb/products/bm16s-16-keys-custom-mechanical-keyboard-pcb-plate-programmed-numpad-layouts-qmk-firmware-with-rgb-switch-leds-choc-switch); [AliExpress](https://www.aliexpress.com/item/bm16s-16-keys-Custom-Mechanical-Keyboard-PCB-plate-programmed-numpad-layouts-qmk-firmware-with-rgb-switch/32999247908.html); [Massdrop](https://www.massdrop.com/buy/78169)
Make example for this keyboard (after setting up your build environment):
make bm16s:default
See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).

72
keyboards/bm16s/rules.mk Executable file
View File

@ -0,0 +1,72 @@
# MCU name
MCU = atmega32u4
# Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code.
#
# This will be an integer division of F_USB below, as it is sourced by
# F_USB after it has run through any CPU prescalers. Note that this value
# does not *change* the processor frequency - it should merely be updated to
# reflect the processor speed set externally so that the code can use accurate
# software delays.
F_CPU = 16000000
#
# LUFA specific
#
# Target architecture (see library "Board Types" documentation).
ARCH = AVR8
# Input clock frequency.
# This will define a symbol, F_USB, in all source code files equal to the
# input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
# at the end, this will be done automatically to create a 32-bit value in your
# source code.
#
# If no clock division is performed on the input clock inside the AVR (via the
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
F_USB = $(F_CPU)
# Interrupt driven control endpoint task(+60)
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
# Bootloader selection
# Teensy halfkay
# Pro Micro caterina
# Atmel DFU atmel-dfu
# LUFA DFU lufa-dfu
# QMK DFU qmk-dfu
# atmega32a bootloadHID
BOOTLOADER = atmel-dfu
# If you don't know the bootloader type, then you can specify the
# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line
# Teensy halfKay 512
# Teensy++ halfKay 1024
# Atmel DFU loader 4096
# LUFA bootloader 4096
# USBaspLoader 2048
# OPT_DEFS += -DBOOTLOADER_SIZE=4096
# Build Options
# comment out to disable the options.
#
BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration
MOUSEKEY_ENABLE = yes # Mouse keys
EXTRAKEY_ENABLE = yes # Audio control and System control
CONSOLE_ENABLE = no # Console for debug
COMMAND_ENABLE = no # Commands for debug and configuration
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
AUDIO_ENABLE = no
RGBLIGHT_ENABLE = yes
LAYOUTS = ortho_4x4

View File

@ -0,0 +1,16 @@
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once

View File

@ -0,0 +1,95 @@
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include QMK_KEYBOARD_H
enum layer {
_BASE,
_FN,
_BACKLIT
};
#define FN MO(_FN)
#define BACKLIT MO(_BACKLIT)
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* BASE
* .-----------------------------------------------------------------------------------------------------------------------------.
* | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | + | \ |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
* | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | BACKSP |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------|
* | LCTRL | A | S | D | F | G | H | J | K | L | ; | ' | ENTER | HOME |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------|
* | LSHIFT | Z | X | C | V | B | N | M | , | . | / | RSHIFT | FN | END |
* |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+-----------------+--------+--------|
* | | LALT | LGUI | SPACE | RGUI | RALT | |
* '-----------------------------------------------------------------------------------------------------------------------------'
*/
[_BASE] = LAYOUT_ortho_7u(
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC,
KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_HOME,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, FN, KC_END,
KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT
),
/* FUNCTION
* .-----------------------------------------------------------------------------------------------------------------------------.
* | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | ` |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
* | | | | | | | | | | | UP | | | DEL |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------|
* | | VOLD | VOLU | MUTE | | | | | | | LEFT | RIGHT | | PG_UP |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------|
* | | | | | | | | | | | DOWN | | | PG_DN |
* |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+-----------------+--------+--------|
* | | | | | | | |
* '-----------------------------------------------------------------------------------------------------------------------------'
*/
[_FN] = LAYOUT_ortho_7u(
_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_GRV,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_UP, _______, _______, KC_DEL,
_______, KC_VOLD, KC_VOLU, KC_MUTE, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_RGHT, _______, KC_PGUP,
BACKLIT, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DOWN, _______, _______, KC_PGDN,
_______, _______, _______, _______, _______
),
/* BACKLIT
* .-----------------------------------------------------------------------------------------------------------------------------.
* | | | | | | | | | | | | | | |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
* | | RGBTOG | RGBMOD | RGBHUI | RGBHUD | RGBSAI | RGBSAD | RGBVAI | RGBVAD | | | | | |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------|
* | | | | | | | | | | | | | | |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------|
* | | | | | | | | | | | | | | |
* |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+-----------------+--------+--------|
* | | | | | | | |
* '-----------------------------------------------------------------------------------------------------------------------------'
*/
[_BACKLIT] = LAYOUT_ortho_7u(
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______
)
};

View File

@ -0,0 +1,215 @@
/* Copyright 2019 ishtob
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "2019.h"
#include "qwiic.h"
#include "action_layer.h"
#include "haptic.h"
#ifdef RGB_MATRIX_ENABLE
#include "rgb_matrix.h"
led_config_t g_led_config = { {
{ 5, NO_LED, NO_LED, 0 },
{ NO_LED, NO_LED, NO_LED, NO_LED },
{ 4, NO_LED, NO_LED, 1 },
{ 3, NO_LED, NO_LED, 2 }
}, {
{ 188, 16 }, { 187, 48 }, { 149, 64 }, { 112, 64 }, { 37, 48 }, { 38, 16 }
}, {
4, 4, 4, 4, 4, 4
} };
#endif
uint8_t *o_fb;
uint16_t counterst = 0;
#ifdef QWIIC_MICRO_OLED_ENABLE
/* screen off after this many milliseconds */
#include "timer.h"
#define ScreenOffInterval 60000 /* milliseconds */
static uint16_t last_flush;
volatile uint8_t led_numlock = false;
volatile uint8_t led_capslock = false;
volatile uint8_t led_scrolllock = false;
static uint8_t layer;
static bool queue_for_send = false;
static uint8_t encoder_value = 32;
__attribute__ ((weak))
void draw_ui(void) {
clear_buffer();
last_flush = timer_read();
send_command(DISPLAYON);
/* Boston MK title is 55 x 10 pixels */
#define NAME_X 0
#define NAME_Y 0
draw_string(NAME_X + 1, NAME_Y + 2, "BOSTON MK", PIXEL_ON, NORM, 0);
/* Layer indicator is 41 x 10 pixels */
#define LAYER_INDICATOR_X 60
#define LAYER_INDICATOR_Y 0
draw_string(LAYER_INDICATOR_X + 1, LAYER_INDICATOR_Y + 2, "LAYER", PIXEL_ON, NORM, 0);
draw_rect_filled_soft(LAYER_INDICATOR_X + 32, LAYER_INDICATOR_Y + 1, 9, 9, PIXEL_ON, NORM);
draw_char(LAYER_INDICATOR_X + 34, LAYER_INDICATOR_Y + 2, layer + 0x30, PIXEL_ON, XOR, 0);
/* Matrix display is 12 x 12 pixels */
#define MATRIX_DISPLAY_X 8
#define MATRIX_DISPLAY_Y 16
for (uint8_t x = 0; x < MATRIX_ROWS; x++) {
for (uint8_t y = 0; y < MATRIX_COLS; y++) {
draw_pixel(MATRIX_DISPLAY_X + y + y + 2, MATRIX_DISPLAY_Y + x + x + 2,(matrix_get_row(x) & (1 << y)) > 0, NORM);
draw_pixel(MATRIX_DISPLAY_X + y + y + 3, MATRIX_DISPLAY_Y + x + x + 2,(matrix_get_row(x) & (1 << y)) > 0, NORM);
draw_pixel(MATRIX_DISPLAY_X + y + y + 2, MATRIX_DISPLAY_Y + x + x + 3,(matrix_get_row(x) & (1 << y)) > 0, NORM);
draw_pixel(MATRIX_DISPLAY_X + y + y + 3, MATRIX_DISPLAY_Y + x + x + 3,(matrix_get_row(x) & (1 << y)) > 0, NORM);
}
}
draw_rect_soft(MATRIX_DISPLAY_X, MATRIX_DISPLAY_Y, 12, 12, PIXEL_ON, NORM);
/* hadron oled location on thumbnail */
draw_rect_filled_soft(MATRIX_DISPLAY_X + 5, MATRIX_DISPLAY_Y + 2, 6, 2, PIXEL_ON, NORM);
/*
draw_rect_soft(0, 13, 64, 6, PIXEL_ON, NORM);
draw_line_vert(encoder_value, 13, 6, PIXEL_ON, NORM);
*/
/* Mod display is 41 x 16 pixels */
#define MOD_DISPLAY_X 60
#define MOD_DISPLAY_Y 20
uint8_t mods = get_mods();
if (mods & MOD_LSFT) {
draw_rect_filled_soft(MOD_DISPLAY_X + 0, MOD_DISPLAY_Y, 5 + (1 * 6), 11, PIXEL_ON, NORM);
draw_string(MOD_DISPLAY_X + 3, MOD_DISPLAY_Y + 2, "S", PIXEL_OFF, NORM, 0);
} else {
draw_string(MOD_DISPLAY_X + 3, MOD_DISPLAY_Y + 2, "S", PIXEL_ON, NORM, 0);
}
if (mods & MOD_LCTL) {
draw_rect_filled_soft(MOD_DISPLAY_X + 10, MOD_DISPLAY_Y, 5 + (1 * 6), 11, PIXEL_ON, NORM);
draw_string(MOD_DISPLAY_X + 13, MOD_DISPLAY_Y + 2, "C", PIXEL_OFF, NORM, 0);
} else {
draw_string(MOD_DISPLAY_X + 13, MOD_DISPLAY_Y + 2, "C", PIXEL_ON, NORM, 0);
}
if (mods & MOD_LALT) {
draw_rect_filled_soft(MOD_DISPLAY_X + 20, MOD_DISPLAY_Y, 5 + (1 * 6), 11, PIXEL_ON, NORM);
draw_string(MOD_DISPLAY_X + 23, MOD_DISPLAY_Y + 2, "A", PIXEL_OFF, NORM, 0);
} else {
draw_string(MOD_DISPLAY_X + 23, MOD_DISPLAY_Y + 2, "A", PIXEL_ON, NORM, 0);
}
if (mods & MOD_LGUI) {
draw_rect_filled_soft(MOD_DISPLAY_X + 30, MOD_DISPLAY_Y, 5 + (1 * 6), 11, PIXEL_ON, NORM);
draw_string(MOD_DISPLAY_X + 33, MOD_DISPLAY_Y + 2, "G", PIXEL_OFF, NORM, 0);
} else {
draw_string(MOD_DISPLAY_X + 33, MOD_DISPLAY_Y + 2, "G", PIXEL_ON, NORM, 0);
}
/* Lock display is 23 x 32 */
#define LOCK_DISPLAY_X 104
#define LOCK_DISPLAY_Y 0
if (led_numlock == true) {
draw_rect_filled_soft(LOCK_DISPLAY_X, LOCK_DISPLAY_Y, 5 + (3 * 6), 9, PIXEL_ON, NORM);
draw_string(LOCK_DISPLAY_X + 3, LOCK_DISPLAY_Y + 1, "NUM", PIXEL_OFF, NORM, 0);
} else if (led_numlock == false) {
draw_string(LOCK_DISPLAY_X + 3, LOCK_DISPLAY_Y + 1, "NUM", PIXEL_ON, NORM, 0);
}
if (led_capslock == true) {
draw_rect_filled_soft(LOCK_DISPLAY_X + 0, LOCK_DISPLAY_Y + 11, 5 + (3 * 6), 9, PIXEL_ON, NORM);
draw_string(LOCK_DISPLAY_X + 3, LOCK_DISPLAY_Y + 11 +1, "CAP", PIXEL_OFF, NORM, 0);
} else if (led_capslock == false) {
draw_string(LOCK_DISPLAY_X + 3, LOCK_DISPLAY_Y + 11 +1, "CAP", PIXEL_ON, NORM, 0);
}
if (led_scrolllock == true) {
draw_rect_filled_soft(LOCK_DISPLAY_X + 0, LOCK_DISPLAY_Y + 22, 5 + (3 * 6), 9, PIXEL_ON, NORM);
draw_string(LOCK_DISPLAY_X + 3, LOCK_DISPLAY_Y + 22 +1, "SCR", PIXEL_OFF, NORM, 0);
} else if (led_scrolllock == false) {
draw_string(LOCK_DISPLAY_X + 3, LOCK_DISPLAY_Y + 22 +1, "SCR", PIXEL_ON, NORM, 0);
}
send_buffer();
}
void led_set_user(uint8_t usb_led) {
if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) {
if (led_numlock == false){led_numlock = true;}
} else {
if (led_numlock == true){led_numlock = false;}
}
if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) {
if (led_capslock == false){led_capslock = true;}
} else {
if (led_capslock == true){led_capslock = false;}
}
if (IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK)) {
if (led_scrolllock == false){led_scrolllock = true;}
} else {
if (led_scrolllock == true){led_scrolllock = false;}
}
}
uint32_t layer_state_set_kb(uint32_t state) {
state = layer_state_set_user(state);
layer = biton32(state);
queue_for_send = true;
return state;
}
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
queue_for_send = true;
return process_record_user(keycode, record);
}
void encoder_update_kb(uint8_t index, bool clockwise) {
encoder_value = (encoder_value + (clockwise ? 1 : -1)) % 64;
queue_for_send = true;
}
#endif
void matrix_init_kb(void) {
queue_for_send = true;
matrix_init_user();
}
void matrix_scan_kb(void) {
if (queue_for_send) {
#ifdef QWIIC_MICRO_OLED_ENABLE
draw_ui();
#endif
queue_for_send = false;
}
#ifdef QWIIC_MICRO_OLED_ENABLE
if (timer_elapsed(last_flush) > ScreenOffInterval) {
send_command(DISPLAYOFF); /* 0xAE */
}
#endif
if (counterst == 0) {
//testPatternFB(o_fb);
}
counterst = (counterst + 1) % 1024;
//rgblight_task();
matrix_scan_user();
}

View File

@ -0,0 +1,19 @@
/* Copyright 2019 ishtob
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "boston_meetup.h"

View File

@ -0,0 +1,196 @@
#pragma once
/* USB Device descriptor parameter */
#define DEVICE_VER 0x07E3
#undef MATRIX_ROWS
#undef MATRIX_COLS
/* key matrix size */
#define MATRIX_ROWS 4
#define MATRIX_COLS 4
/*
* Keyboard Matrix Assignments
*
* Change this to how you wired your keyboard
* COLS: AVR pins used for columns, left to right
* ROWS: AVR pins used for rows, top to bottom
* DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
* ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
*
*/
#undef MATRIX_ROW_PINS
#undef MATRIX_COL_PINS
#define MATRIX_ROW_PINS { A3, B8, B9, B1 }
#define MATRIX_COL_PINS { A7, A8, B2, B10 }
#define NUMBER_OF_ENCODERS 1
#define ENCODERS_PAD_A { B13 }
#define ENCODERS_PAD_B { B14 }
//Audio
#undef AUDIO_VOICES
#undef C6_AUDIO
#ifdef AUDIO_ENABLE
#define STARTUP_SONG SONG(ONE_UP_SOUND)
// #define STARTUP_SONG SONG(NO_SOUND)
#define AUDIO_CLICKY
/* to enable clicky on startup */
//#define AUDIO_CLICKY_ON
#define AUDIO_CLICKY_FREQ_RANDOMNESS 1.5f
#endif
//configure qwiic micro_oled driver for the 128x32 oled
#ifdef QWIIC_MICRO_OLED_ENABLE
#undef I2C_ADDRESS_SA0_1
#define I2C_ADDRESS_SA0_1 0b0111100
#define LCDWIDTH 128
#define LCDHEIGHT 32
#define micro_oled_rotate_180
#endif
/*
* Keyboard Matrix Assignments
*
* Change this to how you wired your keyboard
* COLS: AVR pins used for columns, left to right
* ROWS: AVR pins used for rows, top to bottom
* DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
* ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
*
*/
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
#define DEBOUNCE 6
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
//#define LOCKING_SUPPORT_ENABLE
/* Locking resynchronize hack */
//#define LOCKING_RESYNC_ENABLE
/*
* Force NKRO
*
* Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
* state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
* makefile for this to work.)
*
* If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
* until the next keyboard reset.
*
* NKRO may prevent your keystrokes from being detected in the BIOS, but it is
* fully operational during normal computer usage.
*
* For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
* or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
* bootmagic, NKRO mode will always be enabled until it is toggled again during a
* power-up.
*
*/
//#define FORCE_NKRO
/*
* Feature disable options
* These options are also useful to firmware size reduction.
*/
/* disable debug print */
//#define NO_DEBUG
/* disable print */
//#define NO_PRINT
/* disable action features */
//#define NO_ACTION_LAYER
//#define NO_ACTION_TAPPING
//#define NO_ACTION_ONESHOT
//#define NO_ACTION_MACRO
//#define NO_ACTION_FUNCTION
/*
* MIDI options
*/
/* Prevent use of disabled MIDI features in the keymap */
//#define MIDI_ENABLE_STRICT 1
/* enable basic MIDI features:
- MIDI notes can be sent when in Music mode is on
*/
#define MIDI_BASIC
/* enable advanced MIDI features:
- MIDI notes can be added to the keymap
- Octave shift and transpose
- Virtual sustain, portamento, and modulation wheel
- etc.
*/
//#define MIDI_ADVANCED
/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
//#define MIDI_TONE_KEYCODE_OCTAVES 2
/* Haptic Driver initialization settings
* Feedback Control Settings */
#define FB_ERM_LRA 1 /* For ERM:0 or LRA:1*/
#define FB_BRAKEFACTOR 6 /* For 1x:0, 2x:1, 3x:2, 4x:3, 6x:4, 8x:5, 16x:6, Disable Braking:7 */
#define FB_LOOPGAIN 1 /* For Low:0, Medium:1, High:2, Very High:3 */
/* default 3V ERM vibration motor voltage and library*/
#if FB_ERM_LRA == 0
#define RATED_VOLTAGE 3
#define V_RMS 2.3
#define V_PEAK 3.30
/* Library Selection */
#define LIB_SELECTION 4 /* For Empty:0' TS2200 library A to D:1-5, LRA Library: 6 */
/* default 2V LRA voltage and library */
#elif FB_ERM_LRA == 1
#define RATED_VOLTAGE 2
#define V_RMS 2.0
#define V_PEAK 2.85
#define F_LRA 200
/* Library Selection */
#define LIB_SELECTION 6 /* For Empty:0' TS2200 library A to D:1-5, LRA Library: 6 */
#endif
/* Control 1 register settings */
#define DRIVE_TIME 25
#define AC_COUPLE 0
#define STARTUP_BOOST 1
/* Control 2 Settings */
#define BIDIR_INPUT 1
#define BRAKE_STAB 1 /* Loopgain is reduced when braking is almost complete to improve stability */
#define SAMPLE_TIME 3
#define BLANKING_TIME 1
#define IDISS_TIME 1
/* Control 3 settings */
#define NG_THRESH 2
#define ERM_OPEN_LOOP 1
#define SUPPLY_COMP_DIS 0
#define DATA_FORMAT_RTO 0
#define LRA_DRIVE_MODE 0
#define N_PWM_ANALOG 0
#define LRA_OPEN_LOOP 0
/* Control 4 settings */
#define ZC_DET_TIME 0
#define AUTO_CAL_TIME 3
#define RGBLIGHT_ANIMATIONS
#define RGBLED_NUM 10
#define RGB_DI_PIN B5
#define DRIVER_LED_TOTAL RGBLED_NUM
#define RGB_MATRIX_KEYPRESSES
#define SOLENOID_PIN A14

View File

@ -0,0 +1,12 @@
{
"keyboard_name": "Boston Meetup 2019",
"url": "",
"maintainer": "qmk",
"width": 4,
"height": 4,
"layouts": {
"LAYOUT": {
"key_count": 13,
"layout": [{"label":"K00", "x":0, "y":0}, {"label":"K10", "x":0, "y":1}, {"label":"K11", "x":1, "y":1}, {"label":"K12", "x":2, "y":1}, {"label":"K13", "x":3, "y":1}, {"label":"K20", "x":0, "y":2}, {"label":"K21", "x":1, "y":2}, {"label":"K22", "x":2, "y":2}, {"label":"K23", "x":3, "y":2}, {"label":"K30", "x":0, "y":3}, {"label":"K31", "x":1, "y":3}, {"label":"K32", "x":2, "y":3}, {"label":"K33", "x":3, "y":3}] }
}
}

View File

@ -0,0 +1,166 @@
#include QMK_KEYBOARD_H
// Each layer gets a name for readability, which is then used in the keymap matrix below.
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
// Layer names don't all need to be of the same length, obviously, and you can also skip them
// entirely and just use numbers.
enum custom_layers {
_BASE,
_LOWER,
_RAISE,
_ADJUST
};
enum custom_keycodes {
BASE = SAFE_RANGE,
LOWER,
RAISE,
KC_DEMOMACRO
};
// Custom macros
#define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl
#define CTL_TTAB CTL_T(KC_TAB) // Tap for Esc, hold for Ctrl
#define CTL_ENT CTL_T(KC_ENT) // Tap for Enter, hold for Ctrl
#define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift
// Requires KC_TRNS/_______ for the trigger key in the destination layer
#define LT_MC(kc) LT(_MOUSECURSOR, kc) // L-ayer T-ap M-ouse C-ursor
#define LT_RAI(kc) LT(_RAISE, kc) // L-ayer T-ap to Raise
#define DEMOMACRO KC_DEMOMACRO // Sample for macros
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Base
* ,------.
* | Esc |
* |------+------+-------------.
* | : | 7 | 8 | 9 |
* |------+------+------+------|
* | RAISE| 4 | 5 | 6 |
* |------+------+------+------|
* | LOWER| 1 | 2 | 3 |
* `---------------------------'
*/
[_BASE] = LAYOUT(
KC_ESC,
KC_COLN, KC_P7, KC_P8, KC_P9,
RAISE, KC_P4, KC_P5, KC_P6,
LOWER, KC_P1, KC_P2, KC_P3
),
/* Lower
* ,------.
* | Nmlk |
* |------+------+-------------.
* | : | / | * | - |
* |------+------+------+------|
* | | | = | + |
* |------+------+------+------|
* | | 0 | . | ENT |
* `---------------------------'
*/
[_LOWER] = LAYOUT(
KC_NLCK,
KC_COLN, KC_PSLS, KC_PAST, KC_PMNS,
_______, XXXXXXX, KC_EQL, KC_PPLS,
_______, KC_P0, KC_PDOT, KC_PENT
),
/* Raise
* ,------.
* | Esc |
* |------+------+-------------.
* |RGB TG|RGB M+|RGB M-| |
* |------+------+------+------|
* | |RGB H+|RGB S+|RGB V+|
* |------+------+------+------|
* | ` |RGB H-|RGB S-|RGB V-|
* `---------------------------'
*/
[_RAISE] = LAYOUT(
KC_NLCK,
RGB_TOG, RGB_MOD, RGB_RMOD, XXXXXXX,
_______, RGB_HUI, RGB_SAI, RGB_VAI,
_______, RGB_HUD, RGB_SAD, RGB_VAD
),
/* Adjust
* ,------.
* | DFU |
* |------+------+-------------.
* |HPT TG|HPT FB|HPT RS| BKSP |
* |------+------+------+------|
* | |HPT M+| | |
* |------+------+------+------|
* | |HPT M-|Clk TG| Del |
* `---------------------------'
*/
[_ADJUST] = LAYOUT(
RESET,
HPT_TOG, HPT_FBK, HPT_RST, KC_BSPC,
_______, HPT_MODI, XXXXXXX, XXXXXXX,
_______, HPT_MODD, CK_TOGG, KC_DEL
),
};
uint32_t layer_state_set_user(uint32_t state) {
return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST);
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case KC_DEMOMACRO:
if (record->event.pressed) {
// when keycode KC_DEMOMACRO is pressed
SEND_STRING("QMK is the best thing ever!");
} else {
// when keycode KC_DEMOMACRO is released
}
break;
case LOWER:
if (record->event.pressed) {
//not sure how to have keyboard check mode and set it to a variable, so my work around
//uses another variable that would be set to true after the first time a reactive key is pressed.
layer_on(_LOWER);
} else {
layer_off(_LOWER);
}
return false;
break;
case RAISE:
if (record->event.pressed) {
//not sure how to have keyboard check mode and set it to a variable, so my work around
//uses another variable that would be set to true after the first time a reactive key is pressed.
layer_on(_RAISE);
} else {
layer_off(_RAISE);
}
return false;
break;
}
return true;
}
bool music_mask_user(uint16_t keycode) {
switch (keycode) {
case RAISE:
case LOWER:
return false;
default:
return true;
}
}
void matrix_init_user(void) {
}
void matrix_scan_user(void) {
}

View File

@ -0,0 +1,51 @@
# The Default Boston Meetup 2019 board Layout
Keymap:
```
Base
,------.
| Esc |
|------+------+-------------.
| : | 7 | 8 | 9 |
|------+------+------+------|
| RAISE| 4 | 5 | 6 |
|------+------+------+------|
| LOWER| 1 | 2 | 3 |
`---------------------------'
Lower
,------.
| Nmlk |
|------+------+-------------.
| : | / | * | - |
|------+------+------+------|
| | | = | + |
|------+------+------+------|
| | 0 | . | ENT |
`---------------------------'
Raise
,------.
| Esc |
|------+------+-------------.
|RGB TG|RGB M+|RGB M-| |
|------+------+------+------|
| |RGB H+|RGB S+|RGB V+|
|------+------+------+------|
| |RGB H-|RGB S-|RGB V-|
`---------------------------'
Adjust:
,------.
| DFU |
|------+------+-------------.
|HPT TG|HPT FB|HPT RS| BKSP |
|------+------+------+------|
| |HPT M+| | |
|------+------+------+------|
| |HPT M-|Clk TG| Del |
`---------------------------'
```
RGB still work in progress

View File

@ -0,0 +1,22 @@
# How to add your own keymap
Folders can be named however you'd like (will be approved upon merging), or should follow the format with a preceding `_`:
_[ISO 3166-1 alpha-2 code*]_[layout variant]_[layout name/author]
\* See full list: https://en.wikipedia.org/wiki/ISO_3166-1#Officially_assigned_code_elements
and contain the following files:
* `keymap.c`
* `readme.md` *recommended*
* `config.h` *optional*, found automatically when compiling
* `Makefile` *optional*, found automatically when compling
When adding your keymap to this list, keep it organised alphabetically (select list, edit->sort lines), and use this format:
* **folder_name** description
# List of 2019 keymaps
* **default** default 2019 macropad layout

View File

@ -0,0 +1,13 @@
# Boston Meetup 2019 Macropad
![Boston Meetup 2019](https://i.imgur.com/6LgBc4g.jpg)
Limited-run board designed for Boston MK community meetup 2019.
Keyboard Maintainer: [ishtob](https://github.com/ishtob), [QMK](https://github.com/qmk)
Make example for this keyboard (after setting up your build environment):
make boston_meetup/2019:default
See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).

View File

@ -0,0 +1,24 @@
# project specific files
# Cortex version
MCU = STM32F303
# Build Options
# comment out to disable the options.
#
BACKLIGHT_ENABLE = no
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration
## (Note that for BOOTMAGIC on Teensy LC you have to use a custom .ld script.)
MOUSEKEY_ENABLE = yes # Mouse keys
EXTRAKEY_ENABLE = yes # Audio control and System control
CONSOLE_ENABLE = no # Console for debug
COMMAND_ENABLE = no # Commands for debug and configuration
#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
NKRO_ENABLE = yes # USB Nkey Rollover
CUSTOM_MATRIX = no # Custom matrix file
AUDIO_ENABLE = yes
RGBLIGHT_ENABLE = no
RGB_MATRIX_ENABLE = no #WS2812
HAPTIC_ENABLE += DRV2605L
QWIIC_ENABLE += MICRO_OLED
# SERIAL_LINK_ENABLE = yes

View File

@ -0,0 +1,2 @@
#include "boston_meetup.h"

View File

@ -0,0 +1,19 @@
#pragma once
#ifdef KEYBOARD_boston_meetup_2019
#include "2019.h"
#define LAYOUT( \
K00, \
K10, K11, K12, K13, \
K20, K21, K22, K23, \
K30, K31, K32, K33 \
) \
{ \
{ K00, KC_NO, KC_NO, KC_NO }, \
{ K10, K11, K12, K13 }, \
{ K20, K21, K22, K23 }, \
{ K30, K31, K32, K33 } \
}
#endif
#include "quantum.h"

View File

@ -0,0 +1,60 @@
/*
Copyright 2012 Jun Wako <wakojun@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "config_common.h"
/* USB Device descriptor parameter */
#define VENDOR_ID 0xFB30
#define PRODUCT_ID 0x26BE
#define MANUFACTURER ishtob
#define PRODUCT Boston Meetup Board
#define DESCRIPTION A limited-run community meetup board
//#define AUDIO_VOICES
//#define BACKLIGHT_PIN B7
/* COL2ROW or ROW2COL */
#define DIODE_DIRECTION COL2ROW
/* define if matrix has ghost */
//#define MATRIX_HAS_GHOST
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
//#define LOCKING_SUPPORT_ENABLE
/* Locking resynchronize hack */
//#define LOCKING_RESYNC_ENABLE
/*
* Feature disable options
* These options are also useful to firmware size reduction.
*/
/* disable debug print */
//#define NO_DEBUG
/* disable print */
//#define NO_PRINT
/* disable action features */
//#define NO_ACTION_LAYER
//#define NO_ACTION_TAPPING
//#define NO_ACTION_ONESHOT
//#define NO_ACTION_MACRO
//#define NO_ACTION_FUNCTION

View File

@ -0,0 +1,14 @@
# Boston Meetup Macropads
![Boston Meetup Macropads](https://i.imgur.com/yQcBF8g.jpg)
Limited-run boards designed for Boston MK community meetups.
Keyboard Maintainer: [ishtob](https://github.com/ishtob), [QMK](https://github.com/qmk)
Hardware Supported: Boston Meetup PCB 2018, 2019
Make example for this keyboard (after setting up your build environment):
make boston_meetup/YYYY:default
See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).

View File

@ -0,0 +1,2 @@
DEFAULT_FOLDER = boston_meetup/2019

View File

@ -0,0 +1,56 @@
/* Copyright 2019 Jeremy Bernhardt
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "butterstick.h"
// Optional override functions below.
// You can leave any or all of these undefined.
// These are only required if you want to perform custom actions.
/*
void matrix_init_kb(void) {
// put your keyboard start-up code here
// runs once when the firmware starts up
matrix_init_user();
}
*/
void matrix_scan_kb(void) {
#ifdef DEBUG_MATRIX
for (uint8_t c = 0; c < MATRIX_COLS; c++)
for (uint8_t r = 0; r < MATRIX_ROWS; r++)
if (matrix_is_on(r, c)) xprintf("r:%d c:%d \n", r, c);
#endif
matrix_scan_user();
}
/*
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
// put your per-action keyboard code here
// runs for every action, just before processing by the firmware
return process_record_user(keycode, record);
}
void led_set_kb(uint8_t usb_led) {
// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
led_set_user(usb_led);
}
*/

View File

@ -0,0 +1,11 @@
#pragma once
#include "quantum.h"
#define LAYOUT_butter( \
k09, k08, k07, k06, k05, k04, k03, k02, k01, k00, \
k19, k18, k17, k16, k15, k14, k13, k12, k11, k10 \
) { \
{ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09}, \
{ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19}, \
}

View File

@ -0,0 +1,26 @@
#pragma once
#include "config_common.h"
/* USB Device descriptor parameter */
#define VENDOR_ID 0xFEED
#define PRODUCT_ID 0x1337
#define DEVICE_VER 0x0001
#define MANUFACTURER g Heavy Industries
#define PRODUCT Butter Stick
#define DESCRIPTION Its a stick of butter
#define VERSION "Paula Deen"
#define DEBOUNCING_DELAY 5
#define FORCE_NKRO
/* key matrix size */
#define MATRIX_ROWS 2
#define MATRIX_COLS 10
#define MATRIX_ROW_PINS { F4, F5 }
#define MATRIX_COL_PINS { B0, B1, B2, B3, B4, B5, B6, B7, C6, C7}
#define UNUSED_PINS
/* COL2ROW, ROW2COL*/
#define DIODE_DIRECTION ROW2COL

View File

@ -0,0 +1,183 @@
#include QMK_KEYBOARD_H
#include "sten.h"
/*
* Key names are inherited from steno machines
* .-----------------------------------------------------.
* | LSU | LFT | LP | LH | ST1 | RF | RP | RL | RT | RD |
* |-----------------------------------------------------|
* | LSD | LK | LW | LR | ST2 | RR | RB | RG | RS | RZ |
* '-----------------------------------------------------'
*/
// Function prefixes
#define MEDIA (LSD | LK | LW | LR)
#define FUNCT (LSD | LK | LP | LH)
#define MOVE (LSU | LFT | LP | LH)
#define SYMB (RD | RZ)
#define NUMA (LW | LR)
#define NUMB (RR | RB)
// QMK Layer Numbers
#define BASE 0
#define GAME 1
// Do not change QMK Layer 0! This is your main keyboard.
// Make your QMK modifications to the later layers, to add
// keys/customize on the first layer modify processQwerty():
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[BASE] = LAYOUT_butter(
STN_S1, STN_TL, STN_PL, STN_HL, STN_ST1, STN_FR, STN_PR, STN_LR, STN_TR, STN_DR,
STN_S2, STN_KL, STN_WL, STN_RL, STN_ST2, STN_RR, STN_BR, STN_GR, STN_SR, STN_ZR
),
// I don't game don't roast me thanks
[GAME] = LAYOUT_butter(
KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_ENT,
KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, TO(BASE)
)
};
// Note: You can only use basic keycodes here!
// P() is just a wrapper to make your life easier, any C code can be executed.
// Only the longest matched chord is run!
//
// http://docs.gboards.ca
uint32_t processQwerty(bool lookup) {
// SECRET AGENT CHORDS
P( LSU | LK | RS | RD, SEND_STRING(VERSION); SEND_STRING(__DATE__));
P( LSD | RZ, SEND(KC_SPC));
// Dual chords
P( LP | LH, CLICK_MOUSE(KC_MS_BTN2));
P( ST1 | RF, CLICK_MOUSE(KC_MS_BTN1));
P( LSU | LFT, SEND(KC_ESC));
P( LSD | LK, SEND(KC_LSFT));
P( RZ | RS, SEND(KC_LSFT));
P( ST2 | RR, SEND(KC_SPC));
P( RP | RL, SEND(KC_LGUI));
P( RT | RD, SEND(KC_LCTL));
P( RL | RT, SEND(KC_LALT));
P( LSU | LSD | LFT | LK, SEND(KC_LCTL));
P( RS | RT | RD | RZ, SEND(KC_ENT));
// Function Layer
P( FUNCT | RF, SEND(KC_F1));
P( FUNCT | RP, SEND(KC_F2));
P( FUNCT | RL, SEND(KC_F3));
P( FUNCT | RT, SEND(KC_F4));
P( FUNCT | RF | RR, SEND(KC_F5));
P( FUNCT | RP | RB, SEND(KC_F6));
P( FUNCT | RL | RG, SEND(KC_F7));
P( FUNCT | RT | RS, SEND(KC_F8));
P( FUNCT | RR, SEND(KC_F9));
P( FUNCT | RB, SEND(KC_F10));
P( FUNCT | RG, SEND(KC_F11));
P( FUNCT | RS, SEND(KC_F12));
// Movement Layer
P( MOVE | RF, SEND(KC_LEFT));
P( MOVE | RP, SEND(KC_DOWN));
P( MOVE | RL, SEND(KC_UP));
P( MOVE | RT, SEND(KC_RIGHT));
P( MOVE | ST1, SEND(KC_PGUP));
P( MOVE | ST2, SEND(KC_PGDN));
// Media Layer
P( MEDIA | RF, SEND(KC_MPRV));
P( MEDIA | RP, SEND(KC_MPLY));
P( MEDIA | RL, SEND(KC_MPLY));
P( MEDIA | RT, SEND(KC_MNXT));
P( MEDIA | RG, SEND(KC_VOLU));
P( MEDIA | RB, SEND(KC_VOLD));
P( MEDIA | RS, SEND(KC_MUTE));
// Number Row, Right
P( NUMB | LSU, SEND(KC_1));
P( NUMB | LFT, SEND(KC_2));
P( NUMB | LP, SEND(KC_3));
P( NUMB | LH, SEND(KC_4));
P( NUMB | ST1, SEND(KC_5));
P( NUMB | RF, SEND(KC_6));
P( NUMB | RP, SEND(KC_7));
P( NUMB | RL, SEND(KC_8));
P( NUMB | RT, SEND(KC_9));
P( NUMB | RD, SEND(KC_0));
// Number Row, Left
P( NUMA | LSU, SEND(KC_1));
P( NUMA | LFT, SEND(KC_2));
P( NUMA | LP, SEND(KC_3));
P( NUMA | LH, SEND(KC_4));
P( NUMA | ST1, SEND(KC_5));
P( NUMA | RF, SEND(KC_6));
P( NUMA | RP, SEND(KC_7));
P( NUMA | RL, SEND(KC_8));
P( NUMA | RT, SEND(KC_9));
P( NUMA | RD, SEND(KC_0));
// Symbols and Numbers
P( SYMB | LP | LW, SEND(KC_LSFT); SEND(KC_9)); // (
P( SYMB | LH | LR, SEND(KC_LSFT); SEND(KC_0)); // )
P( SYMB | ST1 | ST2, SEND(KC_GRV)); // `
P( SYMB | RR | RF, SEND(KC_LSFT); SEND(KC_3)); // #
P( SYMB | LFT | LK, SEND(KC_LSFT); SEND(KC_4)); // $
P( SYMB | LSU, SEND(KC_LSFT); SEND(KC_1)); // !
P( SYMB | LSD, SEND(KC_LSFT); SEND(KC_5)); // %
P( SYMB | LFT, SEND(KC_LSFT); SEND(KC_2)); // @
P( SYMB | LK, SEND(KC_LSFT); SEND(KC_6)); // ^
P( SYMB | LP, SEND(KC_LSFT); SEND(KC_LBRC)); // {
P( SYMB | LW, SEND(KC_LBRC));
P( SYMB | LH, SEND(KC_LSFT); SEND(KC_RBRC)); // }
P( SYMB | LR, SEND(KC_RBRC));
P( SYMB | ST1, SEND(KC_LSFT); SEND(KC_BSLS)); // |
P( SYMB | ST2, SEND(KC_LSFT); SEND(KC_GRV)); // ~
P( SYMB | RP | RB, SEND(KC_QUOT));
P( SYMB | RP | RG, SEND(KC_LSFT); SEND(KC_QUOT)); // "
P( SYMB | RF, SEND(KC_KP_PLUS));
P( SYMB | RR, SEND(KC_LSFT); SEND(KC_7)); // &
P( SYMB | RP, SEND(KC_MINS));
P( SYMB | RB, SEND(KC_EQL));
P( SYMB | RL, SEND(KC_SLSH));
P( SYMB | RG, SEND(KC_COMM));
P( SYMB | RT, SEND(KC_PAST));
P( SYMB | RS, SEND(KC_DOT));
// Letters
P( LSU | LSD, SEND(KC_A));
P( LFT | LK, SEND(KC_S));
P( LP | LW, SEND(KC_D));
P( LH | LR, SEND(KC_F));
P( ST1 | ST2, SEND(KC_G));
P( RF | RR, SEND(KC_H));
P( RT | RS, SEND(KC_L));
P( RD | RZ, SEND(KC_SCLN));
P( RG | RL, SEND(KC_K));
P( RP | RB, SEND(KC_J));
P( LSU, SEND(KC_Q));
P( LSD, SEND(KC_Z));
P( LFT, SEND(KC_W));
P( LK, SEND(KC_X));
P( LP, SEND(KC_E));
P( LW, SEND(KC_C));
P( LH, SEND(KC_R));
P( LR, SEND(KC_V));
P( ST1, SEND(KC_T));
P( ST2, SEND(KC_B));
P( RF, SEND(KC_Y));
P( RR, SEND(KC_N));
P( RP, SEND(KC_U));
P( RB, SEND(KC_M));
P( RL, SEND(KC_I));
P( RG, SEND(KC_COMM));
P( RT, SEND(KC_O));
P( RS, SEND(KC_DOT));
P( RD, SEND(KC_P));
P( RZ, SEND(KC_SLSH));
return 0;
}
// Don't fuck with this, thanks.
size_t keymapsCount = sizeof(keymaps)/sizeof(keymaps[0]);

View File

@ -0,0 +1,14 @@
# Butter Stick
![Butter Stick](https://i.redd.it/mvteaomko7s21.jpg)
A chorded 20% keyboard packing full sized useage into your pocket. More info on [gboards.ca](http://docs.gboards.ca/Meet-Butter-Stick)!
Keyboard Maintainer: [Germ](https://github.com/germ)
Hardware Availability: [g Heavy Industries](https://www.gboards.ca/product/butter-stick-limited-edition)
Make example for this keyboard (after setting up your build environment):
make butterstick:default
See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).

View File

@ -0,0 +1,19 @@
# MCU name
MCU = atmega32u4
F_CPU = 16000000
ARCH = AVR8
F_USB = $(F_CPU)
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT -DONLYQWERTY -DDEBUG_MATRIX
SRC += sten.c
EXTRAFLAGS += -flto
BOOTLOADER = atmel-dfu
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
CONSOLE_ENABLE = yes # Console for debug(+400)
COMMAND_ENABLE = no # Commands for debug and configuration
NKRO_ENABLE = yes # USB Nkey Rollover
STENO_ENABLE = yes # Needed for chording

View File

@ -0,0 +1,367 @@
#include "sten.h"
// Chord state
uint32_t cChord = 0; // Current Chord
int chordIndex = 0; // Keys in previousachord
int32_t chordState[32]; // Full Chord history
#define QWERBUF 24 // Size of chords to buffer for output
bool repeatFlag = false; // Should we repeat?
uint32_t pChord = 0; // Previous Chord
int pChordIndex = 0; // Keys in previousachord
uint32_t pChordState[32]; // Previous chord sate
uint32_t stickyBits = 0; // Or'd with every incoming press
// Mode state
enum MODE { STENO = 0, QWERTY, COMMAND };
enum MODE pMode;
bool QWERSTENO = false;
#ifdef ONLYQWERTY
enum MODE cMode = QWERTY;
#else
enum MODE cMode = STENO;
#endif
// Command State
#define MAX_CMD_BUF 20
uint8_t CMDLEN = 0;
uint8_t CMDBUF[MAX_CMD_BUF];
// Key Repeat state
bool inChord = false;
bool repEngaged = false;
uint16_t repTimer = 0;
#define REP_INIT_DELAY 750
#define REP_DELAY 25
// Mousekeys state
bool inMouse = false;
int8_t mousePress;
// All processing done at chordUp goes through here
// Note, this is a gutted version of the Georgi sten.h
bool send_steno_chord_user(steno_mode_t mode, uint8_t chord[6]) {
// Check for mousekeys, this is release
#ifdef MOUSEKEY_ENABLE
if (inMouse) {
inMouse = false;
mousekey_off(mousePress);
mousekey_send();
}
#endif
// handle command mode
if (cChord == (LSU | LSD | RD | RZ)) {
if (cMode != COMMAND) { // Entering Command Mode
CMDLEN = 0;
pMode = cMode;
cMode = COMMAND;
} else { // Exiting Command Mode
cMode = pMode;
// Press all and release all
for (int i = 0; i < CMDLEN; i++) {
register_code(CMDBUF[i]);
}
clear_keyboard();
}
goto out;
}
// Handle Gaming Toggle,
if (cChord == (LSU | LSD | LFT | LK | RT | RS | RD | RZ) && keymapsCount > 1) {
#ifndef NO_DEBUG
uprintf("Switching to QMK\n");
#endif
layer_on(1);
goto out;
}
// Do QWERTY and Momentary QWERTY
if (cMode == QWERTY || (cMode == COMMAND)) {
processChord(false);
goto out;
}
out:
cChord = 0;
inChord = false;
chordIndex = 0;
clear_keyboard();
repEngaged = false;
for (int i = 0; i < 32; i++)
chordState[i] = 0xFFFF;
return false;
}
// Update Chord State
bool process_steno_user(uint16_t keycode, keyrecord_t *record) {
// Everything happens in here when steno keys come in.
// Bail on keyup
if (!record->event.pressed) return true;
// Update key repeat timers
repTimer = timer_read();
inChord = true;
// Switch on the press adding to chord
bool pr = record->event.pressed;
switch (keycode) {
// Mods and stuff
case STN_ST1: pr ? (cChord |= (ST1)): (cChord &= ~(ST1)); break;
case STN_ST2: pr ? (cChord |= (ST2)): (cChord &= ~(ST2)); break;
case STN_ST3: pr ? (cChord |= (ST3)): (cChord &= ~(ST3)); break;
case STN_ST4: pr ? (cChord |= (ST4)): (cChord &= ~(ST4)); break;
case STN_FN: pr ? (cChord |= (FN)) : (cChord &= ~(FN)); break;
case STN_PWR: pr ? (cChord |= (PWR)): (cChord &= ~(PWR)); break;
case STN_N1...STN_N6: pr ? (cChord |= (LNO)): (cChord &= ~(LNO)); break;
case STN_N7...STN_NC: pr ? (cChord |= (RNO)): (cChord &= ~(RNO)); break;
// All the letter keys
case STN_S1: pr ? (cChord |= (LSU)) : (cChord &= ~(LSU)); break;
case STN_S2: pr ? (cChord |= (LSD)) : (cChord &= ~(LSD)); break;
case STN_TL: pr ? (cChord |= (LFT)) : (cChord &= ~(LFT)); break;
case STN_KL: pr ? (cChord |= (LK)) : (cChord &= ~(LK)); break;
case STN_PL: pr ? (cChord |= (LP)) : (cChord &= ~(LP)); break;
case STN_WL: pr ? (cChord |= (LW)) : (cChord &= ~(LW)); break;
case STN_HL: pr ? (cChord |= (LH)) : (cChord &= ~(LH)); break;
case STN_RL: pr ? (cChord |= (LR)) : (cChord &= ~(LR)); break;
case STN_A: pr ? (cChord |= (LA)) : (cChord &= ~(LA)); break;
case STN_O: pr ? (cChord |= (LO)) : (cChord &= ~(LO)); break;
case STN_E: pr ? (cChord |= (RE)) : (cChord &= ~(RE)); break;
case STN_U: pr ? (cChord |= (RU)) : (cChord &= ~(RU)); break;
case STN_FR: pr ? (cChord |= (RF)) : (cChord &= ~(RF)); break;
case STN_RR: pr ? (cChord |= (RR)) : (cChord &= ~(RR)); break;
case STN_PR: pr ? (cChord |= (RP)) : (cChord &= ~(RP)); break;
case STN_BR: pr ? (cChord |= (RB)) : (cChord &= ~(RB)); break;
case STN_LR: pr ? (cChord |= (RL)) : (cChord &= ~(RL)); break;
case STN_GR: pr ? (cChord |= (RG)) : (cChord &= ~(RG)); break;
case STN_TR: pr ? (cChord |= (RT)) : (cChord &= ~(RT)); break;
case STN_SR: pr ? (cChord |= (RS)) : (cChord &= ~(RS)); break;
case STN_DR: pr ? (cChord |= (RD)) : (cChord &= ~(RD)); break;
case STN_ZR: pr ? (cChord |= (RZ)) : (cChord &= ~(RZ)); break;
}
// Store previous state for fastQWER
if (pr) {
chordState[chordIndex] = cChord;
chordIndex++;
}
return true;
}
void matrix_scan_user(void) {
// We abuse this for early sending of key
// Key repeat only on QWER/SYMB layers
if (cMode != QWERTY || !inChord) return;
// Check timers
#ifndef NO_REPEAT
if (repEngaged && timer_elapsed(repTimer) > REP_DELAY) {
// Process Key for report
processChord(false);
// Send report to host
send_keyboard_report();
clear_keyboard();
repTimer = timer_read();
}
if (!repEngaged && timer_elapsed(repTimer) > REP_INIT_DELAY) {
repEngaged = true;
}
#endif
};
// For Plover NKRO
uint32_t processFakeSteno(bool lookup) {
P( LSU, SEND(KC_Q););
P( LSD, SEND(KC_A););
P( LFT, SEND(KC_W););
P( LP, SEND(KC_E););
P( LH, SEND(KC_R););
P( LK, SEND(KC_S););
P( LW, SEND(KC_D););
P( LR, SEND(KC_F););
P( ST1, SEND(KC_T););
P( ST2, SEND(KC_G););
P( LA, SEND(KC_C););
P( LO, SEND(KC_V););
P( RE, SEND(KC_N););
P( RU, SEND(KC_M););
P( ST3, SEND(KC_Y););
P( ST4, SEND(KC_H););
P( RF, SEND(KC_U););
P( RP, SEND(KC_I););
P( RL, SEND(KC_O););
P( RT, SEND(KC_P););
P( RD, SEND(KC_LBRC););
P( RR, SEND(KC_J););
P( RB, SEND(KC_K););
P( RG, SEND(KC_L););
P( RS, SEND(KC_SCLN););
P( RZ, SEND(KC_COMM););
P( LNO, SEND(KC_1););
P( RNO, SEND(KC_1););
return 0;
}
// Traverse the chord history to a given point
// Returns the mask to use
void processChord(bool useFakeSteno) {
// Save the clean chord state
uint32_t savedChord = cChord;
// Apply Stick Bits if needed
if (stickyBits != 0) {
cChord |= stickyBits;
for (int i = 0; i <= chordIndex; i++)
chordState[i] |= stickyBits;
}
// Strip FN
if (cChord & FN) cChord ^= FN;
// First we test if a whole chord was passsed
// If so we just run it handling repeat logic
if (useFakeSteno && processFakeSteno(true) == cChord) {
processFakeSteno(false);
return;
} else if (processQwerty(true) == cChord) {
processQwerty(false);
// Repeat logic
if (repeatFlag) {
restoreState();
repeatFlag = false;
processChord(false);
} else {
saveState(cChord);
}
return;
}
// Iterate through chord picking out the individual
// and longest chords
uint32_t bufChords[QWERBUF];
int bufLen = 0;
uint32_t mask = 0;
// We iterate over it multiple times to catch the longest
// chord. Then that gets addded to the mask and re run.
while (savedChord != mask) {
uint32_t test = 0;
uint32_t longestChord = 0;
for (int i = 0; i <= chordIndex; i++) {
cChord = chordState[i] & ~mask;
if (cChord == 0)
continue;
// Assume mid parse Sym is new chord
if (i != 0 && test != 0 && (cChord ^ test) == PWR) {
longestChord = test;
break;
}
// Lock SYM layer in once detected
if (mask & PWR)
cChord |= PWR;
// Testing for keycodes
if (useFakeSteno) {
test = processFakeSteno(true);
} else {
test = processQwerty(true);
}
if (test != 0) {
longestChord = test;
}
}
mask |= longestChord;
bufChords[bufLen] = longestChord;
bufLen++;
// That's a loop of sorts, halt processing
if (bufLen >= QWERBUF) {
return;
}
}
// Now that the buffer is populated, we run it
for (int i = 0; i < bufLen ; i++) {
cChord = bufChords[i];
if (useFakeSteno) {
processFakeSteno(false);
} else {
processQwerty(false);
}
}
// Save state in case of repeat
if (!repeatFlag) {
saveState(savedChord);
}
// Restore cChord for held repeat
cChord = savedChord;
return;
}
void saveState(uint32_t cleanChord) {
pChord = cleanChord;
pChordIndex = chordIndex;
for (int i = 0; i < 32; i++)
pChordState[i] = chordState[i];
}
void restoreState() {
cChord = pChord;
chordIndex = pChordIndex;
for (int i = 0; i < 32; i++)
chordState[i] = pChordState[i];
}
// Macros for calling from keymap.c
void SEND(uint8_t kc) {
// Send Keycode, Does not work for Quantum Codes
if (cMode == COMMAND && CMDLEN < MAX_CMD_BUF) {
#ifndef NO_DEBUG
uprintf("CMD LEN: %d BUF: %d\n", CMDLEN, MAX_CMD_BUF);
#endif
CMDBUF[CMDLEN] = kc;
CMDLEN++;
}
if (cMode != COMMAND) register_code(kc);
return;
}
void REPEAT(void) {
if (cMode != QWERTY)
return;
repeatFlag = true;
return;
}
void SET_STICKY(uint32_t stick) {
stickyBits = stick;
return;
}
void SWITCH_LAYER(int layer) {
if (keymapsCount >= layer)
layer_on(layer);
}
void CLICK_MOUSE(uint8_t kc) {
#ifdef MOUSEKEY_ENABLE
mousekey_on(kc);
mousekey_send();
// Store state for later use
inMouse = true;
mousePress = kc;
#endif
}

View File

@ -0,0 +1,77 @@
// 2019, g Heavy Industries
// Blessed mother of Christ, please keep this readable
// and protect us from segfaults. For thine is the clock,
// the slave and the master. Until we return from main.
//
// Amen.
#include QMK_KEYBOARD_H
#include "mousekey.h"
#include "keymap.h"
#include "keymap_steno.h"
#include "wait.h"
extern size_t keymapsCount; // Total keymaps
extern uint32_t cChord; // Current Chord
// Function defs
void processChord(bool useFakeSteno);
uint32_t processQwerty(bool lookup);
uint32_t processFakeSteno(bool lookup);
void saveState(uint32_t cChord);
void restoreState(void);
// Macros for use in keymap.c
void SEND(uint8_t kc);
void REPEAT(void);
void SET_STICKY(uint32_t);
void SWITCH_LAYER(int);
void CLICK_MOUSE(uint8_t);
// Keymap helper
#define P(chord, act) if (cChord == (chord)) { if (!lookup) {act;} return chord;}
// Shift to internal representation
// i.e) S(teno)R(ight)F
#define STN(n) (1L<<n)
enum ORDER {
SFN = 0, SPWR, SST1, SST2, SST3, SST4, SNUML, SNUMR,
SLSU, SLSD, SLT, SLK, SLP, SLW, SLH, SLR, SLA, SLO,
SRE, SRU, SRF, SRR, SRP, SRB, SRL, SRG, SRT, SRS, SRD, SRZ, SRES1, SRES2
};
// Break it all out
#define FN STN(SFN)
#define PWR STN(SPWR)
#define ST1 STN(SST1)
#define ST2 STN(SST2)
#define ST3 STN(SST3)
#define ST4 STN(SST4)
#define LNO STN(SNUML) // STN1-6
#define RNO STN(SNUMR) // STN7-C
#define RES1 STN(SRES1) // Use reserved for sticky state
#define RES2 STN(SRES2)
#define LSU STN(SLSU)
#define LSD STN(SLSD)
#define LFT STN(SLT) // (L)e(F)t (T), preprocessor conflict
#define LK STN(SLK)
#define LP STN(SLP)
#define LW STN(SLW)
#define LH STN(SLH)
#define LR STN(SLR)
#define LA STN(SLA)
#define LO STN(SLO)
#define RE STN(SRE)
#define RU STN(SRU)
#define RF STN(SRF)
#define RR STN(SRR)
#define RP STN(SRP)
#define RB STN(SRB)
#define RL STN(SRL)
#define RG STN(SRG)
#define RT STN(SRT)
#define RS STN(SRS)
#define RD STN(SRD)
#define RZ STN(SRZ)

View File

@ -31,6 +31,7 @@ OPT_DEFS =
# Options to pass to dfu-util when flashing # Options to pass to dfu-util when flashing
DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave
DFU_SUFFIX_ARGS = -p DF11 -v 0483
# Build Options # Build Options
# comment out to disable the options. # comment out to disable the options.

View File

@ -0,0 +1,56 @@
/*
ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#include "hal.h"
// Value to place in RTC backup register 10 for persistent bootloader mode
#define RTC_BOOTLOADER_FLAG 0x424C
/**
* @brief PAL setup.
* @details Digital I/O ports static configuration as defined in @p board.h.
* This variable is used by the HAL when initializing the PAL driver.
*/
#if HAL_USE_PAL || defined(__DOXYGEN__)
const PALConfig pal_default_config =
{
{VAL_GPIOAODR, VAL_GPIOACRL, VAL_GPIOACRH},
{VAL_GPIOBODR, VAL_GPIOBCRL, VAL_GPIOBCRH},
{VAL_GPIOCODR, VAL_GPIOCCRL, VAL_GPIOCCRH},
{VAL_GPIODODR, VAL_GPIODCRL, VAL_GPIODCRH},
{VAL_GPIOEODR, VAL_GPIOECRL, VAL_GPIOECRH},
};
#endif
/*
* Early initialization code.
* This initialization must be performed just after stack setup and before
* any other initialization.
*/
void __early_init(void) {
stm32_clock_init();
}
/*
* Board-specific initialization code.
*/
void boardInit(void) {
//JTAG-DP Disabled and SW-DP Enabled
AFIO->MAPR |= AFIO_MAPR_SWJ_CFG_JTAGDISABLE;
//Set backup register DR10 to enter bootloader on reset
BKP->DR10 = RTC_BOOTLOADER_FLAG;
}

View File

@ -0,0 +1,166 @@
/*
ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef _BOARD_H_
#define _BOARD_H_
/*
* Setup for a Generic STM32F103 board.
*/
/*
* Board identifier.
*/
#define BOARD_GENERIC_STM32_F103
#define BOARD_NAME "Generic STM32F103x board"
/*
* Board frequencies.
*/
#define STM32_LSECLK 32768
#define STM32_HSECLK 8000000
/*
* MCU type, supported types are defined in ./os/hal/platforms/hal_lld.h.
*/
#define STM32F103xB
/*
* IO pins assignments
*/
/* on-board */
#define GPIOA_LED 8
#define GPIOD_OSC_IN 0
#define GPIOD_OSC_OUT 1
/* In case your board has a "USB enable" hardware
controlled by a pin, define it here. (It could be just
a 1.5k resistor connected to D+ line.)
*/
/*
#define GPIOB_USB_DISC 10
*/
/*
* I/O ports initial setup, this configuration is established soon after reset
* in the initialization code.
*
* The digits have the following meaning:
* 0 - Analog input.
* 1 - Push Pull output 10MHz.
* 2 - Push Pull output 2MHz.
* 3 - Push Pull output 50MHz.
* 4 - Digital input.
* 5 - Open Drain output 10MHz.
* 6 - Open Drain output 2MHz.
* 7 - Open Drain output 50MHz.
* 8 - Digital input with PullUp or PullDown resistor depending on ODR.
* 9 - Alternate Push Pull output 10MHz.
* A - Alternate Push Pull output 2MHz.
* B - Alternate Push Pull output 50MHz.
* C - Reserved.
* D - Alternate Open Drain output 10MHz.
* E - Alternate Open Drain output 2MHz.
* F - Alternate Open Drain output 50MHz.
* Please refer to the STM32 Reference Manual for details.
*/
/*
* Port A setup.
* Everything input with pull-up except:
* PA2 - Alternate output (USART2 TX).
* PA3 - Normal input (USART2 RX).
* PA9 - Alternate output (USART1 TX).
* PA10 - Normal input (USART1 RX).
*/
#define VAL_GPIOACRL 0x88884B88 /* PA7...PA0 */
#define VAL_GPIOACRH 0x888884B8 /* PA15...PA8 */
#define VAL_GPIOAODR 0xFFFFFFFF
/*
* Port B setup.
* Everything input with pull-up except:
* PB10 - Push Pull output (USB switch).
*/
#define VAL_GPIOBCRL 0x88888888 /* PB7...PB0 */
#define VAL_GPIOBCRH 0x88888388 /* PB15...PB8 */
#define VAL_GPIOBODR 0xFFFFFFFF
/*
* Port C setup.
* Everything input with pull-up except:
* PC13 - Push Pull output (LED).
*/
#define VAL_GPIOCCRL 0x88888888 /* PC7...PC0 */
#define VAL_GPIOCCRH 0x88388888 /* PC15...PC8 */
#define VAL_GPIOCODR 0xFFFFFFFF
/*
* Port D setup.
* Everything input with pull-up except:
* PD0 - Normal input (XTAL).
* PD1 - Normal input (XTAL).
*/
#define VAL_GPIODCRL 0x88888844 /* PD7...PD0 */
#define VAL_GPIODCRH 0x88888888 /* PD15...PD8 */
#define VAL_GPIODODR 0xFFFFFFFF
/*
* Port E setup.
* Everything input with pull-up except:
*/
#define VAL_GPIOECRL 0x88888888 /* PE7...PE0 */
#define VAL_GPIOECRH 0x88888888 /* PE15...PE8 */
#define VAL_GPIOEODR 0xFFFFFFFF
/*
* USB bus activation macro, required by the USB driver.
*/
/* The point is that most of the generic STM32F103* boards
have a 1.5k resistor connected on one end to the D+ line
and on the other end to some pin. Or even a slightly more
complicated "USB enable" circuit, controlled by a pin.
That should go here.
However on some boards (e.g. one that I have), there's no
such hardware. In which case it's better to not do anything.
*/
/*
#define usb_lld_connect_bus(usbp) palClearPad(GPIOB, GPIOB_USB_DISC)
*/
#define usb_lld_connect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_INPUT);
/*
* USB bus de-activation macro, required by the USB driver.
*/
/*
#define usb_lld_disconnect_bus(usbp) palSetPad(GPIOB, GPIOB_USB_DISC)
*/
#define usb_lld_disconnect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_OUTPUT_PUSHPULL); palClearPad(GPIOA, 12);
#if !defined(_FROM_ASM_)
#ifdef __cplusplus
extern "C" {
#endif
void boardInit(void);
#ifdef __cplusplus
}
#endif
#endif /* _FROM_ASM_ */
#endif /* _BOARD_H_ */

View File

@ -0,0 +1,5 @@
# List of all the board related files.
BOARDSRC = $(BOARD_PATH)/boards/GENERIC_STM32_F103/board.c
# Required include directories
BOARDINC = $(BOARD_PATH)/boards/GENERIC_STM32_F103

View File

@ -1,7 +1,10 @@
/* Address for jumping to bootloader on STM32 chips. */ /* Address for jumping to bootloader on STM32 chips. */
/* It is chip dependent, the correct number can be looked up here: /* It is chip dependent, the correct number can be looked up here (page 175):
* http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf
* This also requires a patch to chibios: * This also requires a patch to chibios:
* <tmk_dir>/tmk_core/tool/chibios/ch-bootloader-jump.patch * <tmk_dir>/tmk_core/tool/chibios/ch-bootloader-jump.patch
*/ */
#define STM32_BOOTLOADER_ADDRESS 0x1FFFD800
// STM32F103* does NOT have an USB bootloader in ROM (only serial),
// so setting anything here does not make much sense
#define STM32_BOOTLOADER_ADDRESS 0x80000000

View File

@ -1,5 +1,5 @@
/* /*
ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -58,7 +58,7 @@
* The value one is not valid, timeouts are rounded up to * The value one is not valid, timeouts are rounded up to
* this value. * this value.
*/ */
#define CH_CFG_ST_TIMEDELTA 2 #define CH_CFG_ST_TIMEDELTA 0
/** @} */ /** @} */
@ -105,6 +105,10 @@
*/ */
#define CH_CFG_NO_IDLE_THREAD FALSE #define CH_CFG_NO_IDLE_THREAD FALSE
/* Use __WFI in the idle thread for waiting. Does lower the power
* consumption. */
#define CORTEX_ENABLE_WFI_IDLE TRUE
/** @} */ /** @} */
/*===========================================================================*/ /*===========================================================================*/
@ -140,7 +144,7 @@
* *
* @note The default is @p TRUE. * @note The default is @p TRUE.
*/ */
#define CH_CFG_USE_TM TRUE #define CH_CFG_USE_TM FALSE
/** /**
* @brief Threads registry APIs. * @brief Threads registry APIs.
@ -214,7 +218,7 @@
* @note The default is @p TRUE. * @note The default is @p TRUE.
* @note Requires @p CH_CFG_USE_CONDVARS. * @note Requires @p CH_CFG_USE_CONDVARS.
*/ */
#define CH_CFG_USE_CONDVARS_TIMEOUT TRUE #define CH_CFG_USE_CONDVARS_TIMEOUT FALSE
/** /**
* @brief Events Flags APIs. * @brief Events Flags APIs.
@ -252,7 +256,7 @@
* requirements. * requirements.
* @note Requires @p CH_CFG_USE_MESSAGES. * @note Requires @p CH_CFG_USE_MESSAGES.
*/ */
#define CH_CFG_USE_MESSAGES_PRIORITY TRUE #define CH_CFG_USE_MESSAGES_PRIORITY FALSE
/** /**
* @brief Mailboxes APIs. * @brief Mailboxes APIs.
@ -292,7 +296,7 @@
* *
* @note The default is @p TRUE. * @note The default is @p TRUE.
*/ */
#define CH_CFG_USE_MEMPOOLS TRUE #define CH_CFG_USE_MEMPOOLS FALSE
/** /**
* @brief Dynamic Threads APIs. * @brief Dynamic Threads APIs.
@ -303,7 +307,7 @@
* @note Requires @p CH_CFG_USE_WAITEXIT. * @note Requires @p CH_CFG_USE_WAITEXIT.
* @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS. * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS.
*/ */
#define CH_CFG_USE_DYNAMIC TRUE #define CH_CFG_USE_DYNAMIC FALSE
/** @} */ /** @} */
@ -374,7 +378,7 @@
* @note The default failure mode is to halt the system with the global * @note The default failure mode is to halt the system with the global
* @p panic_msg variable set to @p NULL. * @p panic_msg variable set to @p NULL.
*/ */
#define CH_DBG_ENABLE_STACK_CHECK TRUE #define CH_DBG_ENABLE_STACK_CHECK FALSE
/** /**
* @brief Debug option, stacks initialization. * @brief Debug option, stacks initialization.

View File

@ -0,0 +1,78 @@
/*
Copyright 2015 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/>.
*/
#pragma once
/* USB Device descriptor parameter */
#define VENDOR_ID 0xCA04
#define PRODUCT_ID 0x6565
#define DEVICE_VER 0x0001
/* in python2: list(u"whatever".encode('utf-16-le')) */
/* at most 32 characters or the ugly hack in usb_main.c borks */
#define MANUFACTURER CannonKeys
#define PRODUCT Practice 65
#define DESCRIPTION Practice 65
/* key matrix size */
#define MATRIX_ROWS 5
#define MATRIX_COLS 16
#define MATRIX_COL_PINS { B8, B0, A0, B5, B10, B9, A6, B12, A7, A5, A4, A3, A2, A1, B13, B14 }
#define MATRIX_ROW_PINS { B4, B11, B1, B7, B6 }
#define DIODE_DIRECTION COL2ROW
#define BACKLIGHT_LEVELS 6
#define BACKLIGHT_BREATHING
#define BREATHING_PERIOD 6
/* define if matrix has ghost */
//#define MATRIX_HAS_GHOST
/* Set 0 if debouncing isn't needed */
#define DEBOUNCE 5
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
#define LOCKING_SUPPORT_ENABLE
/* Locking resynchronize hack */
#define LOCKING_RESYNC_ENABLE
#define RGBLIGHT_ANIMATIONS
#define WS2812_LED_N 20
#define RGBLED_NUM WS2812_LED_N
#define PORT_WS2812 GPIOB
#define PIN_WS2812 15
#define WS2812_SPI SPID2
/*
* Feature disable options
* These options are also useful to firmware size reduction.
*/
/* disable debug print */
//#define NO_DEBUG
/* disable print */
//#define NO_PRINT
/* disable action features */
//#define NO_ACTION_LAYER
//#define NO_ACTION_TAPPING
//#define NO_ACTION_ONESHOT
//#define NO_ACTION_MACRO
//#define NO_ACTION_FUNCTION

View File

@ -1,5 +1,5 @@
/* /*
ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -25,8 +25,8 @@
* @{ * @{
*/ */
#ifndef HALCONF_H #ifndef _HALCONF_H_
#define HALCONF_H #define _HALCONF_H_
#include "mcuconf.h" #include "mcuconf.h"
@ -55,7 +55,7 @@
* @brief Enables the DAC subsystem. * @brief Enables the DAC subsystem.
*/ */
#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) #if !defined(HAL_USE_DAC) || defined(__DOXYGEN__)
#define HAL_USE_DAC TRUE #define HAL_USE_DAC FALSE
#endif #endif
/** /**
@ -69,14 +69,14 @@
* @brief Enables the GPT subsystem. * @brief Enables the GPT subsystem.
*/ */
#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) #if !defined(HAL_USE_GPT) || defined(__DOXYGEN__)
#define HAL_USE_GPT TRUE #define HAL_USE_GPT FALSE
#endif #endif
/** /**
* @brief Enables the I2C subsystem. * @brief Enables the I2C subsystem.
*/ */
#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) #if !defined(HAL_USE_I2C) || defined(__DOXYGEN__)
#define HAL_USE_I2C TRUE #define HAL_USE_I2C FALSE
#endif #endif
/** /**
@ -111,14 +111,7 @@
* @brief Enables the PWM subsystem. * @brief Enables the PWM subsystem.
*/ */
#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) #if !defined(HAL_USE_PWM) || defined(__DOXYGEN__)
#define HAL_USE_PWM FALSE #define HAL_USE_PWM TRUE
#endif
/**
* @brief Enables the QSPI subsystem.
*/
#if !defined(HAL_USE_QSPI) || defined(__DOXYGEN__)
#define HAL_USE_QSPI FALSE
#endif #endif
/** /**
@ -153,7 +146,7 @@
* @brief Enables the SPI subsystem. * @brief Enables the SPI subsystem.
*/ */
#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) #if !defined(HAL_USE_SPI) || defined(__DOXYGEN__)
#define HAL_USE_SPI FALSE #define HAL_USE_SPI TRUE
#endif #endif
/** /**
@ -301,7 +294,7 @@
* @brief Serial buffers size. * @brief Serial buffers size.
* @details Configuration parameter, you can change the depth of the queue * @details Configuration parameter, you can change the depth of the queue
* buffers depending on the requirements of your application. * buffers depending on the requirements of your application.
* @note The default is 16 bytes for both the transmission and receive * @note The default is 64 bytes for both the transmission and receive
* buffers. * buffers.
*/ */
#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) #if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__)
@ -316,21 +309,13 @@
* @brief Serial over USB buffers size. * @brief Serial over USB buffers size.
* @details Configuration parameter, the buffer size must be a multiple of * @details Configuration parameter, the buffer size must be a multiple of
* the USB data endpoint maximum packet size. * the USB data endpoint maximum packet size.
* @note The default is 256 bytes for both the transmission and receive * @note The default is 64 bytes for both the transmission and receive
* buffers. * buffers.
*/ */
#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__) #if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__)
#define SERIAL_USB_BUFFERS_SIZE 1 #define SERIAL_USB_BUFFERS_SIZE 1
#endif #endif
/**
* @brief Serial over USB number of buffers.
* @note The default is 2 buffers.
*/
#if !defined(SERIAL_USB_BUFFERS_NUMBER) || defined(__DOXYGEN__)
#define SERIAL_USB_BUFFERS_NUMBER 2
#endif
/*===========================================================================*/ /*===========================================================================*/
/* SPI driver related settings. */ /* SPI driver related settings. */
/*===========================================================================*/ /*===========================================================================*/
@ -351,26 +336,6 @@
#define SPI_USE_MUTUAL_EXCLUSION TRUE #define SPI_USE_MUTUAL_EXCLUSION TRUE
#endif #endif
/*===========================================================================*/
/* UART driver related settings. */
/*===========================================================================*/
/**
* @brief Enables synchronous APIs.
* @note Disabling this option saves both code and data space.
*/
#if !defined(UART_USE_WAIT) || defined(__DOXYGEN__)
#define UART_USE_WAIT FALSE
#endif
/**
* @brief Enables the @p uartAcquireBus() and @p uartReleaseBus() APIs.
* @note Disabling this option saves both code and data space.
*/
#if !defined(UART_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
#define UART_USE_MUTUAL_EXCLUSION FALSE
#endif
/*===========================================================================*/ /*===========================================================================*/
/* USB driver related settings. */ /* USB driver related settings. */
/*===========================================================================*/ /*===========================================================================*/
@ -383,6 +348,6 @@
#define USB_USE_WAIT TRUE #define USB_USE_WAIT TRUE
#endif #endif
#endif /* HALCONF_H */ #endif /* _HALCONF_H_ */
/** @} */ /** @} */

View File

@ -0,0 +1,48 @@
/*
Copyright 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/>.
*/
#include QMK_KEYBOARD_H
extern keymap_config_t keymap_config;
// Each layer gets a name for readability, which is then used in the keymap matrix below.
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
// Layer names don't all need to be of the same length, obviously, and you can also skip them
// entirely and just use numbers.
#define _BASE 0
#define _FN1 1
enum custom_keycodes {
QWERTY = SAFE_RANGE,
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_BASE] = LAYOUT_default(
KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, KC_INS,\
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL,\
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, \
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, \
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FN1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT \
),
[_FN1] = LAYOUT_default(
KC_GESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, _______, _______,\
RGB_TOG, RGB_MOD, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,\
BL_BRTG, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
BL_INC, BL_DEC, BL_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
KC_GRV, _______, _______, _______, _______, _______, _______, _______, _______, RESET \
)
};

View File

@ -0,0 +1,105 @@
/*
* Copyright (C) 2013-2016 Fabio Utzig, http://fabioutzig.com
* (C) 2016 flabbergast <s3+flabbergast@sdfeu.org>
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
/*
* KL26Z64 memory setup.
*/
MEMORY
{
flash0 : org = 0x00000000, len = 0x100
flash1 : org = 0x00000400, len = 0x10
flash2 : org = 0x00000410, len = 62k - 0x410
flash3 : org = 0x0000F800, len = 2k
flash4 : org = 0x00000000, len = 0
flash5 : org = 0x00000000, len = 0
flash6 : org = 0x00000000, len = 0
flash7 : org = 0x00000000, len = 0
ram0 : org = 0x1FFFF800, len = 8k
ram1 : org = 0x00000000, len = 0
ram2 : org = 0x00000000, len = 0
ram3 : org = 0x00000000, len = 0
ram4 : org = 0x00000000, len = 0
ram5 : org = 0x00000000, len = 0
ram6 : org = 0x00000000, len = 0
ram7 : org = 0x00000000, len = 0
}
/* Flash region for the configuration bytes.*/
SECTIONS
{
.cfmprotect : ALIGN(4) SUBALIGN(4)
{
KEEP(*(.cfmconfig))
} > flash1
}
/* For each data/text section two region are defined, a virtual region
and a load region (_LMA suffix).*/
/* Flash region to be used for exception vectors.*/
REGION_ALIAS("VECTORS_FLASH", flash0);
REGION_ALIAS("VECTORS_FLASH_LMA", flash0);
/* Flash region to be used for constructors and destructors.*/
REGION_ALIAS("XTORS_FLASH", flash2);
REGION_ALIAS("XTORS_FLASH_LMA", flash2);
/* Flash region to be used for code text.*/
REGION_ALIAS("TEXT_FLASH", flash2);
REGION_ALIAS("TEXT_FLASH_LMA", flash2);
/* Flash region to be used for read only data.*/
REGION_ALIAS("RODATA_FLASH", flash2);
REGION_ALIAS("RODATA_FLASH_LMA", flash2);
/* Flash region to be used for various.*/
REGION_ALIAS("VARIOUS_FLASH", flash2);
REGION_ALIAS("VARIOUS_FLASH_LMA", flash2);
/* Flash region to be used for RAM(n) initialization data.*/
REGION_ALIAS("RAM_INIT_FLASH_LMA", flash2);
/* RAM region to be used for Main stack. This stack accommodates the processing
of all exceptions and interrupts.*/
REGION_ALIAS("MAIN_STACK_RAM", ram0);
/* RAM region to be used for the process stack. This is the stack used by
the main() function.*/
REGION_ALIAS("PROCESS_STACK_RAM", ram0);
/* RAM region to be used for data segment.*/
REGION_ALIAS("DATA_RAM", ram0);
REGION_ALIAS("DATA_RAM_LMA", flash2);
/* RAM region to be used for BSS segment.*/
REGION_ALIAS("BSS_RAM", ram0);
/* RAM region to be used for the default heap.*/
REGION_ALIAS("HEAP_RAM", ram0);
__eeprom_workarea_start__ = ORIGIN(flash3);
__eeprom_workarea_size__ = LENGTH(flash3);
__eeprom_workarea_end__ = __eeprom_workarea_start__ + __eeprom_workarea_size__;
/* Generic rules inclusion.*/
INCLUDE rules.ld

View File

@ -0,0 +1,88 @@
/*
ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/*
* ST32F103xB memory setup for use with the maplemini bootloader.
* You will have to
* #define CORTEX_VTOR_INIT 0x5000
* in your projects chconf.h
*/
MEMORY
{
flash0 : org = 0x08002000, len = 64k - 0x2000
flash1 : org = 0x00000000, len = 0
flash2 : org = 0x00000000, len = 0
flash3 : org = 0x00000000, len = 0
flash4 : org = 0x00000000, len = 0
flash5 : org = 0x00000000, len = 0
flash6 : org = 0x00000000, len = 0
flash7 : org = 0x00000000, len = 0
ram0 : org = 0x20000000, len = 20k
ram1 : org = 0x00000000, len = 0
ram2 : org = 0x00000000, len = 0
ram3 : org = 0x00000000, len = 0
ram4 : org = 0x00000000, len = 0
ram5 : org = 0x00000000, len = 0
ram6 : org = 0x00000000, len = 0
ram7 : org = 0x00000000, len = 0
}
/* For each data/text section two region are defined, a virtual region
and a load region (_LMA suffix).*/
/* Flash region to be used for exception vectors.*/
REGION_ALIAS("VECTORS_FLASH", flash0);
REGION_ALIAS("VECTORS_FLASH_LMA", flash0);
/* Flash region to be used for constructors and destructors.*/
REGION_ALIAS("XTORS_FLASH", flash0);
REGION_ALIAS("XTORS_FLASH_LMA", flash0);
/* Flash region to be used for code text.*/
REGION_ALIAS("TEXT_FLASH", flash0);
REGION_ALIAS("TEXT_FLASH_LMA", flash0);
/* Flash region to be used for read only data.*/
REGION_ALIAS("RODATA_FLASH", flash0);
REGION_ALIAS("RODATA_FLASH_LMA", flash0);
/* Flash region to be used for various.*/
REGION_ALIAS("VARIOUS_FLASH", flash0);
REGION_ALIAS("VARIOUS_FLASH_LMA", flash0);
/* Flash region to be used for RAM(n) initialization data.*/
REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0);
/* RAM region to be used for Main stack. This stack accommodates the processing
of all exceptions and interrupts.*/
REGION_ALIAS("MAIN_STACK_RAM", ram0);
/* RAM region to be used for the process stack. This is the stack used by
the main() function.*/
REGION_ALIAS("PROCESS_STACK_RAM", ram0);
/* RAM region to be used for data segment.*/
REGION_ALIAS("DATA_RAM", ram0);
REGION_ALIAS("DATA_RAM_LMA", flash0);
/* RAM region to be used for BSS segment.*/
REGION_ALIAS("BSS_RAM", ram0);
/* RAM region to be used for the default heap.*/
REGION_ALIAS("HEAP_RAM", ram0);
/* Generic rules inclusion.*/
INCLUDE rules.ld

View File

@ -1,5 +1,5 @@
/* /*
ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
@ -14,11 +14,13 @@
limitations under the License. limitations under the License.
*/ */
#ifndef MCUCONF_H #ifndef _MCUCONF_H_
#define MCUCONF_H #define _MCUCONF_H_
#define STM32F103_MCUCONF
/* /*
* STM32F3xx drivers configuration. * STM32F103 drivers configuration.
* The following settings override the default settings present in * The following settings override the default settings present in
* the various device driver implementation headers. * the various device driver implementation headers.
* Note that the settings for each driver only have effect if the whole * Note that the settings for each driver only have effect if the whole
@ -31,71 +33,35 @@
* 0...3 Lowest...Highest. * 0...3 Lowest...Highest.
*/ */
#define STM32F3xx_MCUCONF
/* /*
* HAL driver system settings. * HAL driver system settings.
*/ */
#define STM32_NO_INIT FALSE #define STM32_NO_INIT FALSE
#define STM32_PVD_ENABLE FALSE
#define STM32_PLS STM32_PLS_LEV0
#define STM32_HSI_ENABLED TRUE #define STM32_HSI_ENABLED TRUE
#define STM32_LSI_ENABLED TRUE #define STM32_LSI_ENABLED FALSE
#define STM32_HSE_ENABLED TRUE #define STM32_HSE_ENABLED TRUE
#define STM32_LSE_ENABLED FALSE #define STM32_LSE_ENABLED FALSE
#define STM32_SW STM32_SW_PLL #define STM32_SW STM32_SW_PLL
#define STM32_PLLSRC STM32_PLLSRC_HSE #define STM32_PLLSRC STM32_PLLSRC_HSE
#define STM32_PREDIV_VALUE 1 #define STM32_PLLXTPRE STM32_PLLXTPRE_DIV1
#define STM32_PLLMUL_VALUE 9 #define STM32_PLLMUL_VALUE 9
#define STM32_HPRE STM32_HPRE_DIV1 #define STM32_HPRE STM32_HPRE_DIV1
#define STM32_PPRE1 STM32_PPRE1_DIV2 #define STM32_PPRE1 STM32_PPRE1_DIV2
#define STM32_PPRE2 STM32_PPRE2_DIV2 #define STM32_PPRE2 STM32_PPRE2_DIV2
#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK #define STM32_ADCPRE STM32_ADCPRE_DIV4
#define STM32_ADC12PRES STM32_ADC12PRES_DIV1
#define STM32_ADC34PRES STM32_ADC34PRES_DIV1
#define STM32_USART1SW STM32_USART1SW_PCLK
#define STM32_USART2SW STM32_USART2SW_PCLK
#define STM32_USART3SW STM32_USART3SW_PCLK
#define STM32_UART4SW STM32_UART4SW_PCLK
#define STM32_UART5SW STM32_UART5SW_PCLK
#define STM32_I2C1SW STM32_I2C1SW_SYSCLK
#define STM32_I2C2SW STM32_I2C2SW_SYSCLK
#define STM32_TIM1SW STM32_TIM1SW_PCLK2
#define STM32_TIM8SW STM32_TIM8SW_PCLK2
#define STM32_RTCSEL STM32_RTCSEL_LSI
#define STM32_USB_CLOCK_REQUIRED TRUE #define STM32_USB_CLOCK_REQUIRED TRUE
#define STM32_USBPRE STM32_USBPRE_DIV1P5 #define STM32_USBPRE STM32_USBPRE_DIV1P5
#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK
#undef STM32_HSE_BYPASS #define STM32_RTCSEL STM32_RTCSEL_HSEDIV
// #error "oh no" #define STM32_PVD_ENABLE FALSE
// #endif #define STM32_PLS STM32_PLS_LEV0
/* /*
* ADC driver system settings. * ADC driver system settings.
*/ */
#define STM32_ADC_DUAL_MODE FALSE
#define STM32_ADC_COMPACT_SAMPLES FALSE
#define STM32_ADC_USE_ADC1 FALSE #define STM32_ADC_USE_ADC1 FALSE
#define STM32_ADC_USE_ADC2 FALSE
#define STM32_ADC_USE_ADC3 FALSE
#define STM32_ADC_USE_ADC4 FALSE
#define STM32_ADC_ADC1_DMA_STREAM STM32_DMA_STREAM_ID(1, 1)
#define STM32_ADC_ADC2_DMA_STREAM STM32_DMA_STREAM_ID(2, 1)
#define STM32_ADC_ADC3_DMA_STREAM STM32_DMA_STREAM_ID(2, 5)
#define STM32_ADC_ADC4_DMA_STREAM STM32_DMA_STREAM_ID(2, 2)
#define STM32_ADC_ADC1_DMA_PRIORITY 2 #define STM32_ADC_ADC1_DMA_PRIORITY 2
#define STM32_ADC_ADC2_DMA_PRIORITY 2 #define STM32_ADC_ADC1_IRQ_PRIORITY 6
#define STM32_ADC_ADC3_DMA_PRIORITY 2
#define STM32_ADC_ADC4_DMA_PRIORITY 2
#define STM32_ADC_ADC12_IRQ_PRIORITY 5
#define STM32_ADC_ADC3_IRQ_PRIORITY 5
#define STM32_ADC_ADC4_IRQ_PRIORITY 5
#define STM32_ADC_ADC1_DMA_IRQ_PRIORITY 5
#define STM32_ADC_ADC2_DMA_IRQ_PRIORITY 5
#define STM32_ADC_ADC3_DMA_IRQ_PRIORITY 5
#define STM32_ADC_ADC4_DMA_IRQ_PRIORITY 5
#define STM32_ADC_ADC12_CLOCK_MODE ADC_CCR_CKMODE_AHB_DIV1
#define STM32_ADC_ADC34_CLOCK_MODE ADC_CCR_CKMODE_AHB_DIV1
/* /*
* CAN driver system settings. * CAN driver system settings.
@ -103,17 +69,6 @@
#define STM32_CAN_USE_CAN1 FALSE #define STM32_CAN_USE_CAN1 FALSE
#define STM32_CAN_CAN1_IRQ_PRIORITY 11 #define STM32_CAN_CAN1_IRQ_PRIORITY 11
/*
* DAC driver system settings.
*/
#define STM32_DAC_DUAL_MODE FALSE
#define STM32_DAC_USE_DAC1_CH1 TRUE
#define STM32_DAC_USE_DAC1_CH2 TRUE
#define STM32_DAC_DAC1_CH1_IRQ_PRIORITY 10
#define STM32_DAC_DAC1_CH2_IRQ_PRIORITY 10
#define STM32_DAC_DAC1_CH1_DMA_PRIORITY 2
#define STM32_DAC_DAC1_CH2_DMA_PRIORITY 2
/* /*
* EXT driver system settings. * EXT driver system settings.
*/ */
@ -128,10 +83,6 @@
#define STM32_EXT_EXTI17_IRQ_PRIORITY 6 #define STM32_EXT_EXTI17_IRQ_PRIORITY 6
#define STM32_EXT_EXTI18_IRQ_PRIORITY 6 #define STM32_EXT_EXTI18_IRQ_PRIORITY 6
#define STM32_EXT_EXTI19_IRQ_PRIORITY 6 #define STM32_EXT_EXTI19_IRQ_PRIORITY 6
#define STM32_EXT_EXTI20_IRQ_PRIORITY 6
#define STM32_EXT_EXTI21_22_29_IRQ_PRIORITY 6
#define STM32_EXT_EXTI30_32_IRQ_PRIORITY 6
#define STM32_EXT_EXTI33_IRQ_PRIORITY 6
/* /*
* GPT driver system settings. * GPT driver system settings.
@ -140,28 +91,25 @@
#define STM32_GPT_USE_TIM2 FALSE #define STM32_GPT_USE_TIM2 FALSE
#define STM32_GPT_USE_TIM3 FALSE #define STM32_GPT_USE_TIM3 FALSE
#define STM32_GPT_USE_TIM4 FALSE #define STM32_GPT_USE_TIM4 FALSE
#define STM32_GPT_USE_TIM6 TRUE #define STM32_GPT_USE_TIM5 FALSE
#define STM32_GPT_USE_TIM7 TRUE #define STM32_GPT_USE_TIM8 FALSE
#define STM32_GPT_USE_TIM8 TRUE
#define STM32_GPT_TIM1_IRQ_PRIORITY 7 #define STM32_GPT_TIM1_IRQ_PRIORITY 7
#define STM32_GPT_TIM2_IRQ_PRIORITY 7 #define STM32_GPT_TIM2_IRQ_PRIORITY 7
#define STM32_GPT_TIM3_IRQ_PRIORITY 7 #define STM32_GPT_TIM3_IRQ_PRIORITY 7
#define STM32_GPT_TIM4_IRQ_PRIORITY 7 #define STM32_GPT_TIM4_IRQ_PRIORITY 7
#define STM32_GPT_TIM6_IRQ_PRIORITY 7 #define STM32_GPT_TIM5_IRQ_PRIORITY 7
#define STM32_GPT_TIM7_IRQ_PRIORITY 7
#define STM32_GPT_TIM8_IRQ_PRIORITY 7 #define STM32_GPT_TIM8_IRQ_PRIORITY 7
/* /*
* I2C driver system settings. * I2C driver system settings.
*/ */
#define STM32_I2C_USE_I2C1 TRUE #define STM32_I2C_USE_I2C1 FALSE
#define STM32_I2C_USE_I2C2 FALSE #define STM32_I2C_USE_I2C2 FALSE
#define STM32_I2C_BUSY_TIMEOUT 50 #define STM32_I2C_BUSY_TIMEOUT 50
#define STM32_I2C_I2C1_IRQ_PRIORITY 10 #define STM32_I2C_I2C1_IRQ_PRIORITY 5
#define STM32_I2C_I2C2_IRQ_PRIORITY 10 #define STM32_I2C_I2C2_IRQ_PRIORITY 5
#define STM32_I2C_USE_DMA TRUE #define STM32_I2C_I2C1_DMA_PRIORITY 3
#define STM32_I2C_I2C1_DMA_PRIORITY 1 #define STM32_I2C_I2C2_DMA_PRIORITY 3
#define STM32_I2C_I2C2_DMA_PRIORITY 1
#define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure") #define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure")
/* /*
@ -171,28 +119,37 @@
#define STM32_ICU_USE_TIM2 FALSE #define STM32_ICU_USE_TIM2 FALSE
#define STM32_ICU_USE_TIM3 FALSE #define STM32_ICU_USE_TIM3 FALSE
#define STM32_ICU_USE_TIM4 FALSE #define STM32_ICU_USE_TIM4 FALSE
#define STM32_ICU_USE_TIM5 FALSE
#define STM32_ICU_USE_TIM8 FALSE #define STM32_ICU_USE_TIM8 FALSE
#define STM32_ICU_TIM1_IRQ_PRIORITY 7 #define STM32_ICU_TIM1_IRQ_PRIORITY 7
#define STM32_ICU_TIM2_IRQ_PRIORITY 7 #define STM32_ICU_TIM2_IRQ_PRIORITY 7
#define STM32_ICU_TIM3_IRQ_PRIORITY 7 #define STM32_ICU_TIM3_IRQ_PRIORITY 7
#define STM32_ICU_TIM4_IRQ_PRIORITY 7 #define STM32_ICU_TIM4_IRQ_PRIORITY 7
#define STM32_ICU_TIM5_IRQ_PRIORITY 7
#define STM32_ICU_TIM8_IRQ_PRIORITY 7 #define STM32_ICU_TIM8_IRQ_PRIORITY 7
/* /*
* PWM driver system settings. * PWM driver system settings.
*/ */
#define STM32_PWM_USE_ADVANCED FALSE #define STM32_PWM_USE_ADVANCED FALSE
#define STM32_PWM_USE_TIM1 FALSE #define STM32_PWM_USE_TIM1 TRUE
#define STM32_PWM_USE_TIM2 FALSE #define STM32_PWM_USE_TIM2 FALSE
#define STM32_PWM_USE_TIM3 FALSE #define STM32_PWM_USE_TIM3 FALSE
#define STM32_PWM_USE_TIM4 FALSE #define STM32_PWM_USE_TIM4 FALSE
#define STM32_PWM_USE_TIM5 FALSE
#define STM32_PWM_USE_TIM8 FALSE #define STM32_PWM_USE_TIM8 FALSE
#define STM32_PWM_TIM1_IRQ_PRIORITY 7 #define STM32_PWM_TIM1_IRQ_PRIORITY 7
#define STM32_PWM_TIM2_IRQ_PRIORITY 7 #define STM32_PWM_TIM2_IRQ_PRIORITY 7
#define STM32_PWM_TIM3_IRQ_PRIORITY 7 #define STM32_PWM_TIM3_IRQ_PRIORITY 7
#define STM32_PWM_TIM4_IRQ_PRIORITY 7 #define STM32_PWM_TIM4_IRQ_PRIORITY 7
#define STM32_PWM_TIM5_IRQ_PRIORITY 7
#define STM32_PWM_TIM8_IRQ_PRIORITY 7 #define STM32_PWM_TIM8_IRQ_PRIORITY 7
/*
* RTC driver system settings.
*/
#define STM32_RTC_IRQ_PRIORITY 15
/* /*
* SERIAL driver system settings. * SERIAL driver system settings.
*/ */
@ -211,7 +168,7 @@
* SPI driver system settings. * SPI driver system settings.
*/ */
#define STM32_SPI_USE_SPI1 FALSE #define STM32_SPI_USE_SPI1 FALSE
#define STM32_SPI_USE_SPI2 FALSE #define STM32_SPI_USE_SPI2 TRUE
#define STM32_SPI_USE_SPI3 FALSE #define STM32_SPI_USE_SPI3 FALSE
#define STM32_SPI_SPI1_DMA_PRIORITY 1 #define STM32_SPI_SPI1_DMA_PRIORITY 1
#define STM32_SPI_SPI2_DMA_PRIORITY 1 #define STM32_SPI_SPI2_DMA_PRIORITY 1
@ -249,9 +206,4 @@
#define STM32_USB_USB1_HP_IRQ_PRIORITY 13 #define STM32_USB_USB1_HP_IRQ_PRIORITY 13
#define STM32_USB_USB1_LP_IRQ_PRIORITY 14 #define STM32_USB_USB1_LP_IRQ_PRIORITY 14
/* #endif /* _MCUCONF_H_ */
* WDG driver system settings.
*/
#define STM32_WDG_USE_IWDG FALSE
#endif /* MCUCONF_H */

View File

@ -0,0 +1,2 @@
#include "practice65.h"

View File

@ -0,0 +1,19 @@
#pragma once
#include "quantum.h"
#define KNO KC_NO
#define LAYOUT_default( \
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, \
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1F, \
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, K2F, \
K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3F, \
K40, K41, K42, K46, K49, K4A, K4B, K4C, K4D, K4F \
) { \
{ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F }, \
{ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, KC_NO , K1F }, \
{ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, KC_NO, K2D, KC_NO, K2F }, \
{ K30, KNO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, KC_NO, K3F }, \
{ K40, K41, K42, KNO, KC_NO, KC_NO, K46, KC_NO, KC_NO, K49, K4A, K4B, K4C, K4D, KC_NO, K4F } \
}

View File

@ -0,0 +1,12 @@
# Practice 65
A Blue Pill STM32F103C8T6-based 65% ANSI board.
Keyboard Maintainer: [Andrew Kannan](https://github.com/awkannan1)
Hardware Supported: Blue Pill STM32F103C8T6
Make example for this keyboard (after setting up your build environment):
make cannonkeys/practice65:default
See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).

View File

@ -0,0 +1,53 @@
# project specific files
VPATH += keyboards/cannonkeys/bluepill
SRC = led.c \
keyboard.c
# GENERIC STM32F103C8T6 board - stm32duino bootloader
OPT_DEFS = -DCORTEX_VTOR_INIT=0x2000
MCU_LDSCRIPT = STM32F103x8_stm32duino_bootloader
BOARD = GENERIC_STM32_F103
# OPT_DEFS =
# MCU_LDSCRIPT = STM32F103x8
# BOARD = GENERIC_STM32_F103
## chip/board settings
# the next two should match the directories in
# <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
MCU_FAMILY = STM32
MCU_SERIES = STM32F1xx
# linker script to use
# it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
# or <this_dir>/ld/
# startup code to use
# is should exist in <chibios>/os/common/ports/ARMCMx/compilers/GCC/mk/
MCU_STARTUP = stm32f1xx
# it should exist either in <chibios>/os/hal/boards/
# or <this_dir>/boards
# Cortex version
# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4
MCU = cortex-m3
# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
ARMV = 7
# If you want to be able to jump to bootloader from firmware on STM32 MCUs,
# set the correct BOOTLOADER_ADDRESS. Either set it here, or define it in
# ./bootloader_defs.h or in ./boards/<FOO>/bootloader_defs.h (if you have
# a custom board definition that you plan to reuse).
# If you're not setting it here, leave it commented out.
# It is chip dependent, the correct number can be looked up here (page 175):
# http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf
# This also requires a patch to chibios:
# <tmk_dir>/tmk_core/tool/chibios/ch-bootloader-jump.patch
#STM32_BOOTLOADER_ADDRESS = 0x1FFFC800
#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration
MOUSEKEY_ENABLE = yes # Mouse keys
EXTRAKEY_ENABLE = yes # Audio control and System control
CONSOLE_ENABLE = yes # Console for debug
COMMAND_ENABLE = yes # Commands for debug and configuration
SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
NKRO_ENABLE = yes # USB Nkey Rollover
BACKLIGHT_ENABLE = yes
RGBLIGHT_ENABLE = yes

View File

@ -76,7 +76,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// Bump this every time we change what we store // Bump this every time we change what we store
// This will automatically reset the EEPROM with defaults // This will automatically reset the EEPROM with defaults
// and avoid loading invalid data from the EEPROM // and avoid loading invalid data from the EEPROM
#define EEPROM_VERSION 0x0F #define EEPROM_VERSION 0x01
#define EEPROM_VERSION_ADDR 34 #define EEPROM_VERSION_ADDR 34
// Dynamic keymap starts after EEPROM version // Dynamic keymap starts after EEPROM version

View File

@ -42,8 +42,8 @@ static const I2CConfig i2cconfig = {
0 0
}; };
static i2c_status_t chibios_to_qmk(const msg_t* status) { static i2c_status_t chibios_to_qmk(const msg_t status) {
switch (*status) { switch (status) {
case I2C_NO_ERROR: case I2C_NO_ERROR:
return I2C_STATUS_SUCCESS; return I2C_STATUS_SUCCESS;
case I2C_TIMEOUT: case I2C_TIMEOUT:
@ -83,7 +83,7 @@ i2c_status_t i2c_transmit(uint8_t address, const uint8_t* data, uint16_t length,
i2cAcquireBus(&I2C_DRIVER); i2cAcquireBus(&I2C_DRIVER);
msg_t status = i2cMasterTransmitTimeout(&I2C_DRIVER, (i2c_address >> 1), data, length, 0, 0, MS2ST(timeout)); msg_t status = i2cMasterTransmitTimeout(&I2C_DRIVER, (i2c_address >> 1), data, length, 0, 0, MS2ST(timeout));
i2cReleaseBus(&I2C_DRIVER); i2cReleaseBus(&I2C_DRIVER);
return chibios_to_qmk(&status); return chibios_to_qmk(status);
} }
i2c_status_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout) i2c_status_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout)
@ -91,7 +91,7 @@ i2c_status_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16
i2c_address = address; i2c_address = address;
i2cStart(&I2C_DRIVER, &i2cconfig); i2cStart(&I2C_DRIVER, &i2cconfig);
msg_t status = i2cMasterReceiveTimeout(&I2C_DRIVER, (i2c_address >> 1), data, length, MS2ST(timeout)); msg_t status = i2cMasterReceiveTimeout(&I2C_DRIVER, (i2c_address >> 1), data, length, MS2ST(timeout));
return chibios_to_qmk(&status); return chibios_to_qmk(status);
} }
i2c_status_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, const uint8_t* data, uint16_t length, uint16_t timeout) i2c_status_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, const uint8_t* data, uint16_t length, uint16_t timeout)
@ -107,7 +107,7 @@ i2c_status_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, const uint8_t* data,
complete_packet[0] = regaddr; complete_packet[0] = regaddr;
msg_t status = i2cMasterTransmitTimeout(&I2C_DRIVER, (i2c_address >> 1), complete_packet, length + 1, 0, 0, MS2ST(timeout)); msg_t status = i2cMasterTransmitTimeout(&I2C_DRIVER, (i2c_address >> 1), complete_packet, length + 1, 0, 0, MS2ST(timeout));
return chibios_to_qmk(&status); return chibios_to_qmk(status);
} }
i2c_status_t i2c_readReg(uint8_t devaddr, uint8_t* regaddr, uint8_t* data, uint16_t length, uint16_t timeout) i2c_status_t i2c_readReg(uint8_t devaddr, uint8_t* regaddr, uint8_t* data, uint16_t length, uint16_t timeout)
@ -115,7 +115,7 @@ i2c_status_t i2c_readReg(uint8_t devaddr, uint8_t* regaddr, uint8_t* data, uint1
i2c_address = devaddr; i2c_address = devaddr;
i2cStart(&I2C_DRIVER, &i2cconfig); i2cStart(&I2C_DRIVER, &i2cconfig);
msg_t status = i2cMasterTransmitTimeout(&I2C_DRIVER, (i2c_address >> 1), regaddr, 1, data, length, MS2ST(timeout)); msg_t status = i2cMasterTransmitTimeout(&I2C_DRIVER, (i2c_address >> 1), regaddr, 1, data, length, MS2ST(timeout));
return chibios_to_qmk(&status); return chibios_to_qmk(status);
} }
void i2c_stop(void) void i2c_stop(void)

View File

@ -0,0 +1,37 @@
/*
Copyright 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/>.
*/
#include QMK_KEYBOARD_H
const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT_all(
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, ENC_PRESS,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP,
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENTER, KC_PGDN,
KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, MO(1),
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
),
[1] = LAYOUT_all(
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, _______, OLED_TOGG,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, CLOCK_SET,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
)
};

View File

@ -17,25 +17,27 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include QMK_KEYBOARD_H #include QMK_KEYBOARD_H
const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT_default( [0] = LAYOUT_all(
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, ENC_PRESS, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, ENC_PRESS,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL,
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENTER, KC_PGUP, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENTER, KC_PGUP,
KC_LSFT, KC_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_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN,
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
), ),
[1] = LAYOUT_default( [1] = LAYOUT_all(
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, OLED_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, OLED_TOGG,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, CLOCK_SET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, CLOCK_SET,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______ RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
) )
}; };
void matrix_init_user(void) { void matrix_init_user(void) {
//user initialization //user initialization
} }

View File

@ -35,6 +35,7 @@ OPT_DEFS =
# Options to pass to dfu-util when flashing # Options to pass to dfu-util when flashing
DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave
DFU_SUFFIX_ARGS = -p DF11 -v 0483
# Build Options # Build Options
# comment out to disable the options. # comment out to disable the options.

View File

@ -13,6 +13,7 @@ OPT_DEFS =
# Options to pass to dfu-util when flashing # Options to pass to dfu-util when flashing
DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave
DFU_SUFFIX_ARGS = -p DF11 -v 0483
# Build Options # Build Options
# comment out to disable the options. # comment out to disable the options.

View File

@ -37,6 +37,7 @@ OPT_DEFS =
# Options to pass to dfu-util when flashing # Options to pass to dfu-util when flashing
DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave
DFU_SUFFIX_ARGS = -p DF11 -v 0483
# LED Configuration # LED Configuration
LED_MATRIX_ENABLE = IS31FL3731 LED_MATRIX_ENABLE = IS31FL3731

Some files were not shown because too many files have changed in this diff Show More