Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1d784f0f95 | ||
|
|
e337bb82a3 | ||
|
|
6806398246 | ||
|
|
36e950a13f | ||
|
|
b23c3b0fd6 | ||
|
|
53c51f1d16 | ||
|
|
c3be0520c4 | ||
|
|
0250cad420 | ||
|
|
27cff473e0 | ||
|
|
e2d141582c | ||
|
|
777e8be80a | ||
|
|
8faee5c9f6 | ||
|
|
ffd10d4116 | ||
|
|
90cd383d46 | ||
|
|
6caaf69357 | ||
|
|
f0599542ea | ||
|
|
5c302fad21 | ||
|
|
4322c71771 | ||
|
|
9c98fef4f6 | ||
|
|
9f8c8c53a5 | ||
|
|
5312131d35 | ||
|
|
e6f4173aec | ||
|
|
eda924d7dc | ||
|
|
dafdb5f9ae | ||
|
|
479baf98e0 | ||
|
|
978074e417 | ||
|
|
703699b81f | ||
|
|
d4a5402aeb | ||
|
|
7ae2ded590 | ||
|
|
d48a5b29d7 | ||
|
|
ce8fb1eab9 | ||
|
|
a2cec0594b | ||
|
|
6d73fe1277 | ||
|
|
bb52119a6d | ||
|
|
b61baf4281 | ||
|
|
c28a432112 | ||
|
|
066818f5f9 | ||
|
|
c7583d181a | ||
|
|
76e78e8ca1 | ||
|
|
4ecaa25f3e | ||
|
|
81d8e6ef3e | ||
|
|
98f7af6d3b | ||
|
|
50e0bdab00 | ||
|
|
e2843c25ce | ||
|
|
b27ddf1edb | ||
|
|
829ccd3491 | ||
|
|
ff9cd1dd0c | ||
|
|
d3268280ef | ||
|
|
33e27b2a83 | ||
|
|
dd3a813f87 | ||
|
|
0a645225b9 | ||
|
|
b5cb5ec6dd | ||
|
|
a1f2514051 | ||
|
|
ed74bd95f6 | ||
|
|
edcedd53d1 | ||
|
|
8170be5b10 | ||
|
|
4856552f8b | ||
|
|
7e67bd791b | ||
|
|
dfab177f88 | ||
|
|
dd64a4e738 | ||
|
|
1ef01ba4c6 | ||
|
|
746058306b | ||
|
|
50fce7f255 | ||
|
|
b60413af60 | ||
|
|
55ace26a5d | ||
|
|
5539d7affb | ||
|
|
7fa854729c | ||
|
|
5ed7d9c9ca | ||
|
|
e3a940026e | ||
|
|
74af596d8a | ||
|
|
8aee82e8b4 |
No files matched your search
+1
-1
@@ -21,7 +21,7 @@ before_script:
|
|||||||
- avr-gcc --version
|
- avr-gcc --version
|
||||||
script:
|
script:
|
||||||
- git rev-parse --short HEAD
|
- git rev-parse --short HEAD
|
||||||
- make test:all
|
- bash util/travis_test.sh
|
||||||
- bash util/travis_build.sh
|
- bash util/travis_build.sh
|
||||||
- bash util/travis_docs.sh
|
- bash util/travis_docs.sh
|
||||||
addons:
|
addons:
|
||||||
|
|||||||
@@ -280,6 +280,23 @@ ifneq ("$(wildcard $(KEYBOARD_PATH_1)/config.h)","")
|
|||||||
CONFIG_H += $(KEYBOARD_PATH_1)/config.h
|
CONFIG_H += $(KEYBOARD_PATH_1)/config.h
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
POST_CONFIG_H :=
|
||||||
|
ifneq ("$(wildcard $(KEYBOARD_PATH_1)/post_config.h)","")
|
||||||
|
POST_CONFIG_H += $(KEYBOARD_PATH_1)/post_config.h
|
||||||
|
endif
|
||||||
|
ifneq ("$(wildcard $(KEYBOARD_PATH_2)/post_config.h)","")
|
||||||
|
POST_CONFIG_H += $(KEYBOARD_PATH_2)/post_config.h
|
||||||
|
endif
|
||||||
|
ifneq ("$(wildcard $(KEYBOARD_PATH_3)/post_config.h)","")
|
||||||
|
POST_CONFIG_H += $(KEYBOARD_PATH_3)/post_config.h
|
||||||
|
endif
|
||||||
|
ifneq ("$(wildcard $(KEYBOARD_PATH_4)/post_config.h)","")
|
||||||
|
POST_CONFIG_H += $(KEYBOARD_PATH_4)/post_config.h
|
||||||
|
endif
|
||||||
|
ifneq ("$(wildcard $(KEYBOARD_PATH_5)/post_config.h)","")
|
||||||
|
POST_CONFIG_H += $(KEYBOARD_PATH_5)/post_config.h
|
||||||
|
endif
|
||||||
|
|
||||||
# Save the defines and includes here, so we don't include any keymap specific ones
|
# Save the defines and includes here, so we don't include any keymap specific ones
|
||||||
PROJECT_DEFS := $(OPT_DEFS)
|
PROJECT_DEFS := $(OPT_DEFS)
|
||||||
PROJECT_INC := $(VPATH) $(EXTRAINCDIRS) $(KEYBOARD_PATHS)
|
PROJECT_INC := $(VPATH) $(EXTRAINCDIRS) $(KEYBOARD_PATHS)
|
||||||
@@ -355,6 +372,7 @@ ifeq ($(strip $(VISUALIZER_ENABLE)), yes)
|
|||||||
include $(VISUALIZER_PATH)/visualizer.mk
|
include $(VISUALIZER_PATH)/visualizer.mk
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
CONFIG_H += $(POST_CONFIG_H)
|
||||||
ALL_CONFIGS := $(PROJECT_CONFIG) $(CONFIG_H)
|
ALL_CONFIGS := $(PROJECT_CONFIG) $(CONFIG_H)
|
||||||
|
|
||||||
OUTPUTS := $(KEYMAP_OUTPUT) $(KEYBOARD_OUTPUT)
|
OUTPUTS := $(KEYMAP_OUTPUT) $(KEYBOARD_OUTPUT)
|
||||||
|
|||||||
@@ -103,6 +103,7 @@ ifeq ($(strip $(UNICODE_COMMON)), yes)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
|
ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
|
||||||
|
POST_CONFIG_H += $(QUANTUM_DIR)/rgblight_post_config.h
|
||||||
OPT_DEFS += -DRGBLIGHT_ENABLE
|
OPT_DEFS += -DRGBLIGHT_ENABLE
|
||||||
SRC += $(QUANTUM_DIR)/rgblight.c
|
SRC += $(QUANTUM_DIR)/rgblight.c
|
||||||
CIE1931_CURVE = yes
|
CIE1931_CURVE = yes
|
||||||
@@ -177,6 +178,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
|
||||||
@@ -318,6 +327,7 @@ ifneq ($(strip $(DEBOUNCE_TYPE)), custom)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(strip $(SPLIT_KEYBOARD)), yes)
|
ifeq ($(strip $(SPLIT_KEYBOARD)), yes)
|
||||||
|
POST_CONFIG_H += $(QUANTUM_DIR)/split_common/post_config.h
|
||||||
OPT_DEFS += -DSPLIT_KEYBOARD
|
OPT_DEFS += -DSPLIT_KEYBOARD
|
||||||
|
|
||||||
# Include files used by all split keyboards
|
# Include files used by all split keyboards
|
||||||
@@ -334,3 +344,10 @@ ifeq ($(strip $(SPLIT_KEYBOARD)), yes)
|
|||||||
endif
|
endif
|
||||||
COMMON_VPATH += $(QUANTUM_PATH)/split_common
|
COMMON_VPATH += $(QUANTUM_PATH)/split_common
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(strip $(OLED_DRIVER_ENABLE)), yes)
|
||||||
|
OPT_DEFS += -DOLED_DRIVER_ENABLE
|
||||||
|
COMMON_VPATH += $(DRIVER_PATH)/oled
|
||||||
|
QUANTUM_LIB_SRC += i2c_master.c
|
||||||
|
SRC += oled_driver.c
|
||||||
|
endif
|
||||||
@@ -180,10 +180,12 @@ If you define these options you will enable the associated feature, which may in
|
|||||||
* run RGB animations
|
* run RGB animations
|
||||||
* `#define RGBLED_NUM 12`
|
* `#define RGBLED_NUM 12`
|
||||||
* number of LEDs
|
* number of LEDs
|
||||||
|
* `#define RGBLIGHT_SPLIT`
|
||||||
|
* Needed if both halves of the board have RGB LEDs wired directly to the RGB output pin on the controllers instead of passing the output of the left half to the input of the right half
|
||||||
* `#define RGBLED_SPLIT { 6, 6 }`
|
* `#define RGBLED_SPLIT { 6, 6 }`
|
||||||
* number of LEDs connected that are directly wired to `RGB_DI_PIN` on each half of a split keyboard
|
* number of LEDs connected that are directly wired to `RGB_DI_PIN` on each half of a split keyboard
|
||||||
* First value indicates number of LEDs for left half, second value is for the right half
|
* First value indicates number of LEDs for left half, second value is for the right half
|
||||||
* Needed if both halves of the board have RGB LEDs wired directly to the RGB output pin on the controllers instead of passing the output of the left half to the input of the right half
|
* When RGBLED_SPLIT is defined, RGBLIGHT_SPLIT is implicitly defined.
|
||||||
* `#define RGBLIGHT_HUE_STEP 12`
|
* `#define RGBLIGHT_HUE_STEP 12`
|
||||||
* units to step when in/decreasing hue
|
* units to step when in/decreasing hue
|
||||||
* `#define RGBLIGHT_SAT_STEP 25`
|
* `#define RGBLIGHT_SAT_STEP 25`
|
||||||
|
|||||||
@@ -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 |
|
||||||
|
|||||||
+83
-78
@@ -1,114 +1,119 @@
|
|||||||
# Mousekeys
|
# Mouse keys
|
||||||
|
|
||||||
|
Mouse keys is a feature that allows you to emulate a mouse using your keyboard. You can move the pointer at different speeds, press 5 buttons and scroll in 8 directions.
|
||||||
|
|
||||||
Mousekeys is a feature that allows you to emulate a mouse using your keyboard. You can move the pointer around, click up to 5 buttons, and even scroll in all 4 directions.
|
## Adding mouse keys to your keyboard
|
||||||
|
|
||||||
There are 2 ways to define how the mousekeys behave, using "[auto-accelerating](#configuring-the-behavior-of-mousekeys-with-auto-accelerated-movement)" or "[3-speed constant](#configuring-the-behavior-of-mousekeys-with-3-speed-constant-movement)" behavior.
|
To use mouse keys, you must at least enable mouse keys support and map mouse actions to keys on your keyboard.
|
||||||
|
|
||||||
In either case, you will need to enable mousekeys in your makefile,
|
### Enabling mouse keys
|
||||||
and add the relevant [keycodes](#mapping-mouse-actions-to-keyboard-keys) to your keymap.
|
|
||||||
|
|
||||||
#### Enable Mousekeys
|
To enable mouse keys, add the following line to your keymap’s `rules.mk`:
|
||||||
|
|
||||||
To enable the mousekey functionality, add the following line to your keymap's `rules.mk`:
|
```c
|
||||||
|
|
||||||
```
|
|
||||||
MOUSEKEY_ENABLE = yes
|
MOUSEKEY_ENABLE = yes
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Mapping Mouse Actions to Keyboard Keys
|
### Mapping mouse actions
|
||||||
|
|
||||||
You can use these keycodes within your keymap to map button presses to mouse actions:
|
In your keymap you can use the following keycodes to map key presses to mouse actions:
|
||||||
|
|
||||||
|Key |Aliases |Description |
|
|Key |Aliases |Description |
|
||||||
|----------------|---------|-----------------------------------|
|
|----------------|---------|-----------------|
|
||||||
|`KC_MS_UP` |`KC_MS_U`|Mouse Cursor Up |
|
|`KC_MS_UP` |`KC_MS_U`|Move cursor up |
|
||||||
|`KC_MS_DOWN` |`KC_MS_D`|Mouse Cursor Down |
|
|`KC_MS_DOWN` |`KC_MS_D`|Move cursor down |
|
||||||
|`KC_MS_LEFT` |`KC_MS_L`|Mouse Cursor Left |
|
|`KC_MS_LEFT` |`KC_MS_L`|Move cursor left |
|
||||||
|`KC_MS_RIGHT` |`KC_MS_R`|Mouse Cursor Right |
|
|`KC_MS_RIGHT` |`KC_MS_R`|Move cursor right|
|
||||||
|`KC_MS_BTN1` |`KC_BTN1`|Mouse Button 1 |
|
|`KC_MS_BTN1` |`KC_BTN1`|Press button 1 |
|
||||||
|`KC_MS_BTN2` |`KC_BTN2`|Mouse Button 2 |
|
|`KC_MS_BTN2` |`KC_BTN2`|Press button 2 |
|
||||||
|`KC_MS_BTN3` |`KC_BTN3`|Mouse Button 3 |
|
|`KC_MS_BTN3` |`KC_BTN3`|Press button 3 |
|
||||||
|`KC_MS_BTN4` |`KC_BTN4`|Mouse Button 4 |
|
|`KC_MS_BTN4` |`KC_BTN4`|Press button 4 |
|
||||||
|`KC_MS_BTN5` |`KC_BTN5`|Mouse Button 5 |
|
|`KC_MS_BTN5` |`KC_BTN5`|Press button 5 |
|
||||||
|`KC_MS_WH_UP` |`KC_WH_U`|Mouse Wheel Up |
|
|`KC_MS_WH_UP` |`KC_WH_U`|Move wheel up |
|
||||||
|`KC_MS_WH_DOWN` |`KC_WH_D`|Mouse Wheel Down |
|
|`KC_MS_WH_DOWN` |`KC_WH_D`|Move wheel down |
|
||||||
|`KC_MS_WH_LEFT` |`KC_WH_L`|Mouse Wheel Left |
|
|`KC_MS_WH_LEFT` |`KC_WH_L`|Move wheel left |
|
||||||
|`KC_MS_WH_RIGHT`|`KC_WH_R`|Mouse Wheel Right |
|
|`KC_MS_WH_RIGHT`|`KC_WH_R`|Move wheel right |
|
||||||
|`KC_MS_ACCEL0` |`KC_ACL0`|Set mouse acceleration to 0(slow) |
|
|`KC_MS_ACCEL0` |`KC_ACL0`|Set speed to 0 |
|
||||||
|`KC_MS_ACCEL1` |`KC_ACL1`|Set mouse acceleration to 1(medium)|
|
|`KC_MS_ACCEL1` |`KC_ACL1`|Set speed to 1 |
|
||||||
|`KC_MS_ACCEL2` |`KC_ACL2`|Set mouse acceleration to 2(fast) |
|
|`KC_MS_ACCEL2` |`KC_ACL2`|Set speed to 2 |
|
||||||
|
|
||||||
|
## Configuring mouse keys
|
||||||
|
|
||||||
## Configuring the Behavior of Mousekeys with auto-accelerated movement
|
Mouse keys supports two different modes to move the cursor:
|
||||||
|
|
||||||
This behavior is intended to emulate the X Window System MouseKeysAccel feature. You can read more about it [on Wikipedia](https://en.wikipedia.org/wiki/Mouse_keys).
|
* **Accelerated (default):** Holding movement keys accelerates the cursor until it reaches its maximum speed.
|
||||||
|
* **Constant:** Holding movement keys moves the cursor at constant speeds.
|
||||||
|
|
||||||
The default speed for controlling the mouse with the keyboard is intentionally slow. You can adjust these parameters by adding these settings to your keymap's `config.h` file. All times are specified in milliseconds (ms).
|
The same principle applies to scrolling.
|
||||||
|
|
||||||
```
|
Configuration options that are times, intervals or delays are given in milliseconds. Scroll speed is given as multiples of the default scroll step. For example, a scroll speed of 8 means that each scroll action covers 8 times the length of the default scroll step as defined by your operating system or application.
|
||||||
#define MOUSEKEY_DELAY 300
|
|
||||||
#define MOUSEKEY_INTERVAL 50
|
|
||||||
#define MOUSEKEY_MAX_SPEED 10
|
|
||||||
#define MOUSEKEY_TIME_TO_MAX 20
|
|
||||||
#define MOUSEKEY_WHEEL_MAX_SPEED 8
|
|
||||||
#define MOUSEKEY_WHEEL_TIME_TO_MAX 40
|
|
||||||
```
|
|
||||||
|
|
||||||
#### `MOUSEKEY_DELAY`
|
### Accelerated mode
|
||||||
|
|
||||||
When one of the mouse movement buttons is pressed this setting is used to define the delay between that button press and the mouse cursor moving. Some people find that small movements are impossible if this setting is too low, while settings that are too high feel sluggish.
|
This is the default mode. You can adjust the cursor and scrolling acceleration using the following settings in your keymap’s `config.h` file:
|
||||||
|
|
||||||
#### `MOUSEKEY_INTERVAL`
|
|Define |Default|Description |
|
||||||
|
|----------------------------|-------|---------------------------------------------------------|
|
||||||
|
|`MOUSEKEY_DELAY` |300 |Delay between pressing a movement key and cursor movement|
|
||||||
|
|`MOUSEKEY_INTERVAL` |50 |Time between cursor movements |
|
||||||
|
|`MOUSEKEY_MAX_SPEED` |10 |Maximum cursor speed at which acceleration stops |
|
||||||
|
|`MOUSEKEY_TIME_TO_MAX` |20 |Time until maximum cursor speed is reached |
|
||||||
|
|`MOUSEKEY_WHEEL_MAX_SPEED` |8 |Maximum number of scroll steps per scroll action |
|
||||||
|
|`MOUSEKEY_WHEEL_TIME_TO_MAX`|40 |Time until maximum scroll speed is reached |
|
||||||
|
|
||||||
When a movement key is held down this specifies how long to wait between each movement report. Lower settings will translate into an effectively higher mouse speed.
|
Tips:
|
||||||
|
|
||||||
#### `MOUSEKEY_MAX_SPEED`
|
* Setting `MOUSEKEY_DELAY` too low makes the cursor unresponsive. Setting it too high makes small movements difficult.
|
||||||
|
* For smoother cursor movements, lower the value of `MOUSEKEY_INTERVAL`. If the refresh rate of your display is 60Hz, you could set it to `16` (1/60). As this raises the cursor speed significantly, you may want to lower `MOUSEKEY_MAX_SPEED`.
|
||||||
|
* Setting `MOUSEKEY_TIME_TO_MAX` or `MOUSEKEY_WHEEL_TIME_TO_MAX` to `0` will disable acceleration for the cursor or scrolling respectively. This way you can make one of them constant while keeping the other accelerated, which is not possible in constant speed mode.
|
||||||
|
|
||||||
As a movement key is held down the speed of the mouse cursor will increase until it reaches `MOUSEKEY_MAX_SPEED`.
|
Cursor acceleration uses the same algorithm as the X Window System MouseKeysAccel feature. You can read more about it [on Wikipedia](https://en.wikipedia.org/wiki/Mouse_keys).
|
||||||
|
|
||||||
#### `MOUSEKEY_TIME_TO_MAX`
|
### Constant mode
|
||||||
|
|
||||||
How long you want to hold down a movement key for until `MOUSEKEY_MAX_SPEED` is reached. This controls how quickly your cursor will accelerate.
|
In this mode you can define multiple different speeds for both the cursor and the mouse wheel. There is no acceleration. `KC_ACL0`, `KC_ACL1` and `KC_ACL2` change the cursor and scroll speed to their respective setting.
|
||||||
|
|
||||||
#### `MOUSEKEY_WHEEL_MAX_SPEED`
|
You can choose whether speed selection is momentary or tap-to-select:
|
||||||
|
|
||||||
The top speed for scrolling movements.
|
* **Momentary:** The chosen speed is only active while you hold the respective key. When the key is raised, mouse keys returns to the unmodified speed.
|
||||||
|
* **Tap-to-select:** The chosen speed is activated when you press the respective key and remains active even after the key has been raised. The default speed is that of `KC_ACL1`. There is no unmodified speed.
|
||||||
|
|
||||||
#### `MOUSEKEY_WHEEL_TIME_TO_MAX`
|
The default speeds from slowest to fastest are as follows:
|
||||||
|
|
||||||
How long you want to hold down a scroll key for until `MOUSEKEY_WHEEL_MAX_SPEED` is reached. This controls how quickly your scrolling will accelerate.
|
* **Momentary:** `KC_ACL0` < `KC_ACL1` < *unmodified* < `KC_ACL2`
|
||||||
|
* **Tap-to-select:** `KC_ACL0` < `KC_ACL1` < `KC_ACL2`
|
||||||
|
|
||||||
|
To use constant speed mode, you must at least define `MK_3_SPEED` in your keymap’s `config.h` file:
|
||||||
|
|
||||||
## Configuring the Behavior of Mousekeys with 3-speed constant movement
|
```c
|
||||||
|
|
||||||
In your keymap's `config.h`, you must add the line:
|
|
||||||
```
|
|
||||||
#define MK_3_SPEED
|
#define MK_3_SPEED
|
||||||
```
|
```
|
||||||
Then you can precisely define 3 different speeds for both the cursor and the mouse wheel, and also whether speed selection is momentary or tap-to-select.
|
|
||||||
For each speed, you can specify how many milliseconds you want between reports(interval), and how far you want to it to move per report(offset).
|
|
||||||
|
|
||||||
For example:
|
To enable momentary mode, also define `MK_MOMENTARY_ACCEL`:
|
||||||
|
|
||||||
```
|
```c
|
||||||
#define MK_3_SPEED
|
#define MK_MOMENTARY_ACCEL
|
||||||
#define MK_MOMENTARY_ACCEL // comment this out for tap-to-select acceleration
|
|
||||||
// cursor speeds:
|
|
||||||
#define MK_C_OFFSET_SLOW 1 // pixels
|
|
||||||
#define MK_C_INTERVAL_SLOW 100 // milliseconds
|
|
||||||
#define MK_C_OFFSET_MED 4
|
|
||||||
#define MK_C_INTERVAL_MED 16
|
|
||||||
#define MK_C_OFFSET_FAST 12
|
|
||||||
#define MK_C_INTERVAL_FAST 16
|
|
||||||
// scroll wheel speeds:
|
|
||||||
#define MK_W_OFFSET_SLOW 1 // wheel clicks
|
|
||||||
#define MK_W_INTERVAL_SLOW 400 // milliseconds
|
|
||||||
#define MK_W_OFFSET_MED 1
|
|
||||||
#define MK_W_INTERVAL_MED 200
|
|
||||||
#define MK_W_OFFSET_FAST 1
|
|
||||||
#define MK_W_INTERVAL_FAST 100
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Medium values will be used as the default or unmodified speed.
|
Use the following settings if you want to adjust cursor movement or scrolling:
|
||||||
The speed at which both the cursor and scrolling move can be selected with KC_ACL0, KC_ACL1, KC_ACL2 for slow, medium, and fast. However, if you leave MK_MOMENTARY_ACCEL defined then there is no need to ever send KC_ACL1, since that will be the unmodified speed.
|
|
||||||
|
|Define |Default |Description |
|
||||||
|
|---------------------|-------------|-------------------------------------------|
|
||||||
|
|`MK_3_SPEED` |*Not defined*|Enable constant cursor speeds |
|
||||||
|
|`MK_MOMENTARY_ACCEL` |*Not defined*|Enable momentary speed selection |
|
||||||
|
|`MK_C_OFFSET_UNMOD` |16 |Cursor offset per movement (unmodified) |
|
||||||
|
|`MK_C_INTERVAL_UNMOD`|16 |Time between cursor movements (unmodified) |
|
||||||
|
|`MK_C_OFFSET_0` |1 |Cursor offset per movement (`KC_ACL0`) |
|
||||||
|
|`MK_C_INTERVAL_0` |32 |Time between cursor movements (`KC_ACL0`) |
|
||||||
|
|`MK_C_OFFSET_1` |4 |Cursor offset per movement (`KC_ACL1`) |
|
||||||
|
|`MK_C_INTERVAL_1` |16 |Time between cursor movements (`KC_ACL1`) |
|
||||||
|
|`MK_C_OFFSET_2` |32 |Cursor offset per movement (`KC_ACL2`) |
|
||||||
|
|`MK_C_INTERVAL_2` |16 |Time between cursor movements (`KC_ACL2`) |
|
||||||
|
|`MK_W_OFFSET_UNMOD` |1 |Scroll steps per scroll action (unmodified)|
|
||||||
|
|`MK_W_INTERVAL_UNMOD`|40 |Time between scroll steps (unmodified) |
|
||||||
|
|`MK_W_OFFSET_0` |1 |Scroll steps per scroll action (`KC_ACL0`) |
|
||||||
|
|`MK_W_INTERVAL_0` |360 |Time between scroll steps (`KC_ACL0`) |
|
||||||
|
|`MK_W_OFFSET_1` |1 |Scroll steps per scroll action (`KC_ACL1`) |
|
||||||
|
|`MK_W_INTERVAL_1` |120 |Time between scroll steps (`KC_ACL1`) |
|
||||||
|
|`MK_W_OFFSET_2` |1 |Scroll steps per scroll action (`KC_ACL2`) |
|
||||||
|
|`MK_W_INTERVAL_2` |20 |Time between scroll steps (`KC_ACL2`) |
|
||||||
@@ -0,0 +1,274 @@
|
|||||||
|
# OLED Driver
|
||||||
|
|
||||||
|
## OLED Supported Hardware
|
||||||
|
|
||||||
|
128x32 OLED modules using SSD1306 driver IC over I2C. Supported on AVR based keyboards. Possible but untested hardware includes ARM based keyboards and other sized OLED modules using SSD1306 over I2C, such as 128x64.
|
||||||
|
|
||||||
|
!> Warning: This OLED Driver currently uses the new i2c_master driver from split common code. If your split keyboard uses i2c to communication between sides this driver could cause an address conflict (serial is fine). Please contact your keyboard vendor and ask them to migrate to the latest split common code to fix this.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
To enable the OLED feature, there are three steps. First, when compiling your keyboard, you'll need to set `OLED_DRIVER_ENABLE=yes` in `rules.mk`, e.g.:
|
||||||
|
|
||||||
|
```
|
||||||
|
OLED_DRIVER_ENABLE = yes
|
||||||
|
```
|
||||||
|
|
||||||
|
This enables the feature and the `OLED_DRIVER_ENABLE` define. Then in your `keymap.c` file, you will need to implement the user task call, e.g:
|
||||||
|
|
||||||
|
```C++
|
||||||
|
#ifdef OLED_DRIVER_ENABLE
|
||||||
|
void oled_task_user(void) {
|
||||||
|
// Host Keyboard Layer Status
|
||||||
|
oled_write_P(PSTR("Layer: "), false);
|
||||||
|
switch (biton32(layer_state)) {
|
||||||
|
case _QWERTY:
|
||||||
|
oled_write_P(PSTR("Default\n"), false);
|
||||||
|
break;
|
||||||
|
case _FN:
|
||||||
|
oled_write_P(PSTR("FN\n"), false);
|
||||||
|
break;
|
||||||
|
case _ADJ:
|
||||||
|
oled_write_P(PSTR("ADJ\n"), false);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
// Or use the write_ln shortcut over adding '\n' to the end of your string
|
||||||
|
oled_write_ln_P(PSTR("Undefined"), false);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Host Keyboard LED Status
|
||||||
|
uint8_t led_usb_state = host_keyboard_leds();
|
||||||
|
oled_write_P(led_usb_state & (1<<USB_LED_NUM_LOCK) ? PSTR("NUMLCK ") : PSTR(" "), false);
|
||||||
|
oled_write_P(led_usb_state & (1<<USB_LED_CAPS_LOCK) ? PSTR("CAPLCK ") : PSTR(" "), false);
|
||||||
|
oled_write_P(led_usb_state & (1<<USB_LED_SCROLL_LOCK) ? PSTR("SCRLCK ") : PSTR(" "), false);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
```
|
||||||
|
|
||||||
|
## Logo Example
|
||||||
|
|
||||||
|
In the default font, ranges in the font file are reserved for a QMK Logo. To Render this logo to the oled screen, use the following code example:
|
||||||
|
|
||||||
|
```C++
|
||||||
|
static void render_logo(void) {
|
||||||
|
static const char PROGMEM qmk_logo[] = {
|
||||||
|
0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94,
|
||||||
|
0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4,
|
||||||
|
0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4,0};
|
||||||
|
|
||||||
|
oled_write_P(qmk_logo, false);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Other Examples
|
||||||
|
|
||||||
|
In split keyboards, it is very common to have two OLED displays that each render different content and oriented flipped differently. You can do this by switching which content to render by using the return from `is_keyboard_master()` or `is_keyboard_left()` found in `split_util.h`, e.g:
|
||||||
|
|
||||||
|
```C++
|
||||||
|
#ifdef OLED_DRIVER_ENABLE
|
||||||
|
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
||||||
|
if (!is_keyboard_master())
|
||||||
|
return OLED_ROTATION_180; // flips the display 180 degrees if offhand
|
||||||
|
return rotation;
|
||||||
|
}
|
||||||
|
|
||||||
|
void oled_task_user(void) {
|
||||||
|
if (is_keyboard_master()) {
|
||||||
|
render_status(); // Renders the current keyboard state (layer, lock, caps, scroll, etc)
|
||||||
|
} else {
|
||||||
|
render_logo(); // Renders a statuc logo
|
||||||
|
oled_scroll_left(); // Turns on scrolling
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
## Basic Configuration
|
||||||
|
|
||||||
|
|Define |Default |Description |
|
||||||
|
|-----------------------|---------------|------------------------------------------------|
|
||||||
|
|`OLED_DISPLAY_ADDRESS` |`0x3C` |The i2c address of the OLED Display |
|
||||||
|
|`OLED_FONT_H` |`"glcdfont.c"` |The font code file to use for custom fonts |
|
||||||
|
|`OLED_FONT_START` |`0` |The starting characer index for custom fonts |
|
||||||
|
|`OLED_FONT_END` |`224` |The ending characer index for custom fonts |
|
||||||
|
|`OLED_FONT_WIDTH` |`6` |The font width |
|
||||||
|
|`OLED_FONT_HEIGHT` |`8` |The font height (untested) |
|
||||||
|
|`OLED_DISABLE_TIMEOUT` |*Not defined* |Disables the built in OLED timeout feature. Useful when implementing custom timeout rules.|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## 128x64 & Custom sized OLED Displays
|
||||||
|
|
||||||
|
The default display size for this feature is 128x32 and all necessary defines are precalculated with that in mind. We have added a define, `OLED_DISPLAY_128X64`, to switch all the values to be used in a 128x64 display, as well as added a custom define, `OLED_DISPLAY_CUSTOM`, that allows you to provide the necessary values to the driver.
|
||||||
|
|
||||||
|
|Define |Default |Description |
|
||||||
|
|-----------------------|---------------|-----------------------------------------------------------------|
|
||||||
|
|`OLED_DISPLAY_128X64` |*Not defined* |Changes the display defines for use with 128x64 displays. |
|
||||||
|
|`OLED_DISPLAY_CUSTOM` |*Not defined* |Changes the display defines for use with custom displays.<br />Requires user to implement the below defines. |
|
||||||
|
|`OLED_DISPLAY_WIDTH` |`128` |The width of the OLED display. |
|
||||||
|
|`OLED_DISPLAY_HEIGHT` |`32` |The height of the OLED display. |
|
||||||
|
|`OLED_MATRIX_SIZE` |`512` |The local buffer size to allocate.<br />`(OLED_DISPLAY_HEIGHT / 8 * OLED_DISPLAY_WIDTH)`|
|
||||||
|
|`OLED_BLOCK_TYPE` |`uint16_t` |The unsigned integer type to use for dirty rendering.|
|
||||||
|
|`OLED_BLOCK_COUNT` |`16` |The number of blocks the display is divided into for dirty rendering.<br />`(sizeof(OLED_BLOCK_TYPE) * 8)`|
|
||||||
|
|`OLED_BLOCK_SIZE` |`32` |The size of each block for dirty rendering<br />`(OLED_MATRIX_SIZE / OLED_BLOCK_COUNT)`|
|
||||||
|
|`OLED_SOURCE_MAP` |`{ 0, ... N }` |Precalculated source array to use for mapping source buffer to target OLED memory in 90 degree rendering. |
|
||||||
|
|`OLED_TARGET_MAP` |`{ 24, ... N }`|Precalculated target array to use for mapping source buffer to target OLED memory in 90 degree rendering. |
|
||||||
|
|
||||||
|
|
||||||
|
### 90 Degree Rotation - Technical Mumbo Jumbo
|
||||||
|
|
||||||
|
```C
|
||||||
|
// OLED Rotation enum values are flags
|
||||||
|
typedef enum {
|
||||||
|
OLED_ROTATION_0 = 0,
|
||||||
|
OLED_ROTATION_90 = 1,
|
||||||
|
OLED_ROTATION_180 = 2,
|
||||||
|
OLED_ROTATION_270 = 3, // OLED_ROTATION_90 | OLED_ROTATION_180
|
||||||
|
} oled_rotation_t;
|
||||||
|
```
|
||||||
|
|
||||||
|
OLED displays driven by SSD1306 drivers only natively support in hard ware 0 degree and 180 degree rendering. This feature is done in software and not free. Using this feature will increase the time to calculate what data to send over i2c to the OLED. If you are strapped for cycles, this can cause keycodes to not register. In testing however, the rendering time on an `atmega32u4` board only went from 2ms to 5ms and keycodes not registering was only noticed once we hit 15ms.
|
||||||
|
|
||||||
|
90 Degree Rotated Rendering is achieved by using bitwise operations to rotate each 8 block of memory and uses two precalculated arrays to remap buffer memory to OLED memory. The memory map defines are precalculated for remap performance and are calculated based on the OLED Height, Width, and Block Size. For example, in the 128x32 implementation with a `uint8_t` block type, we have a 64 byte block size. This gives us eight 8 byte blocks that need to be rotated and rendered. The OLED renders horizontally two 8 byte blocks before moving down a page, e.g:
|
||||||
|
|
||||||
|
| | | | | | |
|
||||||
|
|---|---|---|---|---|---|
|
||||||
|
| 0 | 1 | | | | |
|
||||||
|
| 2 | 3 | | | | |
|
||||||
|
| 4 | 5 | | | | |
|
||||||
|
| 6 | 7 | | | | |
|
||||||
|
|
||||||
|
However the local buffer is stored as if it was Height x Width display instead of Width x Height, e.g:
|
||||||
|
|
||||||
|
| | | | | | |
|
||||||
|
|---|---|---|---|---|---|
|
||||||
|
| 3 | 7 | | | | |
|
||||||
|
| 2 | 6 | | | | |
|
||||||
|
| 1 | 5 | | | | |
|
||||||
|
| 0 | 4 | | | | |
|
||||||
|
|
||||||
|
So those precalculated arrays just index the memory offsets in the order in which each one iterates its data.
|
||||||
|
|
||||||
|
## OLED API
|
||||||
|
|
||||||
|
```C++
|
||||||
|
// OLED Rotation enum values are flags
|
||||||
|
typedef enum {
|
||||||
|
OLED_ROTATION_0 = 0,
|
||||||
|
OLED_ROTATION_90 = 1,
|
||||||
|
OLED_ROTATION_180 = 2,
|
||||||
|
OLED_ROTATION_270 = 3, // OLED_ROTATION_90 | OLED_ROTATION_180
|
||||||
|
} oled_rotation_t;
|
||||||
|
|
||||||
|
// Initialize the OLED display, rotating the rendered output based on the define passed in.
|
||||||
|
// Returns true if the OLED was initialized successfully
|
||||||
|
bool oled_init(oled_rotation_t rotation);
|
||||||
|
|
||||||
|
// Called at the start of oled_init, weak function overridable by the user
|
||||||
|
// rotation - the value passed into oled_init
|
||||||
|
// Return new oled_rotation_t if you want to override default rotation
|
||||||
|
oled_rotation_t oled_init_user(oled_rotation_t rotation);
|
||||||
|
|
||||||
|
// Clears the display buffer, resets cursor position to 0, and sets the buffer to dirty for rendering
|
||||||
|
void oled_clear(void);
|
||||||
|
|
||||||
|
// Renders the dirty chunks of the buffer to OLED display
|
||||||
|
void oled_render(void);
|
||||||
|
|
||||||
|
// Moves cursor to character position indicated by column and line, wraps if out of bounds
|
||||||
|
// Max column denoted by 'oled_max_chars()' and max lines by 'oled_max_lines()' functions
|
||||||
|
void oled_set_cursor(uint8_t col, uint8_t line);
|
||||||
|
|
||||||
|
// Advances the cursor to the next page, writing ' ' if true
|
||||||
|
// Wraps to the begining when out of bounds
|
||||||
|
void oled_advance_page(bool clearPageRemainder);
|
||||||
|
|
||||||
|
// Moves the cursor forward 1 character length
|
||||||
|
// Advance page if there is not enough room for the next character
|
||||||
|
// Wraps to the begining when out of bounds
|
||||||
|
void oled_advance_char(void);
|
||||||
|
|
||||||
|
// Writes a single character to the buffer at current cursor position
|
||||||
|
// Advances the cursor while writing, inverts the pixels if true
|
||||||
|
// Main handler that writes character data to the display buffer
|
||||||
|
void oled_write_char(const char data, bool invert);
|
||||||
|
|
||||||
|
// Writes a string to the buffer at current cursor position
|
||||||
|
// Advances the cursor while writing, inverts the pixels if true
|
||||||
|
void oled_write(const char *data, bool invert);
|
||||||
|
|
||||||
|
// Writes a string to the buffer at current cursor position
|
||||||
|
// Advances the cursor while writing, inverts the pixels if true
|
||||||
|
// Advances the cursor to the next page, wiring ' ' to the remainder of the current page
|
||||||
|
void oled_write_ln(const char *data, bool invert);
|
||||||
|
|
||||||
|
// Writes a PROGMEM string to the buffer at current cursor position
|
||||||
|
// Advances the cursor while writing, inverts the pixels if true
|
||||||
|
// Remapped to call 'void oled_write(const char *data, bool invert);' on ARM
|
||||||
|
void oled_write_P(const char *data, bool invert);
|
||||||
|
|
||||||
|
// Writes a PROGMEM string to the buffer at current cursor position
|
||||||
|
// Advances the cursor while writing, inverts the pixels if true
|
||||||
|
// Advances the cursor to the next page, wiring ' ' to the remainder of the current page
|
||||||
|
// Remapped to call 'void oled_write_ln(const char *data, bool invert);' on ARM
|
||||||
|
void oled_write_ln_P(const char *data, bool invert);
|
||||||
|
|
||||||
|
// Can be used to manually turn on the screen if it is off
|
||||||
|
// Returns true if the screen was on or turns on
|
||||||
|
bool oled_on(void);
|
||||||
|
|
||||||
|
// Can be used to manually turn off the screen if it is on
|
||||||
|
// Returns true if the screen was off or turns off
|
||||||
|
bool oled_off(void);
|
||||||
|
|
||||||
|
// Basically it's oled_render, but with timeout management and oled_task_user calling!
|
||||||
|
void oled_task(void);
|
||||||
|
|
||||||
|
// Called at the start of oled_task, weak function overridable by the user
|
||||||
|
void oled_task_user(void);
|
||||||
|
|
||||||
|
// Scrolls the entire display right
|
||||||
|
// Returns true if the screen was scrolling or starts scrolling
|
||||||
|
// NOTE: display contents cannot be changed while scrolling
|
||||||
|
bool oled_scroll_right(void);
|
||||||
|
|
||||||
|
// Scrolls the entire display left
|
||||||
|
// Returns true if the screen was scrolling or starts scrolling
|
||||||
|
// NOTE: display contents cannot be changed while scrolling
|
||||||
|
bool oled_scroll_left(void);
|
||||||
|
|
||||||
|
// Turns off display scrolling
|
||||||
|
// Returns true if the screen was not scrolling or stops scrolling
|
||||||
|
bool oled_scroll_off(void);
|
||||||
|
|
||||||
|
// Returns the maximum number of characters that will fit on a line
|
||||||
|
uint8_t oled_max_chars(void);
|
||||||
|
|
||||||
|
// Returns the maximum number of lines that will fit on the OLED
|
||||||
|
uint8_t oled_max_lines(void);
|
||||||
|
```
|
||||||
|
|
||||||
|
## SSD1306.h driver conversion guide
|
||||||
|
|
||||||
|
|Old API |Recommended New API |
|
||||||
|
|---------------------------|-----------------------------------|
|
||||||
|
|`struct CharacterMatrix` |*removed - delete all references* |
|
||||||
|
|`iota_gfx_init` |`oled_init` |
|
||||||
|
|`iota_gfx_on` |`oled_on` |
|
||||||
|
|`iota_gfx_off` |`oled_off` |
|
||||||
|
|`iota_gfx_flush` |`oled_render` |
|
||||||
|
|`iota_gfx_write_char` |`oled_write_char` |
|
||||||
|
|`iota_gfx_write` |`oled_write` |
|
||||||
|
|`iota_gfx_write_P` |`oled_write_P` |
|
||||||
|
|`iota_gfx_clear_screen` |`oled_clear` |
|
||||||
|
|`matrix_clear` |*removed - delete all references* |
|
||||||
|
|`matrix_write_char_inner` |`oled_write_char` |
|
||||||
|
|`matrix_write_char` |`oled_write_char` |
|
||||||
|
|`matrix_write` |`oled_write` |
|
||||||
|
|`matrix_write_ln` |`oled_write_ln` |
|
||||||
|
|`matrix_write_P` |`oled_write_P` |
|
||||||
|
|`matrix_write_ln_P` |`oled_write_ln_P` |
|
||||||
|
|`matrix_render` |`oled_render` |
|
||||||
|
|`iota_gfx_task` |`oled_task` |
|
||||||
|
|`iota_gfx_task_user` |`oled_task_user` |
|
||||||
+119
-35
@@ -124,7 +124,7 @@ 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 struct rgb_led array tells the system for each led, what key electrical matrix it represents, what the physical position is on the board, and if the led is for a modifier key or not. Here is a brief example:
|
||||||
|
|
||||||
```C
|
```C
|
||||||
const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
|
const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
|
||||||
@@ -138,14 +138,14 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
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, `{row | col << 4}`, tells the system what key this LED represents by using the key's electrical matrix row & col. The second part, `{x=0..224, y=0..64}` represents the LED's physical position on the keyboard. The `x` is between (inclusive) 0-224, and `y` is between (inclusive) 0-64 as the effects are based on this range. 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).
|
`modifier` is a boolean, whether or not a certain key is considered a modifier (used in some effects).
|
||||||
|
|
||||||
@@ -177,7 +177,7 @@ enum rgb_matrix_effects {
|
|||||||
RGB_MATRIX_GRADIENT_UP_DOWN, // Static gradient top to bottom, speed controls how much gradient changes
|
RGB_MATRIX_GRADIENT_UP_DOWN, // Static gradient top to bottom, speed controls how much gradient changes
|
||||||
RGB_MATRIX_BREATHING, // Single hue brightness cycling animation
|
RGB_MATRIX_BREATHING, // Single hue brightness cycling animation
|
||||||
RGB_MATRIX_CYCLE_ALL, // Full keyboard solid hue cycling through full gradient
|
RGB_MATRIX_CYCLE_ALL, // Full keyboard solid hue cycling through full gradient
|
||||||
RGB_MATRIX_CYCLE_LEFT_RIGHT, // Full gradient scrolling left to right
|
RGB_MATRIX_CYCLE_LEFT_RIGHT, // Full gradient scrolling left to right
|
||||||
RGB_MATRIX_CYCLE_UP_DOWN, // Full gradient scrolling top to bottom
|
RGB_MATRIX_CYCLE_UP_DOWN, // Full gradient scrolling top to bottom
|
||||||
RGB_MATRIX_RAINBOW_MOVING_CHEVRON, // Full gradent Chevron shapped scrolling left to right
|
RGB_MATRIX_RAINBOW_MOVING_CHEVRON, // Full gradent Chevron shapped scrolling left to right
|
||||||
RGB_MATRIX_DUAL_BEACON, // Full gradient spinning around center of keyboard
|
RGB_MATRIX_DUAL_BEACON, // Full gradient spinning around center of keyboard
|
||||||
@@ -189,6 +189,12 @@ enum rgb_matrix_effects {
|
|||||||
#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
|
||||||
@@ -197,44 +203,122 @@ enum rgb_matrix_effects {
|
|||||||
RGB_MATRIX_EFFECT_MAX
|
RGB_MATRIX_EFFECT_MAX
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
You can disable a single effect by defining `DISABLE_[EFFECT_NAME]` in your `config.h`:
|
You can disable a single effect by defining `DISABLE_[EFFECT_NAME]` in your `config.h`:
|
||||||
|
|
||||||
|
|
||||||
|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` |
|
||||||
|`#define DISABLE_RGB_MATRIX_CYCLE_ALL` |Disables `RGB_MATRIX_CYCLE_ALL` |
|
|`#define DISABLE_RGB_MATRIX_CYCLE_ALL` |Disables `RGB_MATRIX_CYCLE_ALL` |
|
||||||
|`#define DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT` |Disables `RGB_MATRIX_CYCLE_LEFT_RIGHT` |
|
|`#define DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT` |Disables `RGB_MATRIX_CYCLE_LEFT_RIGHT` |
|
||||||
|`#define DISABLE_RGB_MATRIX_CYCLE_UP_DOWN` |Disables `RGB_MATRIX_CYCLE_UP_DOWN` |
|
|`#define DISABLE_RGB_MATRIX_CYCLE_UP_DOWN` |Disables `RGB_MATRIX_CYCLE_UP_DOWN` |
|
||||||
|`#define DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON`|Disables `RGB_MATRIX_RAINBOW_MOVING_CHEVRON`|
|
|`#define DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON` |Disables `RGB_MATRIX_RAINBOW_MOVING_CHEVRON` |
|
||||||
|`#define DISABLE_RGB_MATRIX_DUAL_BEACON` |Disables `RGB_MATRIX_DUAL_BEACON` |
|
|`#define DISABLE_RGB_MATRIX_DUAL_BEACON` |Disables `RGB_MATRIX_DUAL_BEACON` |
|
||||||
|`#define DISABLE_RGB_MATRIX_RAINBOW_BEACON` |Disables `RGB_MATRIX_RAINBOW_BEACON` |
|
|`#define DISABLE_RGB_MATRIX_RAINBOW_BEACON` |Disables `RGB_MATRIX_RAINBOW_BEACON` |
|
||||||
|`#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_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_SPLASH` |Disables `RGB_MATRIX_SPLASH` |
|
|`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE` |Disables `RGB_MATRIX_SOLID_REACTIVE_WIDE` |
|
||||||
|`#define DISABLE_RGB_MATRIX_MULTISPLASH` |Disables `RGB_MATRIX_MULTISPLASH` |
|
|`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE` |Disables `RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE` |
|
||||||
|`#define DISABLE_RGB_MATRIX_SOLID_SPLASH` |Disables `RGB_MATRIX_SOLID_SPLASH` |
|
|`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS` |Disables `RGB_MATRIX_SOLID_REACTIVE_CROSS` |
|
||||||
|`#define DISABLE_RGB_MATRIX_SOLID_MULTISPLASH` |Disables `RGB_MATRIX_SOLID_MULTISPLASH` |
|
|`#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_MULTISPLASH` |Disables `RGB_MATRIX_MULTISPLASH` |
|
||||||
|
|`#define DISABLE_RGB_MATRIX_SOLID_SPLASH` |Disables `RGB_MATRIX_SOLID_SPLASH` |
|
||||||
|
|`#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
|
||||||
|
|
||||||
@@ -253,10 +337,10 @@ A similar function works in the keymap as `rgb_matrix_indicators_user`.
|
|||||||
The EEPROM for it is currently shared with the RGBLIGHT system (it's generally assumed only one RGB would be used at a time), but could be configured to use its own 32bit address with:
|
The EEPROM for it is currently shared with the RGBLIGHT system (it's generally assumed only one RGB would be used at a time), but could be configured to use its own 32bit address with:
|
||||||
|
|
||||||
```C
|
```C
|
||||||
#define EECONFIG_RGB_MATRIX (uint32_t *)16
|
#define EECONFIG_RGB_MATRIX (uint32_t *)28
|
||||||
```
|
```
|
||||||
|
|
||||||
Where `16` is an unused index from `eeconfig.h`.
|
Where `28` is an unused index from `eeconfig.h`.
|
||||||
|
|
||||||
## Suspended state
|
## Suspended state
|
||||||
|
|
||||||
|
|||||||
@@ -75,6 +75,7 @@ Your RGB lighting can be configured by placing these `#define`s in your `config.
|
|||||||
|`RGBLIGHT_VAL_STEP` |`17` |The number of steps to increment the brightness by |
|
|`RGBLIGHT_VAL_STEP` |`17` |The number of steps to increment the brightness by |
|
||||||
|`RGBLIGHT_LIMIT_VAL` |`255` |The maximum brightness level |
|
|`RGBLIGHT_LIMIT_VAL` |`255` |The maximum brightness level |
|
||||||
|`RGBLIGHT_SLEEP` |*Not defined*|If defined, the RGB lighting will be switched off when the host goes to sleep|
|
|`RGBLIGHT_SLEEP` |*Not defined*|If defined, the RGB lighting will be switched off when the host goes to sleep|
|
||||||
|
|`RGBLIGHT_SPLIT` |*Not defined*|If defined, synchronization functionality for split keyboards is added|
|
||||||
|
|
||||||
## Animations
|
## Animations
|
||||||
|
|
||||||
@@ -190,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
|
||||||
|
|
||||||
|
|||||||
+7
-5
@@ -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)
|
||||||
+19
-7
@@ -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.
|
||||||
|
|||||||
@@ -14,9 +14,9 @@ QMK is used on a lot of different hardware. While support for the most common MC
|
|||||||
|
|
||||||
Support for addressing pins on the ProMicro by their Arduino name rather than their AVR name. This needs to be better documented, if you are trying to do this and reading the code doesn't help please [open an issue](https://github.com/qmk/qmk_firmware/issues/new) and we can help you through the process.
|
Support for addressing pins on the ProMicro by their Arduino name rather than their AVR name. This needs to be better documented, if you are trying to do this and reading the code doesn't help please [open an issue](https://github.com/qmk/qmk_firmware/issues/new) and we can help you through the process.
|
||||||
|
|
||||||
## SSD1306 (AVR Only)
|
## SSD1306 OLED Driver
|
||||||
|
|
||||||
Support for SSD1306 based OLED displays. This needs to be better documented, if you are trying to do this and reading the code doesn't help please [open an issue](https://github.com/qmk/qmk_firmware/issues/new) and we can help you through the process.
|
Support for SSD1306 based OLED displays. For more information see the [OLED Driver Feature](feature_oled_driver.md) page.
|
||||||
|
|
||||||
## uGFX
|
## uGFX
|
||||||
|
|
||||||
@@ -32,4 +32,4 @@ Support for up to 2 drivers. Each driver impliments 2 charlieplex matrices to in
|
|||||||
|
|
||||||
## IS31FL3733
|
## IS31FL3733
|
||||||
|
|
||||||
Support for up to a single driver with room for expansion. Each driver can control 192 individual LEDs or 64 RGB LEDs. For more information on how to setup the driver see the [RGB Matrix](feature_rgb_matrix.md) page.
|
Support for up to a single driver with room for expansion. Each driver can control 192 individual LEDs or 64 RGB LEDs. For more information on how to setup the driver see the [RGB Matrix](feature_rgb_matrix.md) page.
|
||||||
@@ -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`
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
# QMK机械键盘固件
|
||||||
|
|
||||||
|
[](https://github.com/qmk/qmk_firmware/tags)
|
||||||
|
[](https://travis-ci.org/qmk/qmk_firmware)
|
||||||
|
[](https://discord.gg/Uq7gcHh)
|
||||||
|
[](https://docs.qmk.fm)
|
||||||
|
[](https://github.com/qmk/qmk_firmware/pulse/monthly)
|
||||||
|
[](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克隆 (`[email protected]: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)来利用许多特性。
|
||||||
@@ -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)
|
||||||
+27
-13
@@ -42,6 +42,18 @@ static const I2CConfig i2cconfig = {
|
|||||||
0
|
0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static i2c_status_t chibios_to_qmk(const msg_t* status) {
|
||||||
|
switch (*status) {
|
||||||
|
case I2C_NO_ERROR:
|
||||||
|
return I2C_STATUS_SUCCESS;
|
||||||
|
case I2C_TIMEOUT:
|
||||||
|
return I2C_STATUS_TIMEOUT;
|
||||||
|
// I2C_BUS_ERROR, I2C_ARBITRATION_LOST, I2C_ACK_FAILURE, I2C_OVERRUN, I2C_PEC_ERROR, I2C_SMB_ALERT
|
||||||
|
default:
|
||||||
|
return I2C_STATUS_ERROR;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
__attribute__ ((weak))
|
__attribute__ ((weak))
|
||||||
void i2c_init(void)
|
void i2c_init(void)
|
||||||
{
|
{
|
||||||
@@ -57,29 +69,30 @@ void i2c_init(void)
|
|||||||
//i2cInit(); //This is invoked by halInit() so no need to redo it.
|
//i2cInit(); //This is invoked by halInit() so no need to redo it.
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is usually not needed
|
i2c_status_t i2c_start(uint8_t address)
|
||||||
uint8_t i2c_start(uint8_t address)
|
|
||||||
{
|
{
|
||||||
i2c_address = address;
|
i2c_address = address;
|
||||||
i2cStart(&I2C_DRIVER, &i2cconfig);
|
i2cStart(&I2C_DRIVER, &i2cconfig);
|
||||||
return 0;
|
return I2C_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t i2c_transmit(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout)
|
i2c_status_t i2c_transmit(uint8_t address, const uint8_t* data, uint16_t length, uint16_t timeout)
|
||||||
{
|
{
|
||||||
i2c_address = address;
|
i2c_address = address;
|
||||||
i2cStart(&I2C_DRIVER, &i2cconfig);
|
i2cStart(&I2C_DRIVER, &i2cconfig);
|
||||||
return 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));
|
||||||
|
return chibios_to_qmk(&status);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_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)
|
||||||
{
|
{
|
||||||
i2c_address = address;
|
i2c_address = address;
|
||||||
i2cStart(&I2C_DRIVER, &i2cconfig);
|
i2cStart(&I2C_DRIVER, &i2cconfig);
|
||||||
return 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);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, 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)
|
||||||
{
|
{
|
||||||
i2c_address = devaddr;
|
i2c_address = devaddr;
|
||||||
i2cStart(&I2C_DRIVER, &i2cconfig);
|
i2cStart(&I2C_DRIVER, &i2cconfig);
|
||||||
@@ -91,18 +104,19 @@ uint8_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t l
|
|||||||
}
|
}
|
||||||
complete_packet[0] = regaddr;
|
complete_packet[0] = regaddr;
|
||||||
|
|
||||||
return 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);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_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)
|
||||||
{
|
{
|
||||||
i2c_address = devaddr;
|
i2c_address = devaddr;
|
||||||
i2cStart(&I2C_DRIVER, &i2cconfig);
|
i2cStart(&I2C_DRIVER, &i2cconfig);
|
||||||
return 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);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t i2c_stop(void)
|
void i2c_stop(void)
|
||||||
{
|
{
|
||||||
i2cStop(&I2C_DRIVER);
|
i2cStop(&I2C_DRIVER);
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
@@ -40,11 +40,17 @@
|
|||||||
#define I2C_DRIVER I2CD1
|
#define I2C_DRIVER I2CD1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
typedef int16_t i2c_status_t;
|
||||||
|
|
||||||
|
#define I2C_STATUS_SUCCESS (0)
|
||||||
|
#define I2C_STATUS_ERROR (-1)
|
||||||
|
#define I2C_STATUS_TIMEOUT (-2)
|
||||||
|
|
||||||
void i2c_init(void);
|
void i2c_init(void);
|
||||||
uint8_t i2c_start(uint8_t address);
|
i2c_status_t i2c_start(uint8_t address);
|
||||||
uint8_t i2c_transmit(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout);
|
i2c_status_t i2c_transmit(uint8_t address, const uint8_t* data, uint16_t length, uint16_t timeout);
|
||||||
uint8_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);
|
||||||
uint8_t i2c_transmit_receive(uint8_t address, uint8_t * tx_body, uint16_t tx_length, uint8_t * rx_body, uint16_t rx_length);
|
i2c_status_t i2c_transmit_receive(uint8_t address, uint8_t * tx_body, uint16_t tx_length, uint8_t * rx_body, uint16_t rx_length);
|
||||||
uint8_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, 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);
|
||||||
uint8_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);
|
||||||
uint8_t i2c_stop(void);
|
void i2c_stop(void);
|
||||||
@@ -121,7 +121,7 @@ int16_t i2c_read_nack(uint16_t timeout) {
|
|||||||
return TWDR;
|
return TWDR;
|
||||||
}
|
}
|
||||||
|
|
||||||
i2c_status_t i2c_transmit(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout) {
|
i2c_status_t i2c_transmit(uint8_t address, const uint8_t* data, uint16_t length, uint16_t timeout) {
|
||||||
i2c_status_t status = i2c_start(address | I2C_WRITE, timeout);
|
i2c_status_t status = i2c_start(address | I2C_WRITE, timeout);
|
||||||
|
|
||||||
for (uint16_t i = 0; i < length && status >= 0; i++) {
|
for (uint16_t i = 0; i < length && status >= 0; i++) {
|
||||||
@@ -155,7 +155,7 @@ i2c_status_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16
|
|||||||
return (status < 0) ? status : I2C_STATUS_SUCCESS;
|
return (status < 0) ? status : I2C_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
i2c_status_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, 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) {
|
||||||
i2c_status_t status = i2c_start(devaddr | 0x00, timeout);
|
i2c_status_t status = i2c_start(devaddr | 0x00, timeout);
|
||||||
if (status >= 0) {
|
if (status >= 0) {
|
||||||
status = i2c_write(regaddr, timeout);
|
status = i2c_write(regaddr, timeout);
|
||||||
|
|||||||
@@ -22,10 +22,10 @@ i2c_status_t i2c_start(uint8_t address, uint16_t timeout);
|
|||||||
i2c_status_t i2c_write(uint8_t data, uint16_t timeout);
|
i2c_status_t i2c_write(uint8_t data, uint16_t timeout);
|
||||||
int16_t i2c_read_ack(uint16_t timeout);
|
int16_t i2c_read_ack(uint16_t timeout);
|
||||||
int16_t i2c_read_nack(uint16_t timeout);
|
int16_t i2c_read_nack(uint16_t timeout);
|
||||||
i2c_status_t i2c_transmit(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout);
|
i2c_status_t i2c_transmit(uint8_t address, const 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);
|
i2c_status_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout);
|
||||||
i2c_status_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, 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);
|
||||||
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);
|
||||||
void i2c_stop(void);
|
void i2c_stop(void);
|
||||||
|
|
||||||
#endif // I2C_MASTER_H
|
#endif // I2C_MASTER_H
|
||||||
@@ -0,0 +1,240 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifdef __AVR__
|
||||||
|
#include <avr/io.h>
|
||||||
|
#include <avr/pgmspace.h>
|
||||||
|
#elif defined(ESP8266)
|
||||||
|
#include <pgmspace.h>
|
||||||
|
#else
|
||||||
|
#define PROGMEM
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Helidox 8x6 font with QMK Firmware Logo
|
||||||
|
// Online editor: http://teripom.x0.com/
|
||||||
|
|
||||||
|
static const unsigned char font[] PROGMEM = {
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x3E, 0x5B, 0x4F, 0x5B, 0x3E, 0x00,
|
||||||
|
0x3E, 0x6B, 0x4F, 0x6B, 0x3E, 0x00,
|
||||||
|
0x1C, 0x3E, 0x7C, 0x3E, 0x1C, 0x00,
|
||||||
|
0x18, 0x3C, 0x7E, 0x3C, 0x18, 0x00,
|
||||||
|
0x1C, 0x57, 0x7D, 0x57, 0x1C, 0x00,
|
||||||
|
0x1C, 0x5E, 0x7F, 0x5E, 0x1C, 0x00,
|
||||||
|
0x00, 0x18, 0x3C, 0x18, 0x00, 0x00,
|
||||||
|
0xFF, 0xE7, 0xC3, 0xE7, 0xFF, 0x00,
|
||||||
|
0x00, 0x18, 0x24, 0x18, 0x00, 0x00,
|
||||||
|
0xFF, 0xE7, 0xDB, 0xE7, 0xFF, 0x00,
|
||||||
|
0x30, 0x48, 0x3A, 0x06, 0x0E, 0x00,
|
||||||
|
0x26, 0x29, 0x79, 0x29, 0x26, 0x00,
|
||||||
|
0x40, 0x7F, 0x05, 0x05, 0x07, 0x00,
|
||||||
|
0x40, 0x7F, 0x05, 0x25, 0x3F, 0x00,
|
||||||
|
0x5A, 0x3C, 0xE7, 0x3C, 0x5A, 0x00,
|
||||||
|
0x7F, 0x3E, 0x1C, 0x1C, 0x08, 0x00,
|
||||||
|
0x08, 0x1C, 0x1C, 0x3E, 0x7F, 0x00,
|
||||||
|
0x14, 0x22, 0x7F, 0x22, 0x14, 0x00,
|
||||||
|
0x5F, 0x5F, 0x00, 0x5F, 0x5F, 0x00,
|
||||||
|
0x06, 0x09, 0x7F, 0x01, 0x7F, 0x00,
|
||||||
|
0x00, 0x66, 0x89, 0x95, 0x6A, 0x00,
|
||||||
|
0x60, 0x60, 0x60, 0x60, 0x60, 0x00,
|
||||||
|
0x94, 0xA2, 0xFF, 0xA2, 0x94, 0x00,
|
||||||
|
0x08, 0x04, 0x7E, 0x04, 0x08, 0x00,
|
||||||
|
0x10, 0x20, 0x7E, 0x20, 0x10, 0x00,
|
||||||
|
0x08, 0x08, 0x2A, 0x1C, 0x08, 0x00,
|
||||||
|
0x08, 0x1C, 0x2A, 0x08, 0x08, 0x00,
|
||||||
|
0x1E, 0x10, 0x10, 0x10, 0x10, 0x00,
|
||||||
|
0x0C, 0x1E, 0x0C, 0x1E, 0x0C, 0x00,
|
||||||
|
0x30, 0x38, 0x3E, 0x38, 0x30, 0x00,
|
||||||
|
0x06, 0x0E, 0x3E, 0x0E, 0x06, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x5F, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x07, 0x00, 0x07, 0x00, 0x00,
|
||||||
|
0x14, 0x7F, 0x14, 0x7F, 0x14, 0x00,
|
||||||
|
0x24, 0x2A, 0x7F, 0x2A, 0x12, 0x00,
|
||||||
|
0x23, 0x13, 0x08, 0x64, 0x62, 0x00,
|
||||||
|
0x36, 0x49, 0x56, 0x20, 0x50, 0x00,
|
||||||
|
0x00, 0x08, 0x07, 0x03, 0x00, 0x00,
|
||||||
|
0x00, 0x1C, 0x22, 0x41, 0x00, 0x00,
|
||||||
|
0x00, 0x41, 0x22, 0x1C, 0x00, 0x00,
|
||||||
|
0x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x00,
|
||||||
|
0x08, 0x08, 0x3E, 0x08, 0x08, 0x00,
|
||||||
|
0x00, 0x80, 0x70, 0x30, 0x00, 0x00,
|
||||||
|
0x08, 0x08, 0x08, 0x08, 0x08, 0x00,
|
||||||
|
0x00, 0x00, 0x60, 0x60, 0x00, 0x00,
|
||||||
|
0x20, 0x10, 0x08, 0x04, 0x02, 0x00,
|
||||||
|
0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00,
|
||||||
|
0x00, 0x42, 0x7F, 0x40, 0x00, 0x00,
|
||||||
|
0x72, 0x49, 0x49, 0x49, 0x46, 0x00,
|
||||||
|
0x21, 0x41, 0x49, 0x4D, 0x33, 0x00,
|
||||||
|
0x18, 0x14, 0x12, 0x7F, 0x10, 0x00,
|
||||||
|
0x27, 0x45, 0x45, 0x45, 0x39, 0x00,
|
||||||
|
0x3C, 0x4A, 0x49, 0x49, 0x31, 0x00,
|
||||||
|
0x41, 0x21, 0x11, 0x09, 0x07, 0x00,
|
||||||
|
0x36, 0x49, 0x49, 0x49, 0x36, 0x00,
|
||||||
|
0x46, 0x49, 0x49, 0x29, 0x1E, 0x00,
|
||||||
|
0x00, 0x00, 0x14, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x40, 0x34, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x08, 0x14, 0x22, 0x41, 0x00,
|
||||||
|
0x14, 0x14, 0x14, 0x14, 0x14, 0x00,
|
||||||
|
0x00, 0x41, 0x22, 0x14, 0x08, 0x00,
|
||||||
|
0x02, 0x01, 0x59, 0x09, 0x06, 0x00,
|
||||||
|
0x3E, 0x41, 0x5D, 0x59, 0x4E, 0x00,
|
||||||
|
0x7C, 0x12, 0x11, 0x12, 0x7C, 0x00,
|
||||||
|
0x7F, 0x49, 0x49, 0x49, 0x36, 0x00,
|
||||||
|
0x3E, 0x41, 0x41, 0x41, 0x22, 0x00,
|
||||||
|
0x7F, 0x41, 0x41, 0x41, 0x3E, 0x00,
|
||||||
|
0x7F, 0x49, 0x49, 0x49, 0x41, 0x00,
|
||||||
|
0x7F, 0x09, 0x09, 0x09, 0x01, 0x00,
|
||||||
|
0x3E, 0x41, 0x41, 0x51, 0x73, 0x00,
|
||||||
|
0x7F, 0x08, 0x08, 0x08, 0x7F, 0x00,
|
||||||
|
0x00, 0x41, 0x7F, 0x41, 0x00, 0x00,
|
||||||
|
0x20, 0x40, 0x41, 0x3F, 0x01, 0x00,
|
||||||
|
0x7F, 0x08, 0x14, 0x22, 0x41, 0x00,
|
||||||
|
0x7F, 0x40, 0x40, 0x40, 0x40, 0x00,
|
||||||
|
0x7F, 0x02, 0x1C, 0x02, 0x7F, 0x00,
|
||||||
|
0x7F, 0x04, 0x08, 0x10, 0x7F, 0x00,
|
||||||
|
0x3E, 0x41, 0x41, 0x41, 0x3E, 0x00,
|
||||||
|
0x7F, 0x09, 0x09, 0x09, 0x06, 0x00,
|
||||||
|
0x3E, 0x41, 0x51, 0x21, 0x5E, 0x00,
|
||||||
|
0x7F, 0x09, 0x19, 0x29, 0x46, 0x00,
|
||||||
|
0x26, 0x49, 0x49, 0x49, 0x32, 0x00,
|
||||||
|
0x03, 0x01, 0x7F, 0x01, 0x03, 0x00,
|
||||||
|
0x3F, 0x40, 0x40, 0x40, 0x3F, 0x00,
|
||||||
|
0x1F, 0x20, 0x40, 0x20, 0x1F, 0x00,
|
||||||
|
0x3F, 0x40, 0x38, 0x40, 0x3F, 0x00,
|
||||||
|
0x63, 0x14, 0x08, 0x14, 0x63, 0x00,
|
||||||
|
0x03, 0x04, 0x78, 0x04, 0x03, 0x00,
|
||||||
|
0x61, 0x59, 0x49, 0x4D, 0x43, 0x00,
|
||||||
|
0x00, 0x7F, 0x41, 0x41, 0x41, 0x00,
|
||||||
|
0x02, 0x04, 0x08, 0x10, 0x20, 0x00,
|
||||||
|
0x00, 0x41, 0x41, 0x41, 0x7F, 0x00,
|
||||||
|
0x04, 0x02, 0x01, 0x02, 0x04, 0x00,
|
||||||
|
0x40, 0x40, 0x40, 0x40, 0x40, 0x00,
|
||||||
|
0x00, 0x03, 0x07, 0x08, 0x00, 0x00,
|
||||||
|
0x20, 0x54, 0x54, 0x78, 0x40, 0x00,
|
||||||
|
0x7F, 0x28, 0x44, 0x44, 0x38, 0x00,
|
||||||
|
0x38, 0x44, 0x44, 0x44, 0x28, 0x00,
|
||||||
|
0x38, 0x44, 0x44, 0x28, 0x7F, 0x00,
|
||||||
|
0x38, 0x54, 0x54, 0x54, 0x18, 0x00,
|
||||||
|
0x00, 0x08, 0x7E, 0x09, 0x02, 0x00,
|
||||||
|
0x18, 0xA4, 0xA4, 0x9C, 0x78, 0x00,
|
||||||
|
0x7F, 0x08, 0x04, 0x04, 0x78, 0x00,
|
||||||
|
0x00, 0x44, 0x7D, 0x40, 0x00, 0x00,
|
||||||
|
0x20, 0x40, 0x40, 0x3D, 0x00, 0x00,
|
||||||
|
0x7F, 0x10, 0x28, 0x44, 0x00, 0x00,
|
||||||
|
0x00, 0x41, 0x7F, 0x40, 0x00, 0x00,
|
||||||
|
0x7C, 0x04, 0x78, 0x04, 0x78, 0x00,
|
||||||
|
0x7C, 0x08, 0x04, 0x04, 0x78, 0x00,
|
||||||
|
0x38, 0x44, 0x44, 0x44, 0x38, 0x00,
|
||||||
|
0xFC, 0x18, 0x24, 0x24, 0x18, 0x00,
|
||||||
|
0x18, 0x24, 0x24, 0x18, 0xFC, 0x00,
|
||||||
|
0x7C, 0x08, 0x04, 0x04, 0x08, 0x00,
|
||||||
|
0x48, 0x54, 0x54, 0x54, 0x24, 0x00,
|
||||||
|
0x04, 0x04, 0x3F, 0x44, 0x24, 0x00,
|
||||||
|
0x3C, 0x40, 0x40, 0x20, 0x7C, 0x00,
|
||||||
|
0x1C, 0x20, 0x40, 0x20, 0x1C, 0x00,
|
||||||
|
0x3C, 0x40, 0x30, 0x40, 0x3C, 0x00,
|
||||||
|
0x44, 0x28, 0x10, 0x28, 0x44, 0x00,
|
||||||
|
0x4C, 0x90, 0x90, 0x90, 0x7C, 0x00,
|
||||||
|
0x44, 0x64, 0x54, 0x4C, 0x44, 0x00,
|
||||||
|
0x00, 0x08, 0x36, 0x41, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x77, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x41, 0x36, 0x08, 0x00, 0x00,
|
||||||
|
0x02, 0x01, 0x02, 0x04, 0x02, 0x00,
|
||||||
|
0x3C, 0x26, 0x23, 0x26, 0x3C, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x40, 0x40, 0x40, 0xF0, 0xF8, 0xF8,
|
||||||
|
0xFF, 0x38, 0xFF, 0xF8, 0xF8, 0x3F,
|
||||||
|
0xF8, 0xF8, 0xFF, 0x38, 0xFF, 0xF8,
|
||||||
|
0xF8, 0xF0, 0x40, 0x40, 0x40, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
|
||||||
|
0xC0, 0xC0, 0xC0, 0x80, 0x00, 0x00,
|
||||||
|
0xC0, 0xC0, 0x80, 0x00, 0x00, 0x00,
|
||||||
|
0x80, 0xC0, 0xC0, 0x00, 0xC0, 0xC0,
|
||||||
|
0x00, 0x00, 0x80, 0xC0, 0xC0, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0,
|
||||||
|
0xC0, 0xC0, 0xC0, 0x00, 0xC0, 0xC0,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0xC0, 0xF0, 0xF8, 0xFC, 0x3E,
|
||||||
|
0x1E, 0x06, 0x01, 0x00, 0x00, 0x00,
|
||||||
|
0x7F, 0x41, 0x41, 0x41, 0x7F, 0x00,
|
||||||
|
0x7F, 0x41, 0x41, 0x41, 0x7F, 0x00,
|
||||||
|
0x00, 0x80, 0xC0, 0xE0, 0x7E, 0x5B,
|
||||||
|
0x4F, 0x5B, 0xFE, 0xC0, 0x00, 0x00,
|
||||||
|
0xC0, 0x00, 0xDC, 0xD7, 0xDE, 0xDE,
|
||||||
|
0xDE, 0xD7, 0xDC, 0x00, 0xC0, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x49, 0x49, 0x49, 0xFF, 0xFF, 0xFF,
|
||||||
|
0xFF, 0xE0, 0xDF, 0xBF, 0xBF, 0x00,
|
||||||
|
0xBF, 0xBF, 0xDF, 0xE0, 0xFF, 0xFF,
|
||||||
|
0xFF, 0xFF, 0x49, 0x49, 0x49, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x1F, 0x3F,
|
||||||
|
0x60, 0x60, 0xE0, 0xBF, 0x1F, 0x00,
|
||||||
|
0x7F, 0x7F, 0x07, 0x1E, 0x38, 0x1E,
|
||||||
|
0x07, 0x7F, 0x7F, 0x00, 0x7F, 0x7F,
|
||||||
|
0x0E, 0x1F, 0x3B, 0x71, 0x60, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x7F, 0x7F,
|
||||||
|
0x0C, 0x0C, 0x0C, 0x00, 0x7E, 0x7E,
|
||||||
|
0x00, 0x7F, 0x7E, 0x03, 0x03, 0x00,
|
||||||
|
0x7F, 0x7E, 0x03, 0x03, 0x7E, 0x7E,
|
||||||
|
0x03, 0x03, 0x7F, 0x7E, 0x00, 0x0F,
|
||||||
|
0x3E, 0x70, 0x3C, 0x06, 0x3C, 0x70,
|
||||||
|
0x3E, 0x0F, 0x00, 0x32, 0x7B, 0x49,
|
||||||
|
0x49, 0x3F, 0x7E, 0x00, 0x7F, 0x7E,
|
||||||
|
0x03, 0x03, 0x00, 0x1E, 0x3F, 0x69,
|
||||||
|
0x69, 0x6F, 0x26, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x03, 0x0F, 0x1F, 0x3F, 0x3C,
|
||||||
|
0x78, 0x70, 0x60, 0x00, 0x00, 0x00,
|
||||||
|
0x7F, 0x41, 0x41, 0x41, 0x7F, 0x00,
|
||||||
|
0x7F, 0x41, 0x41, 0x41, 0x7F, 0x00,
|
||||||
|
0x30, 0x7B, 0x7F, 0x78, 0x30, 0x20,
|
||||||
|
0x20, 0x30, 0x78, 0x7F, 0x3B, 0x00,
|
||||||
|
0x03, 0x00, 0x0F, 0x7F, 0x0F, 0x0F,
|
||||||
|
0x0F, 0x7F, 0x0F, 0x00, 0x03, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x01, 0x01, 0x01, 0x07, 0x0F, 0x0F,
|
||||||
|
0x7F, 0x0F, 0x7F, 0x0F, 0x0F, 0x7E,
|
||||||
|
0x0F, 0x0F, 0x7F, 0x0F, 0x7F, 0x0F,
|
||||||
|
0x0F, 0x07, 0x01, 0x01, 0x01, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x01, 0x01, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
};
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
The Android robot is reproduced or modified from work created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License.
|
||||||
|
|
||||||
|
|
||||||
|
This is the Linux-penguin again...
|
||||||
|
|
||||||
|
Originally drewn by Larry Ewing (http://www.isc.tamu.edu/~lewing/)
|
||||||
|
(with the GIMP) the Linux Logo has been vectorized by me (Simon Budig,
|
||||||
|
http://www.home.unix-ag.org/simon/).
|
||||||
|
|
||||||
|
This happened quite some time ago with Corel Draw 4. But luckily
|
||||||
|
meanwhile there are tools available to handle vector graphics with
|
||||||
|
Linux. Bernhard Herzog ([email protected]) deserves kudos
|
||||||
|
for creating Sketch (http://sketch.sourceforge.net), a powerful free
|
||||||
|
tool for creating vector graphics. He converted the Corel Draw file to
|
||||||
|
the Sketch native format. Since I am unable to maintain the Corel Draw
|
||||||
|
file any longer, the Sketch version now is the "official" one.
|
||||||
|
|
||||||
|
Anja Gerwinski ([email protected]) has created an alternate version of
|
||||||
|
the penguin (penguin-variant.sk) with a thinner mouth line and slightly
|
||||||
|
altered gradients. It also features a nifty drop shadow.
|
||||||
|
|
||||||
|
The third bird (penguin-flat.sk) is a version reduced to three colors
|
||||||
|
(black/white/yellow) for e.g. silk screen printing. I made this version
|
||||||
|
for a mug, available at the friendly folks at
|
||||||
|
http://www.kernelconcepts.de/ - they do good stuff, mail Petra
|
||||||
|
([email protected]) if you need something special or don't
|
||||||
|
understand the german :-)
|
||||||
|
|
||||||
|
These drawings are copyrighted by Larry Ewing and Simon Budig
|
||||||
|
(penguin-variant.sk also by Anja Gerwinski), redistribution is free but
|
||||||
|
has to include this README/Copyright notice.
|
||||||
|
|
||||||
|
The use of these drawings is free. However I am happy about a sample of
|
||||||
|
your mug/t-shirt/whatever with this penguin on it...
|
||||||
|
|
||||||
|
Have fun
|
||||||
|
Simon Budig
|
||||||
|
|
||||||
|
|
||||||
|
[email protected]
|
||||||
|
http://www.home.unix-ag.org/simon/
|
||||||
|
|
||||||
|
Simon Budig
|
||||||
|
Am Hardtkoeppel 2
|
||||||
|
D-61279 Graevenwiesbach
|
||||||
@@ -0,0 +1,531 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2019 Ryan Caltabiano <https://github.com/XScorpion2>
|
||||||
|
|
||||||
|
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 "i2c_master.h"
|
||||||
|
#include "oled_driver.h"
|
||||||
|
#include OLED_FONT_H
|
||||||
|
#include "timer.h"
|
||||||
|
#include "print.h"
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
#if defined(__AVR__)
|
||||||
|
#include <avr/io.h>
|
||||||
|
#include <avr/pgmspace.h>
|
||||||
|
#elif defined(ESP8266)
|
||||||
|
#include <pgmspace.h>
|
||||||
|
#else // defined(ESP8266)
|
||||||
|
#define PROGMEM
|
||||||
|
#define memcpy_P(des, src, len) memcpy(des, src, len)
|
||||||
|
#endif // defined(__AVR__)
|
||||||
|
|
||||||
|
// Used commands from spec sheet: https://cdn-shop.adafruit.com/datasheets/SSD1306.pdf
|
||||||
|
// Fundamental Commands
|
||||||
|
#define CONTRAST 0x81
|
||||||
|
#define DISPLAY_ALL_ON 0xA5
|
||||||
|
#define DISPLAY_ALL_ON_RESUME 0xA4
|
||||||
|
#define NORMAL_DISPLAY 0xA6
|
||||||
|
#define DISPLAY_ON 0xAF
|
||||||
|
#define DISPLAY_OFF 0xAE
|
||||||
|
|
||||||
|
// Scrolling Commands
|
||||||
|
#define ACTIVATE_SCROLL 0x2F
|
||||||
|
#define DEACTIVATE_SCROLL 0x2E
|
||||||
|
#define SCROLL_RIGHT 0x26
|
||||||
|
#define SCROLL_LEFT 0x27
|
||||||
|
#define SCROLL_RIGHT_UP 0x29
|
||||||
|
#define SCROLL_LEFT_UP 0x2A
|
||||||
|
|
||||||
|
// Addressing Setting Commands
|
||||||
|
#define MEMORY_MODE 0x20
|
||||||
|
#define COLUMN_ADDR 0x21
|
||||||
|
#define PAGE_ADDR 0x22
|
||||||
|
|
||||||
|
// Hardware Configuration Commands
|
||||||
|
#define DISPLAY_START_LINE 0x40
|
||||||
|
#define SEGMENT_REMAP 0xA0
|
||||||
|
#define SEGMENT_REMAP_INV 0xA1
|
||||||
|
#define MULTIPLEX_RATIO 0xA8
|
||||||
|
#define COM_SCAN_INC 0xC0
|
||||||
|
#define COM_SCAN_DEC 0xC8
|
||||||
|
#define DISPLAY_OFFSET 0xD3
|
||||||
|
#define COM_PINS 0xDA
|
||||||
|
|
||||||
|
// Timing & Driving Commands
|
||||||
|
#define DISPLAY_CLOCK 0xD5
|
||||||
|
#define PRE_CHARGE_PERIOD 0xD9
|
||||||
|
#define VCOM_DETECT 0xDB
|
||||||
|
|
||||||
|
// Charge Pump Commands
|
||||||
|
#define CHARGE_PUMP 0x8D
|
||||||
|
|
||||||
|
// Misc defines
|
||||||
|
#define OLED_TIMEOUT 60000
|
||||||
|
#define OLED_BLOCK_COUNT (sizeof(OLED_BLOCK_TYPE) * 8)
|
||||||
|
#define OLED_BLOCK_SIZE (OLED_MATRIX_SIZE / OLED_BLOCK_COUNT)
|
||||||
|
|
||||||
|
// i2c defines
|
||||||
|
#define I2C_CMD 0x00
|
||||||
|
#define I2C_DATA 0x40
|
||||||
|
#if defined(__AVR__)
|
||||||
|
// already defined on ARM
|
||||||
|
#define I2C_TIMEOUT 100
|
||||||
|
#define I2C_TRANSMIT_P(data) i2c_transmit_P((OLED_DISPLAY_ADDRESS << 1), &data[0], sizeof(data), I2C_TIMEOUT)
|
||||||
|
#else // defined(__AVR__)
|
||||||
|
#define I2C_TRANSMIT_P(data) i2c_transmit((OLED_DISPLAY_ADDRESS << 1), &data[0], sizeof(data), I2C_TIMEOUT)
|
||||||
|
#endif // defined(__AVR__)
|
||||||
|
#define I2C_TRANSMIT(data) i2c_transmit((OLED_DISPLAY_ADDRESS << 1), &data[0], sizeof(data), I2C_TIMEOUT)
|
||||||
|
#define I2C_WRITE_REG(mode, data, size) i2c_writeReg((OLED_DISPLAY_ADDRESS << 1), mode, data, size, I2C_TIMEOUT)
|
||||||
|
|
||||||
|
#define HAS_FLAGS(bits, flags) ((bits & flags) == flags)
|
||||||
|
|
||||||
|
// Display buffer's is the same as the OLED memory layout
|
||||||
|
// this is so we don't end up with rounding errors with
|
||||||
|
// parts of the display unusable or don't get cleared correctly
|
||||||
|
// and also allows for drawing & inverting
|
||||||
|
uint8_t oled_buffer[OLED_MATRIX_SIZE];
|
||||||
|
uint8_t* oled_cursor;
|
||||||
|
OLED_BLOCK_TYPE oled_dirty = 0;
|
||||||
|
bool oled_initialized = false;
|
||||||
|
bool oled_active = false;
|
||||||
|
bool oled_scrolling = false;
|
||||||
|
uint8_t oled_rotation = 0;
|
||||||
|
uint8_t oled_rotation_width = 0;
|
||||||
|
#if !defined(OLED_DISABLE_TIMEOUT)
|
||||||
|
uint16_t oled_last_activity;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Internal variables to reduce math instructions
|
||||||
|
|
||||||
|
#if defined(__AVR__)
|
||||||
|
// identical to i2c_transmit, but for PROGMEM since all initialization is in PROGMEM arrays currently
|
||||||
|
// probably should move this into i2c_master...
|
||||||
|
static i2c_status_t i2c_transmit_P(uint8_t address, const uint8_t* data, uint16_t length, uint16_t timeout) {
|
||||||
|
i2c_status_t status = i2c_start(address | I2C_WRITE, timeout);
|
||||||
|
|
||||||
|
for (uint16_t i = 0; i < length && status >= 0; i++) {
|
||||||
|
status = i2c_write(pgm_read_byte((const char*)data++), timeout);
|
||||||
|
if (status) break;
|
||||||
|
}
|
||||||
|
|
||||||
|
i2c_stop();
|
||||||
|
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Flips the rendering bits for a character at the current cursor position
|
||||||
|
static void InvertCharacter(uint8_t *cursor)
|
||||||
|
{
|
||||||
|
const uint8_t *end = cursor + OLED_FONT_WIDTH;
|
||||||
|
while (cursor < end) {
|
||||||
|
*cursor = ~(*cursor);
|
||||||
|
cursor++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool oled_init(uint8_t rotation) {
|
||||||
|
oled_rotation = oled_init_user(rotation);
|
||||||
|
if (!HAS_FLAGS(oled_rotation, OLED_ROTATION_90)) {
|
||||||
|
oled_rotation_width = OLED_DISPLAY_WIDTH;
|
||||||
|
} else {
|
||||||
|
oled_rotation_width = OLED_DISPLAY_HEIGHT;
|
||||||
|
}
|
||||||
|
i2c_init();
|
||||||
|
|
||||||
|
static const uint8_t PROGMEM display_setup1[] = {
|
||||||
|
I2C_CMD,
|
||||||
|
DISPLAY_OFF,
|
||||||
|
DISPLAY_CLOCK, 0x80,
|
||||||
|
MULTIPLEX_RATIO, OLED_DISPLAY_HEIGHT - 1,
|
||||||
|
DISPLAY_OFFSET, 0x00,
|
||||||
|
DISPLAY_START_LINE | 0x00,
|
||||||
|
CHARGE_PUMP, 0x14,
|
||||||
|
MEMORY_MODE, 0x00, }; // Horizontal addressing mode
|
||||||
|
if (I2C_TRANSMIT_P(display_setup1) != I2C_STATUS_SUCCESS) {
|
||||||
|
print("oled_init cmd set 1 failed\n");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!HAS_FLAGS(oled_rotation, OLED_ROTATION_180)) {
|
||||||
|
static const uint8_t PROGMEM display_normal[] = {
|
||||||
|
I2C_CMD,
|
||||||
|
SEGMENT_REMAP_INV,
|
||||||
|
COM_SCAN_DEC };
|
||||||
|
if (I2C_TRANSMIT_P(display_normal) != I2C_STATUS_SUCCESS) {
|
||||||
|
print("oled_init cmd normal rotation failed\n");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
static const uint8_t PROGMEM display_flipped[] = {
|
||||||
|
I2C_CMD,
|
||||||
|
SEGMENT_REMAP,
|
||||||
|
COM_SCAN_INC };
|
||||||
|
if (I2C_TRANSMIT_P(display_flipped) != I2C_STATUS_SUCCESS) {
|
||||||
|
print("display_flipped failed\n");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static const uint8_t PROGMEM display_setup2[] = {
|
||||||
|
I2C_CMD,
|
||||||
|
COM_PINS, 0x02,
|
||||||
|
CONTRAST, 0x8F,
|
||||||
|
PRE_CHARGE_PERIOD, 0xF1,
|
||||||
|
VCOM_DETECT, 0x40,
|
||||||
|
DISPLAY_ALL_ON_RESUME,
|
||||||
|
NORMAL_DISPLAY,
|
||||||
|
DEACTIVATE_SCROLL,
|
||||||
|
DISPLAY_ON };
|
||||||
|
if (I2C_TRANSMIT_P(display_setup2) != I2C_STATUS_SUCCESS) {
|
||||||
|
print("display_setup2 failed\n");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
oled_clear();
|
||||||
|
oled_initialized = true;
|
||||||
|
oled_active = true;
|
||||||
|
oled_scrolling = false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
__attribute__((weak))
|
||||||
|
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
||||||
|
return rotation;
|
||||||
|
}
|
||||||
|
|
||||||
|
void oled_clear(void) {
|
||||||
|
memset(oled_buffer, 0, sizeof(oled_buffer));
|
||||||
|
oled_cursor = &oled_buffer[0];
|
||||||
|
oled_dirty = -1; // -1 will be max value as long as display_dirty is unsigned type
|
||||||
|
}
|
||||||
|
|
||||||
|
static void calc_bounds(uint8_t update_start, uint8_t* cmd_array)
|
||||||
|
{
|
||||||
|
cmd_array[1] = OLED_BLOCK_SIZE * update_start % OLED_DISPLAY_WIDTH;
|
||||||
|
cmd_array[4] = OLED_BLOCK_SIZE * update_start / OLED_DISPLAY_WIDTH;
|
||||||
|
cmd_array[2] = (OLED_BLOCK_SIZE + OLED_DISPLAY_WIDTH - 1) % OLED_DISPLAY_WIDTH + cmd_array[1];
|
||||||
|
cmd_array[5] = (OLED_BLOCK_SIZE + OLED_DISPLAY_WIDTH - 1) / OLED_DISPLAY_WIDTH - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void calc_bounds_90(uint8_t update_start, uint8_t* cmd_array)
|
||||||
|
{
|
||||||
|
cmd_array[1] = OLED_BLOCK_SIZE * update_start / OLED_DISPLAY_HEIGHT * 8;
|
||||||
|
cmd_array[4] = OLED_BLOCK_SIZE * update_start % OLED_DISPLAY_HEIGHT;
|
||||||
|
cmd_array[2] = (OLED_BLOCK_SIZE + OLED_DISPLAY_HEIGHT - 1) / OLED_DISPLAY_HEIGHT * 8 - 1 + cmd_array[1];;
|
||||||
|
cmd_array[5] = (OLED_BLOCK_SIZE + OLED_DISPLAY_HEIGHT - 1) % OLED_DISPLAY_HEIGHT / 8;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t crot(uint8_t a, int8_t n)
|
||||||
|
{
|
||||||
|
const uint8_t mask = 0x7;
|
||||||
|
n &= mask;
|
||||||
|
return a << n | a >> (-n & mask);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void rotate_90(const uint8_t* src, uint8_t* dest)
|
||||||
|
{
|
||||||
|
for (uint8_t i = 0, shift = 7; i < 8; ++i, --shift) {
|
||||||
|
uint8_t selector = (1 << i);
|
||||||
|
for (uint8_t j = 0; j < 8; ++j) {
|
||||||
|
dest[i] |= crot(src[j] & selector, shift - (int8_t)j);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void oled_render(void) {
|
||||||
|
// Do we have work to do?
|
||||||
|
if (!oled_dirty || oled_scrolling) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Find first dirty block
|
||||||
|
uint8_t update_start = 0;
|
||||||
|
while (!(oled_dirty & (1 << update_start))) { ++update_start; }
|
||||||
|
|
||||||
|
// Set column & page position
|
||||||
|
static uint8_t display_start[] = {
|
||||||
|
I2C_CMD,
|
||||||
|
COLUMN_ADDR, 0, OLED_DISPLAY_WIDTH - 1,
|
||||||
|
PAGE_ADDR, 0, OLED_DISPLAY_HEIGHT / 8 - 1 };
|
||||||
|
if (!HAS_FLAGS(oled_rotation, OLED_ROTATION_90)) {
|
||||||
|
calc_bounds(update_start, &display_start[1]); // Offset from I2C_CMD byte at the start
|
||||||
|
} else {
|
||||||
|
calc_bounds_90(update_start, &display_start[1]); // Offset from I2C_CMD byte at the start
|
||||||
|
}
|
||||||
|
|
||||||
|
// Send column & page position
|
||||||
|
if (I2C_TRANSMIT(display_start) != I2C_STATUS_SUCCESS) {
|
||||||
|
print("oled_render offset command failed\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!HAS_FLAGS(oled_rotation, OLED_ROTATION_90)) {
|
||||||
|
// Send render data chunk as is
|
||||||
|
if (I2C_WRITE_REG(I2C_DATA, &oled_buffer[OLED_BLOCK_SIZE * update_start], OLED_BLOCK_SIZE) != I2C_STATUS_SUCCESS) {
|
||||||
|
print("oled_render data failed\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Rotate the render chunks
|
||||||
|
const static uint8_t source_map[] = OLED_SOURCE_MAP;
|
||||||
|
const static uint8_t target_map[] = OLED_TARGET_MAP;
|
||||||
|
|
||||||
|
static uint8_t temp_buffer[OLED_BLOCK_SIZE];
|
||||||
|
memset(temp_buffer, 0, sizeof(temp_buffer));
|
||||||
|
for(uint8_t i = 0; i < sizeof(source_map); ++i) {
|
||||||
|
rotate_90(&oled_buffer[OLED_BLOCK_SIZE * update_start + source_map[i]], &temp_buffer[target_map[i]]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Send render data chunk after rotating
|
||||||
|
if (I2C_WRITE_REG(I2C_DATA, &temp_buffer[0], OLED_BLOCK_SIZE) != I2C_STATUS_SUCCESS) {
|
||||||
|
print("oled_render data failed\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Turn on display if it is off
|
||||||
|
oled_on();
|
||||||
|
|
||||||
|
// Clear dirty flag
|
||||||
|
oled_dirty &= ~(1 << update_start);
|
||||||
|
}
|
||||||
|
|
||||||
|
void oled_set_cursor(uint8_t col, uint8_t line) {
|
||||||
|
uint16_t index = line * oled_rotation_width + col * OLED_FONT_WIDTH;
|
||||||
|
|
||||||
|
// Out of bounds?
|
||||||
|
if (index >= OLED_MATRIX_SIZE) {
|
||||||
|
index = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
oled_cursor = &oled_buffer[index];
|
||||||
|
}
|
||||||
|
|
||||||
|
void oled_advance_page(bool clearPageRemainder) {
|
||||||
|
uint16_t index = oled_cursor - &oled_buffer[0];
|
||||||
|
uint8_t remaining = oled_rotation_width - (index % oled_rotation_width);
|
||||||
|
|
||||||
|
if (clearPageRemainder) {
|
||||||
|
// Remaining Char count
|
||||||
|
remaining = remaining / OLED_FONT_WIDTH;
|
||||||
|
|
||||||
|
// Write empty character until next line
|
||||||
|
while (remaining--)
|
||||||
|
oled_write_char(' ', false);
|
||||||
|
} else {
|
||||||
|
// Next page index out of bounds?
|
||||||
|
if (index + remaining >= OLED_MATRIX_SIZE) {
|
||||||
|
index = 0;
|
||||||
|
remaining = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
oled_cursor = &oled_buffer[index + remaining];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void oled_advance_char(void) {
|
||||||
|
uint16_t nextIndex = oled_cursor - &oled_buffer[0] + OLED_FONT_WIDTH;
|
||||||
|
uint8_t remainingSpace = oled_rotation_width - (nextIndex % oled_rotation_width);
|
||||||
|
|
||||||
|
// Do we have enough space on the current line for the next character
|
||||||
|
if (remainingSpace < OLED_FONT_WIDTH) {
|
||||||
|
nextIndex += remainingSpace;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Did we go out of bounds
|
||||||
|
if (nextIndex >= OLED_MATRIX_SIZE) {
|
||||||
|
nextIndex = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update cursor position
|
||||||
|
oled_cursor = &oled_buffer[nextIndex];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Main handler that writes character data to the display buffer
|
||||||
|
void oled_write_char(const char data, bool invert) {
|
||||||
|
// Advance to the next line if newline
|
||||||
|
if (data == '\n') {
|
||||||
|
// Old source wrote ' ' until end of line...
|
||||||
|
oled_advance_page(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// copy the current render buffer to check for dirty after
|
||||||
|
static uint8_t oled_temp_buffer[OLED_FONT_WIDTH];
|
||||||
|
memcpy(&oled_temp_buffer, oled_cursor, OLED_FONT_WIDTH);
|
||||||
|
|
||||||
|
// set the reder buffer data
|
||||||
|
uint8_t cast_data = (uint8_t)data; // font based on unsigned type for index
|
||||||
|
if (cast_data < OLED_FONT_START || cast_data > OLED_FONT_END) {
|
||||||
|
memset(oled_cursor, 0x00, OLED_FONT_WIDTH);
|
||||||
|
} else {
|
||||||
|
const uint8_t *glyph = &font[(cast_data - OLED_FONT_START) * OLED_FONT_WIDTH];
|
||||||
|
memcpy_P(oled_cursor, glyph, OLED_FONT_WIDTH);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Invert if needed
|
||||||
|
if (invert) {
|
||||||
|
InvertCharacter(oled_cursor);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Dirty check
|
||||||
|
if (memcmp(&oled_temp_buffer, oled_cursor, OLED_FONT_WIDTH)) {
|
||||||
|
uint16_t index = oled_cursor - &oled_buffer[0];
|
||||||
|
oled_dirty |= (1 << (index / OLED_BLOCK_SIZE));
|
||||||
|
// Edgecase check if the written data spans the 2 chunks
|
||||||
|
oled_dirty |= (1 << ((index + OLED_FONT_WIDTH) / OLED_BLOCK_SIZE));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Finally move to the next char
|
||||||
|
oled_advance_char();
|
||||||
|
}
|
||||||
|
|
||||||
|
void oled_write(const char *data, bool invert) {
|
||||||
|
const char *end = data + strlen(data);
|
||||||
|
while (data < end) {
|
||||||
|
oled_write_char(*data, invert);
|
||||||
|
data++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void oled_write_ln(const char *data, bool invert) {
|
||||||
|
oled_write(data, invert);
|
||||||
|
oled_advance_page(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
#if defined(__AVR__)
|
||||||
|
void oled_write_P(const char *data, bool invert) {
|
||||||
|
uint8_t c = pgm_read_byte(data);
|
||||||
|
while (c != 0) {
|
||||||
|
oled_write_char(c, invert);
|
||||||
|
c = pgm_read_byte(++data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void oled_write_ln_P(const char *data, bool invert) {
|
||||||
|
oled_write_P(data, invert);
|
||||||
|
oled_advance_page(true);
|
||||||
|
}
|
||||||
|
#endif // defined(__AVR__)
|
||||||
|
|
||||||
|
bool oled_on(void) {
|
||||||
|
#if !defined(OLED_DISABLE_TIMEOUT)
|
||||||
|
oled_last_activity = timer_read();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static const uint8_t PROGMEM display_on[] = { I2C_CMD, DISPLAY_ON };
|
||||||
|
if (!oled_active) {
|
||||||
|
if (I2C_TRANSMIT_P(display_on) != I2C_STATUS_SUCCESS) {
|
||||||
|
print("oled_on cmd failed\n");
|
||||||
|
return oled_active;
|
||||||
|
}
|
||||||
|
oled_active = true;
|
||||||
|
}
|
||||||
|
return oled_active;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool oled_off(void) {
|
||||||
|
static const uint8_t PROGMEM display_off[] = { I2C_CMD, DISPLAY_OFF };
|
||||||
|
if (oled_active) {
|
||||||
|
if (I2C_TRANSMIT_P(display_off) != I2C_STATUS_SUCCESS) {
|
||||||
|
print("oled_off cmd failed\n");
|
||||||
|
return oled_active;
|
||||||
|
}
|
||||||
|
oled_active = false;
|
||||||
|
}
|
||||||
|
return !oled_active;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool oled_scroll_right(void) {
|
||||||
|
// Dont enable scrolling if we need to update the display
|
||||||
|
// This prevents scrolling of bad data from starting the scroll too early after init
|
||||||
|
if (!oled_dirty && !oled_scrolling) {
|
||||||
|
static const uint8_t PROGMEM display_scroll_right[] = {
|
||||||
|
I2C_CMD, SCROLL_RIGHT, 0x00, 0x00, 0x00, 0x0F, 0x00, 0xFF, ACTIVATE_SCROLL };
|
||||||
|
if (I2C_TRANSMIT_P(display_scroll_right) != I2C_STATUS_SUCCESS) {
|
||||||
|
print("oled_scroll_right cmd failed\n");
|
||||||
|
return oled_scrolling;
|
||||||
|
}
|
||||||
|
oled_scrolling = true;
|
||||||
|
}
|
||||||
|
return oled_scrolling;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool oled_scroll_left(void) {
|
||||||
|
// Dont enable scrolling if we need to update the display
|
||||||
|
// This prevents scrolling of bad data from starting the scroll too early after init
|
||||||
|
if (!oled_dirty && !oled_scrolling) {
|
||||||
|
static const uint8_t PROGMEM display_scroll_left[] = {
|
||||||
|
I2C_CMD, SCROLL_LEFT, 0x00, 0x00, 0x00, 0x0F, 0x00, 0xFF, ACTIVATE_SCROLL };
|
||||||
|
if (I2C_TRANSMIT_P(display_scroll_left) != I2C_STATUS_SUCCESS) {
|
||||||
|
print("oled_scroll_left cmd failed\n");
|
||||||
|
return oled_scrolling;
|
||||||
|
}
|
||||||
|
oled_scrolling = true;
|
||||||
|
}
|
||||||
|
return oled_scrolling;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool oled_scroll_off(void) {
|
||||||
|
if (oled_scrolling) {
|
||||||
|
static const uint8_t PROGMEM display_scroll_off[] = { I2C_CMD, DEACTIVATE_SCROLL };
|
||||||
|
if (I2C_TRANSMIT_P(display_scroll_off) != I2C_STATUS_SUCCESS) {
|
||||||
|
print("oled_scroll_off cmd failed\n");
|
||||||
|
return oled_scrolling;
|
||||||
|
}
|
||||||
|
oled_scrolling = false;
|
||||||
|
}
|
||||||
|
return !oled_scrolling;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t oled_max_chars(void) {
|
||||||
|
if (!HAS_FLAGS(oled_rotation, OLED_ROTATION_90)) {
|
||||||
|
return OLED_DISPLAY_WIDTH / OLED_FONT_WIDTH;
|
||||||
|
}
|
||||||
|
return OLED_DISPLAY_HEIGHT / OLED_FONT_WIDTH;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t oled_max_lines(void) {
|
||||||
|
if (!HAS_FLAGS(oled_rotation, OLED_ROTATION_90)) {
|
||||||
|
return OLED_DISPLAY_HEIGHT / OLED_FONT_HEIGHT;
|
||||||
|
}
|
||||||
|
return OLED_DISPLAY_WIDTH / OLED_FONT_HEIGHT;
|
||||||
|
}
|
||||||
|
|
||||||
|
void oled_task(void) {
|
||||||
|
if (!oled_initialized) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
oled_set_cursor(0, 0);
|
||||||
|
|
||||||
|
oled_task_user();
|
||||||
|
|
||||||
|
// Smart render system, no need to check for dirty
|
||||||
|
oled_render();
|
||||||
|
|
||||||
|
// Display timeout check
|
||||||
|
#if !defined(OLED_DISABLE_TIMEOUT)
|
||||||
|
if (oled_active && timer_elapsed(oled_last_activity) > OLED_TIMEOUT) {
|
||||||
|
oled_off();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
__attribute__((weak))
|
||||||
|
void oled_task_user(void) {
|
||||||
|
}
|
||||||
@@ -0,0 +1,192 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2019 Ryan Caltabiano <https://github.com/XScorpion2>
|
||||||
|
|
||||||
|
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 <stdint.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
|
||||||
|
|
||||||
|
#if defined(OLED_DISPLAY_CUSTOM)
|
||||||
|
// Expected user to implement the necessary defines
|
||||||
|
#elif defined(OLED_DISPLAY_128X64)
|
||||||
|
// Double height 128x64
|
||||||
|
#define OLED_DISPLAY_WIDTH 128
|
||||||
|
#define OLED_DISPLAY_HEIGHT 64
|
||||||
|
#define OLED_MATRIX_SIZE (OLED_DISPLAY_HEIGHT / 8 * OLED_DISPLAY_WIDTH) // 1024 (compile time mathed)
|
||||||
|
#define OLED_BLOCK_TYPE uint32_t
|
||||||
|
#define OLED_BLOCK_COUNT (sizeof(OLED_BLOCK_TYPE) * 8) // 32 (compile time mathed)
|
||||||
|
#define OLED_BLOCK_SIZE (OLED_MATRIX_SIZE / OLED_BLOCK_COUNT) // 32 (compile time mathed)
|
||||||
|
|
||||||
|
// For 90 degree rotation, we map our internal matrix to oled matrix using fixed arrays
|
||||||
|
// The OLED writes to it's memory horizontally, starting top left, but our memory starts bottom left in this mode
|
||||||
|
#define OLED_SOURCE_MAP { 32, 40, 48, 56 }
|
||||||
|
#define OLED_TARGET_MAP { 24, 16, 8, 0 }
|
||||||
|
// If OLED_BLOCK_TYPE is uint16_t, these tables would look like:
|
||||||
|
// #define OLED_SOURCE_MAP { 0, 8, 16, 24, 32, 40, 48, 56 }
|
||||||
|
// #define OLED_TARGET_MAP { 56, 48, 40, 32, 24, 16, 8, 0 }
|
||||||
|
// If OLED_BLOCK_TYPE is uint8_t, these tables would look like:
|
||||||
|
// #define OLED_SOURCE_MAP { 0, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120 }
|
||||||
|
// #define OLED_TARGET_MAP { 56, 120, 48, 112, 40, 104, 32, 96, 24, 88, 16, 80, 8, 72, 0, 64 }
|
||||||
|
#else // defined(OLED_DISPLAY_128X64)
|
||||||
|
// Default 128x32
|
||||||
|
#define OLED_DISPLAY_WIDTH 128
|
||||||
|
#define OLED_DISPLAY_HEIGHT 32
|
||||||
|
#define OLED_MATRIX_SIZE (OLED_DISPLAY_HEIGHT / 8 * OLED_DISPLAY_WIDTH) // 512 (compile time mathed)
|
||||||
|
#define OLED_BLOCK_TYPE uint16_t // Type to use for segmenting the oled display for smart rendering, use unsigned types only
|
||||||
|
#define OLED_BLOCK_COUNT (sizeof(OLED_BLOCK_TYPE) * 8) // 16 (compile time mathed)
|
||||||
|
#define OLED_BLOCK_SIZE (OLED_MATRIX_SIZE / OLED_BLOCK_COUNT) // 32 (compile time mathed)
|
||||||
|
|
||||||
|
// For 90 degree rotation, we map our internal matrix to oled matrix using fixed arrays
|
||||||
|
// The OLED writes to it's memory horizontally, starting top left, but our memory starts bottom left in this mode
|
||||||
|
#define OLED_SOURCE_MAP { 0, 8, 16, 24 }
|
||||||
|
#define OLED_TARGET_MAP { 24, 16, 8, 0 }
|
||||||
|
// If OLED_BLOCK_TYPE is uint8_t, these tables would look like:
|
||||||
|
// #define OLED_SOURCE_MAP { 0, 8, 16, 24, 32, 40, 48, 56 }
|
||||||
|
// #define OLED_TARGET_MAP { 48, 32, 16, 0, 56, 40, 24, 8 }
|
||||||
|
#endif // defined(OLED_DISPLAY_CUSTOM)
|
||||||
|
|
||||||
|
// Address to use for tthe i2d oled communication
|
||||||
|
#if !defined(OLED_DISPLAY_ADDRESS)
|
||||||
|
#define OLED_DISPLAY_ADDRESS 0x3C
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Custom font file to use
|
||||||
|
#if !defined(OLED_FONT_H)
|
||||||
|
#define OLED_FONT_H "glcdfont.c"
|
||||||
|
#endif
|
||||||
|
// unsigned char value of the first character in the font file
|
||||||
|
#if !defined(OLED_FONT_START)
|
||||||
|
#define OLED_FONT_START 0
|
||||||
|
#endif
|
||||||
|
// unsigned char value of the last character in the font file
|
||||||
|
#if !defined(OLED_FONT_END)
|
||||||
|
#define OLED_FONT_END 224
|
||||||
|
#endif
|
||||||
|
// Font render width
|
||||||
|
#if !defined(OLED_FONT_WIDTH)
|
||||||
|
#define OLED_FONT_WIDTH 6
|
||||||
|
#endif
|
||||||
|
// Font render height
|
||||||
|
#if !defined(OLED_FONT_HEIGHT)
|
||||||
|
#define OLED_FONT_HEIGHT 8
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// OLED Rotation enum values are flags
|
||||||
|
typedef enum {
|
||||||
|
OLED_ROTATION_0 = 0,
|
||||||
|
OLED_ROTATION_90 = 1,
|
||||||
|
OLED_ROTATION_180 = 2,
|
||||||
|
OLED_ROTATION_270 = 3, // OLED_ROTATION_90 | OLED_ROTATION_180
|
||||||
|
} oled_rotation_t;
|
||||||
|
|
||||||
|
// Initialize the oled display, rotating the rendered output based on the define passed in.
|
||||||
|
// Returns true if the OLED was initialized successfully
|
||||||
|
bool oled_init(oled_rotation_t rotation);
|
||||||
|
|
||||||
|
// Called at the start of oled_init, weak function overridable by the user
|
||||||
|
// rotation - the value passed into oled_init
|
||||||
|
// Return new oled_rotation_t if you want to override default rotation
|
||||||
|
oled_rotation_t oled_init_user(oled_rotation_t rotation);
|
||||||
|
|
||||||
|
// Clears the display buffer, resets cursor position to 0, and sets the buffer to dirty for rendering
|
||||||
|
void oled_clear(void);
|
||||||
|
|
||||||
|
// Renders the dirty chunks of the buffer to oled display
|
||||||
|
void oled_render(void);
|
||||||
|
|
||||||
|
// Moves cursor to character position indicated by column and line, wraps if out of bounds
|
||||||
|
// Max column denoted by 'oled_max_chars()' and max lines by 'oled_max_lines()' functions
|
||||||
|
void oled_set_cursor(uint8_t col, uint8_t line);
|
||||||
|
|
||||||
|
// Advances the cursor to the next page, writing ' ' if true
|
||||||
|
// Wraps to the begining when out of bounds
|
||||||
|
void oled_advance_page(bool clearPageRemainder);
|
||||||
|
|
||||||
|
// Moves the cursor forward 1 character length
|
||||||
|
// Advance page if there is not enough room for the next character
|
||||||
|
// Wraps to the begining when out of bounds
|
||||||
|
void oled_advance_char(void);
|
||||||
|
|
||||||
|
// Writes a single character to the buffer at current cursor position
|
||||||
|
// Advances the cursor while writing, inverts the pixels if true
|
||||||
|
// Main handler that writes character data to the display buffer
|
||||||
|
void oled_write_char(const char data, bool invert);
|
||||||
|
|
||||||
|
// Writes a string to the buffer at current cursor position
|
||||||
|
// Advances the cursor while writing, inverts the pixels if true
|
||||||
|
void oled_write(const char *data, bool invert);
|
||||||
|
|
||||||
|
// Writes a string to the buffer at current cursor position
|
||||||
|
// Advances the cursor while writing, inverts the pixels if true
|
||||||
|
// Advances the cursor to the next page, wiring ' ' to the remainder of the current page
|
||||||
|
void oled_write_ln(const char *data, bool invert);
|
||||||
|
|
||||||
|
#if defined(__AVR__)
|
||||||
|
// Writes a PROGMEM string to the buffer at current cursor position
|
||||||
|
// Advances the cursor while writing, inverts the pixels if true
|
||||||
|
// Remapped to call 'void oled_write(const char *data, bool invert);' on ARM
|
||||||
|
void oled_write_P(const char *data, bool invert);
|
||||||
|
|
||||||
|
// Writes a PROGMEM string to the buffer at current cursor position
|
||||||
|
// Advances the cursor while writing, inverts the pixels if true
|
||||||
|
// Advances the cursor to the next page, wiring ' ' to the remainder of the current page
|
||||||
|
// Remapped to call 'void oled_write_ln(const char *data, bool invert);' on ARM
|
||||||
|
void oled_write_ln_P(const char *data, bool invert);
|
||||||
|
#else
|
||||||
|
// Writes a string to the buffer at current cursor position
|
||||||
|
// Advances the cursor while writing, inverts the pixels if true
|
||||||
|
#define oled_write_P(data, invert) oled_write(data, invert)
|
||||||
|
|
||||||
|
// Writes a string to the buffer at current cursor position
|
||||||
|
// Advances the cursor while writing, inverts the pixels if true
|
||||||
|
// Advances the cursor to the next page, wiring ' ' to the remainder of the current page
|
||||||
|
#define oled_write_ln_P(data, invert) oled_write(data, invert)
|
||||||
|
#endif // defined(__AVR__)
|
||||||
|
|
||||||
|
// Can be used to manually turn on the screen if it is off
|
||||||
|
// Returns true if the screen was on or turns on
|
||||||
|
bool oled_on(void);
|
||||||
|
|
||||||
|
// Can be used to manually turn off the screen if it is on
|
||||||
|
// Returns true if the screen was off or turns off
|
||||||
|
bool oled_off(void);
|
||||||
|
|
||||||
|
// Basically it's oled_render, but with timeout management and oled_task_user calling!
|
||||||
|
void oled_task(void);
|
||||||
|
|
||||||
|
// Called at the start of oled_task, weak function overridable by the user
|
||||||
|
void oled_task_user(void);
|
||||||
|
|
||||||
|
// Scrolls the entire display right
|
||||||
|
// Returns true if the screen was scrolling or starts scrolling
|
||||||
|
// NOTE: display contents cannot be changed while scrolling
|
||||||
|
bool oled_scroll_right(void);
|
||||||
|
|
||||||
|
// Scrolls the entire display left
|
||||||
|
// Returns true if the screen was scrolling or starts scrolling
|
||||||
|
// NOTE: display contents cannot be changed while scrolling
|
||||||
|
bool oled_scroll_left(void);
|
||||||
|
|
||||||
|
// Turns off display scrolling
|
||||||
|
// Returns true if the screen was not scrolling or stops scrolling
|
||||||
|
bool oled_scroll_off(void);
|
||||||
|
|
||||||
|
// Returns the maximum number of characters that will fit on a line
|
||||||
|
uint8_t oled_max_chars(void);
|
||||||
|
|
||||||
|
// Returns the maximum number of lines that will fit on the oled
|
||||||
|
uint8_t oled_max_lines(void);
|
||||||
@@ -21,7 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
|
|
||||||
/* USB Device descriptor parameter */
|
/* USB Device descriptor parameter */
|
||||||
#define VENDOR_ID 0xFEED
|
#define VENDOR_ID 0xFEED
|
||||||
#define PRODUCT_ID 0x0000
|
#define PRODUCT_ID 0x2010
|
||||||
#define DEVICE_VER 0x0001
|
#define DEVICE_VER 0x0001
|
||||||
#define MANUFACTURER 1upkeyboards
|
#define MANUFACTURER 1upkeyboards
|
||||||
#define PRODUCT super16
|
#define PRODUCT super16
|
||||||
@@ -65,9 +65,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#define RGBLIGHT_VAL_STEP 8
|
#define RGBLIGHT_VAL_STEP 8
|
||||||
#define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */
|
#define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */
|
||||||
#define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */
|
#define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */
|
||||||
/*== all animations enable ==*/
|
/*== all animations enable ==*/
|
||||||
// #define RGBLIGHT_ANIMATIONS
|
#define RGBLIGHT_ANIMATIONS
|
||||||
// /*== or choose animations ==*/
|
/*== or choose animations ==*/
|
||||||
// #define RGBLIGHT_EFFECT_BREATHING
|
// #define RGBLIGHT_EFFECT_BREATHING
|
||||||
// #define RGBLIGHT_EFFECT_RAINBOW_MOOD
|
// #define RGBLIGHT_EFFECT_RAINBOW_MOOD
|
||||||
// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL
|
// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL
|
||||||
@@ -85,10 +85,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
/* define if matrix has ghost (lacks anti-ghosting diodes) */
|
/* define if matrix has ghost (lacks anti-ghosting diodes) */
|
||||||
//#define MATRIX_HAS_GHOST
|
//#define MATRIX_HAS_GHOST
|
||||||
|
|
||||||
/* number of backlight levels */
|
|
||||||
|
|
||||||
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
||||||
#define LOCKING_SUPPORT_ENABLE
|
#define LOCKING_SUPPORT_ENABLE
|
||||||
|
|
||||||
/* Locking resynchronize hack */
|
/* Locking resynchronize hack */
|
||||||
#define LOCKING_RESYNC_ENABLE
|
#define LOCKING_RESYNC_ENABLE
|
||||||
|
|
||||||
@@ -242,3 +241,5 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
/* Bootmagic Lite key configuration */
|
/* Bootmagic Lite key configuration */
|
||||||
// #define BOOTMAGIC_LITE_ROW 0
|
// #define BOOTMAGIC_LITE_ROW 0
|
||||||
// #define BOOTMAGIC_LITE_COLUMN 0
|
// #define BOOTMAGIC_LITE_COLUMN 0
|
||||||
|
|
||||||
|
/* prevent stuck modifiers */
|
||||||
@@ -1,12 +1,15 @@
|
|||||||
{
|
{
|
||||||
"keyboard_name": "super16",
|
"keyboard_name": "super16",
|
||||||
"url": "",
|
"url": "",
|
||||||
"maintainer": "qmk",
|
"maintainer": "qmk",
|
||||||
"width": 4,
|
"width": 4,
|
||||||
"height": 4,
|
"height": 4,
|
||||||
"layouts": {
|
"layouts": {
|
||||||
"LAYOUT_ortho_4x4": {
|
"LAYOUT_ortho_4x4": {
|
||||||
"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}]
|
"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}]
|
||||||
}
|
},
|
||||||
|
"LAYOUT_numpad_4x4": {
|
||||||
|
"layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0, "h":2}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2, "h":2}, {"x":0, "y":3, "w":2}, {"x":2, "y":3}]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
@@ -15,40 +15,16 @@
|
|||||||
*/
|
*/
|
||||||
#include QMK_KEYBOARD_H
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
// Defines the keycodes used by our macros in process_record_user
|
|
||||||
enum custom_keycodes {
|
|
||||||
QMKBEST = SAFE_RANGE,
|
|
||||||
QMKURL
|
|
||||||
};
|
|
||||||
|
|
||||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
[0] = LAYOUT_ortho_4x4( /* Base */
|
[0] = LAYOUT_ortho_4x4( /* Base */
|
||||||
KC_A, KC_1, KC_2, KC_4, \
|
RGB_TOG, KC_1, KC_U, KC_P,
|
||||||
KC_A, KC_1, KC_2, KC_4, \
|
RGB_MOD, KC_1, KC_U, KC_P,
|
||||||
KC_A, KC_1, KC_2, KC_4, \
|
RGB_TOG, KC_1, KC_U, KC_P,
|
||||||
KC_A, KC_1, KC_2, KC_4 \
|
RGB_MOD, KC_1, KC_U, KC_P
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
|
|
||||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
switch (keycode) {
|
|
||||||
case QMKBEST:
|
|
||||||
if (record->event.pressed) {
|
|
||||||
// when keycode QMKBEST is pressed
|
|
||||||
SEND_STRING("QMK is the best thing ever!");
|
|
||||||
} else {
|
|
||||||
// when keycode QMKBEST is released
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case QMKURL:
|
|
||||||
if (record->event.pressed) {
|
|
||||||
// when keycode QMKURL is pressed
|
|
||||||
SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER));
|
|
||||||
} else {
|
|
||||||
// when keycode QMKURL is released
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
# MCU name
|
# MCU name
|
||||||
#MCU = at90usb1286
|
|
||||||
MCU = atmega32u4
|
MCU = atmega32u4
|
||||||
|
|
||||||
# Processor frequency.
|
# Processor frequency.
|
||||||
@@ -15,7 +14,6 @@ MCU = atmega32u4
|
|||||||
# software delays.
|
# software delays.
|
||||||
F_CPU = 16000000
|
F_CPU = 16000000
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# LUFA specific
|
# LUFA specific
|
||||||
#
|
#
|
||||||
@@ -48,7 +46,6 @@ OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
|||||||
# atmega32a bootloadHID
|
# atmega32a bootloadHID
|
||||||
BOOTLOADER = caterina
|
BOOTLOADER = caterina
|
||||||
|
|
||||||
|
|
||||||
# If you don't know the bootloader type, then you can specify the
|
# 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
|
# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line
|
||||||
# Teensy halfKay 512
|
# Teensy halfKay 512
|
||||||
@@ -58,26 +55,27 @@ BOOTLOADER = caterina
|
|||||||
# USBaspLoader 2048
|
# USBaspLoader 2048
|
||||||
# OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
# OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||||
|
|
||||||
|
#EXTRAFLAGS += -flto
|
||||||
|
|
||||||
# Build Options
|
# Build Options
|
||||||
# change yes to no to disable
|
# change yes to no to disable
|
||||||
#
|
#
|
||||||
BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000)
|
BOOTMAGIC_ENABLE = lite # 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 = no # Console for debug(+400)
|
||||||
COMMAND_ENABLE = yes # Commands for debug and configuration
|
COMMAND_ENABLE = no # 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 = no # Breathing sleep LED during USB suspend
|
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||||
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||||
NKRO_ENABLE = no # USB Nkey Rollover
|
NKRO_ENABLE = no # USB Nkey Rollover
|
||||||
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default
|
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default
|
||||||
RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
|
RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
|
||||||
MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config)
|
MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config)
|
||||||
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
|
||||||
AUDIO_ENABLE = no # Audio output on port C6
|
AUDIO_ENABLE = no # Audio output on port C6
|
||||||
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
|
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
|
||||||
HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400)
|
HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400)
|
||||||
|
|
||||||
LAYOUTS = ortho_4x4
|
LAYOUTS = ortho_4x4 numpad_4x4
|
||||||
@@ -16,28 +16,28 @@
|
|||||||
#include "super16.h"
|
#include "super16.h"
|
||||||
|
|
||||||
void matrix_init_kb(void) {
|
void matrix_init_kb(void) {
|
||||||
// put your keyboard start-up code here
|
// put your keyboard start-up code here
|
||||||
// runs once when the firmware starts up
|
// runs once when the firmware starts up
|
||||||
|
|
||||||
matrix_init_user();
|
matrix_init_user();
|
||||||
}
|
}
|
||||||
|
|
||||||
void matrix_scan_kb(void) {
|
void matrix_scan_kb(void) {
|
||||||
// put your looping keyboard code here
|
// put your looping keyboard code here
|
||||||
// runs every cycle (a lot)
|
// runs every cycle (a lot)
|
||||||
|
|
||||||
matrix_scan_user();
|
matrix_scan_user();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||||
// put your per-action keyboard code here
|
// put your per-action keyboard code here
|
||||||
// runs for every action, just before processing by the firmware
|
// runs for every action, just before processing by the firmware
|
||||||
|
|
||||||
return process_record_user(keycode, record);
|
return process_record_user(keycode, record);
|
||||||
}
|
}
|
||||||
|
|
||||||
void led_set_kb(uint8_t usb_led) {
|
void led_set_kb(uint8_t usb_led) {
|
||||||
// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
|
// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
|
||||||
|
|
||||||
led_set_user(usb_led);
|
led_set_user(usb_led);
|
||||||
}
|
}
|
||||||
@@ -25,15 +25,27 @@
|
|||||||
* The second converts the arguments into a two-dimensional array which
|
* The second converts the arguments into a two-dimensional array which
|
||||||
* represents the switch matrix.
|
* represents the switch matrix.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define LAYOUT_ortho_4x4( \
|
#define LAYOUT_ortho_4x4( \
|
||||||
k00, k01, k02, k03, \
|
K00, K01, K02, K03, \
|
||||||
k10, k11, k12, k13, \
|
K10, K11, K12, K13, \
|
||||||
k20, k21, k22, k23, \
|
K20, K21, K22, K23, \
|
||||||
k30, k31, k32, k33 \
|
K30, K31, K32, K33 \
|
||||||
) \
|
) { \
|
||||||
{ \
|
{ K00, K01, K02, K03 }, \
|
||||||
{ k00, k01, k02, k03 }, \
|
{ K10, K11, K12, K13 }, \
|
||||||
{ k10, k11, k12, k13 }, \
|
{ K20, K21, K22, K23 }, \
|
||||||
{ k20, k21, k22, k23 }, \
|
{ K30, K31, K32, K33 } \
|
||||||
{ k30, k31, k32, k33 }, \
|
}
|
||||||
|
|
||||||
|
#define LAYOUT_numpad_4x4( \
|
||||||
|
K00, K01, K02, K03, \
|
||||||
|
K10, K11, K12, \
|
||||||
|
K20, K21, K22, K23, \
|
||||||
|
K31, K32 \
|
||||||
|
) { \
|
||||||
|
{ K00, K01, K02, K03 }, \
|
||||||
|
{ K10, K11, K12, KC_NO }, \
|
||||||
|
{ K20, K21, K22, K23 }, \
|
||||||
|
{ KC_NO, K31, K32, KC_NO } \
|
||||||
}
|
}
|
||||||
@@ -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
|
||||||
@@ -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
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2012 Jun Wako <[email protected]>
|
||||||
|
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"
|
||||||
|
|
||||||
@@ -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
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
/*
|
||||||
|
This is the c configuration file for the keymap
|
||||||
|
|
||||||
|
Copyright 2012 Jun Wako <[email protected]>
|
||||||
|
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
|
||||||
@@ -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
|
||||||
|
)
|
||||||
|
};
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
# ADKB96
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
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).
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2012 Jun Wako <[email protected]>
|
||||||
|
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/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* USB Device descriptor parameter */
|
||||||
|
#define VENDOR_ID 0x00a5
|
||||||
|
#define PRODUCT_ID 0xad96
|
||||||
|
#define DEVICE_VER 0x0001
|
||||||
|
#define MANUFACTURER Bit Trade One
|
||||||
|
#define PRODUCT ADKB96
|
||||||
|
#define DESCRIPTION
|
||||||
|
|
||||||
|
/* key matrix size */
|
||||||
|
// Rows are doubled-up
|
||||||
|
#define MATRIX_ROWS 12
|
||||||
|
#define MATRIX_COLS 8
|
||||||
|
|
||||||
|
// wiring of each half
|
||||||
|
#define MATRIX_ROW_PINS { D4, C6, D7, E6, B4, B5 }
|
||||||
|
#define MATRIX_COL_PINS { B6, B2, B3, B1, F7, F6, F5, F4 }
|
||||||
|
|
||||||
|
#define SOFT_SERIAL_PIN D0
|
||||||
|
|
||||||
|
/* define tapping term */
|
||||||
|
#define TAPPING_TERM 100
|
||||||
|
|
||||||
|
/* define if matrix has ghost */
|
||||||
|
//#define MATRIX_HAS_GHOST
|
||||||
|
|
||||||
|
/* number of backlight levels */
|
||||||
|
// #define BACKLIGHT_LEVELS 3
|
||||||
|
|
||||||
|
/* Set 0 if debouncing isn't needed */
|
||||||
|
#define DEBOUNCING_DELAY 5
|
||||||
|
|
||||||
|
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
||||||
|
#define LOCKING_SUPPORT_ENABLE
|
||||||
|
/* Locking resynchronize hack */
|
||||||
|
#define LOCKING_RESYNC_ENABLE
|
||||||
|
|
||||||
|
/* ws2812 RGB LED */
|
||||||
|
/*
|
||||||
|
#define RGB_DI_PIN D3
|
||||||
|
|
||||||
|
#define RGBLED_NUM 12 // Number of LEDs
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
* 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
|
||||||
|
|
||||||
@@ -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();
|
||||||
|
};
|
||||||
|
|
||||||
@@ -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
|
||||||
|
|
||||||
@@ -1,5 +1,3 @@
|
|||||||
|
|
||||||
|
|
||||||
# MCU name
|
# MCU name
|
||||||
#MCU = at90usb1287
|
#MCU = at90usb1287
|
||||||
MCU = atmega32u4
|
MCU = atmega32u4
|
||||||
@@ -36,41 +34,45 @@ 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
|
||||||
#
|
#
|
||||||
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 = preonic/rev2
|
DEFAULT_FOLDER = adkb96/rev1
|
||||||
@@ -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, e.g.
|
||||||
|
|
||||||
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.
|
`make PCBDOWN=yes atreus:default:avrdude`
|
||||||
|
|
||||||
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.
|
*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.
|
||||||
+48
-41
@@ -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
|
||||||
|
|
||||||
|
|
||||||
# Build Options
|
# Bootloader selection
|
||||||
# comment out to disable the options.
|
# Teensy halfkay
|
||||||
#
|
# Pro Micro caterina
|
||||||
#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
|
# Atmel DFU atmel-dfu
|
||||||
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
|
# LUFA DFU lufa-dfu
|
||||||
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
|
# QMK DFU qmk-dfu
|
||||||
CONSOLE_ENABLE = yes # Console for debug(+400)
|
# atmega32a bootloadHID
|
||||||
COMMAND_ENABLE = yes # Commands for debug and configuration
|
ifdef TEENSY2
|
||||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
BOOTLOADER = halfkay
|
||||||
# SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
|
OPT_DEFS += -DATREUS_TEENSY2
|
||||||
NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA
|
else
|
||||||
# BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
|
BOOTLOADER = caterina
|
||||||
# MIDI_ENABLE = YES # MIDI controls
|
OPT_DEFS += -DATREUS_ASTAR
|
||||||
UNICODE_ENABLE = YES # Unicode
|
ifdef PCBDOWN
|
||||||
# BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID
|
OPT_DEFS += -DPCBDOWN
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
USB = /dev/cu.usbmodem1411
|
|
||||||
|
# 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
|
||||||
|
# change yes to no to disable
|
||||||
|
#
|
||||||
|
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
|
||||||
|
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
|
||||||
|
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
|
||||||
|
CONSOLE_ENABLE = yes # Console for debug(+400)
|
||||||
|
COMMAND_ENABLE = yes # Commands for debug and configuration
|
||||||
|
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||||
|
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||||
|
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||||
|
NKRO_ENABLE = yes # USB Nkey Rollover
|
||||||
|
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default
|
||||||
|
RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
|
||||||
|
MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config)
|
||||||
|
UNICODE_ENABLE = yes # Unicode
|
||||||
|
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)
|
||||||
@@ -0,0 +1,217 @@
|
|||||||
|
/* 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 "rgblight.h"
|
||||||
|
|
||||||
|
const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
|
||||||
|
/*{row | col << 4}
|
||||||
|
| {x=0..224, y=0..64}
|
||||||
|
| | modifier
|
||||||
|
| | | */
|
||||||
|
{{1|(3<<4)}, {188, 16}, 0},
|
||||||
|
{{3|(3<<4)}, {187, 48}, 0},
|
||||||
|
{{4|(2<<4)}, {149, 64}, 0},
|
||||||
|
{{4|(1<<4)}, {112, 64}, 0},
|
||||||
|
{{3|(0<<4)}, {37, 48}, 0},
|
||||||
|
{{1|(0<<4)}, {38, 16}, 0}
|
||||||
|
};
|
||||||
|
#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();
|
||||||
|
}
|
||||||
@@ -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"
|
||||||
|
|
||||||
@@ -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
|
||||||
|
|
||||||
@@ -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}] }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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) {
|
||||||
|
}
|
||||||
|
|
||||||
@@ -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
|
||||||
@@ -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
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
# Boston Meetup 2019 Macropad
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
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).
|
||||||
@@ -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
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
#include "boston_meetup.h"
|
||||||
|
|
||||||
@@ -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"
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2012 Jun Wako <[email protected]>
|
||||||
|
|
||||||
|
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
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
# Boston Meetup Macropads
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
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).
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
|
||||||
|
DEFAULT_FOLDER = boston_meetup/2019
|
||||||
@@ -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
|
||||||
|
|||||||
@@ -29,8 +29,6 @@
|
|||||||
#include "quantum.h"
|
#include "quantum.h"
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <hal.h>
|
#include <hal.h>
|
||||||
#include "chtypes.h"
|
|
||||||
#include "ch.h"
|
|
||||||
|
|
||||||
static uint8_t i2c_address;
|
static uint8_t i2c_address;
|
||||||
|
|
||||||
@@ -44,6 +42,18 @@ static const I2CConfig i2cconfig = {
|
|||||||
0
|
0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static i2c_status_t chibios_to_qmk(const msg_t status) {
|
||||||
|
switch (status) {
|
||||||
|
case I2C_NO_ERROR:
|
||||||
|
return I2C_STATUS_SUCCESS;
|
||||||
|
case I2C_TIMEOUT:
|
||||||
|
return I2C_STATUS_TIMEOUT;
|
||||||
|
// I2C_BUS_ERROR, I2C_ARBITRATION_LOST, I2C_ACK_FAILURE, I2C_OVERRUN, I2C_PEC_ERROR, I2C_SMB_ALERT
|
||||||
|
default:
|
||||||
|
return I2C_STATUS_ERROR;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
__attribute__ ((weak))
|
__attribute__ ((weak))
|
||||||
void i2c_init(void)
|
void i2c_init(void)
|
||||||
{
|
{
|
||||||
@@ -59,34 +69,32 @@ void i2c_init(void)
|
|||||||
//i2cInit(); //This is invoked by halInit() so no need to redo it.
|
//i2cInit(); //This is invoked by halInit() so no need to redo it.
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is usually not needed
|
i2c_status_t i2c_start(uint8_t address)
|
||||||
uint8_t i2c_start(uint8_t address)
|
|
||||||
{
|
{
|
||||||
i2c_address = address;
|
i2c_address = address;
|
||||||
i2cStart(&I2C_DRIVER, &i2cconfig);
|
i2cStart(&I2C_DRIVER, &i2cconfig);
|
||||||
return 0;
|
return I2C_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t i2c_transmit(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout)
|
i2c_status_t i2c_transmit(uint8_t address, const uint8_t* data, uint16_t length, uint16_t timeout)
|
||||||
{
|
{
|
||||||
msg_t status = MSG_OK;
|
|
||||||
|
|
||||||
i2c_address = address;
|
i2c_address = address;
|
||||||
i2cStart(&I2C_DRIVER, &i2cconfig);
|
i2cStart(&I2C_DRIVER, &i2cconfig);
|
||||||
i2cAcquireBus(&I2C_DRIVER);
|
i2cAcquireBus(&I2C_DRIVER);
|
||||||
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 status;
|
return chibios_to_qmk(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_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)
|
||||||
{
|
{
|
||||||
i2c_address = address;
|
i2c_address = address;
|
||||||
i2cStart(&I2C_DRIVER, &i2cconfig);
|
i2cStart(&I2C_DRIVER, &i2cconfig);
|
||||||
return 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);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, 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)
|
||||||
{
|
{
|
||||||
i2c_address = devaddr;
|
i2c_address = devaddr;
|
||||||
i2cStart(&I2C_DRIVER, &i2cconfig);
|
i2cStart(&I2C_DRIVER, &i2cconfig);
|
||||||
@@ -98,19 +106,19 @@ uint8_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t l
|
|||||||
}
|
}
|
||||||
complete_packet[0] = regaddr;
|
complete_packet[0] = regaddr;
|
||||||
|
|
||||||
return 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);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_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)
|
||||||
{
|
{
|
||||||
i2c_address = devaddr;
|
i2c_address = devaddr;
|
||||||
i2cStart(&I2C_DRIVER, &i2cconfig);
|
i2cStart(&I2C_DRIVER, &i2cconfig);
|
||||||
return 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);
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is usually not needed. It releases the driver to allow pins to become GPIO again.
|
void i2c_stop(void)
|
||||||
uint8_t i2c_stop(void)
|
|
||||||
{
|
{
|
||||||
i2cStop(&I2C_DRIVER);
|
i2cStop(&I2C_DRIVER);
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2012,2013 Jun Wako <[email protected]>
|
||||||
|
|
||||||
|
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,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||||
|
)
|
||||||
|
};
|
||||||
@@ -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
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#include "quantum.h"
|
#include "quantum.h"
|
||||||
|
#include "command.h"
|
||||||
#include "action_pseudo_lut.h"
|
#include "action_pseudo_lut.h"
|
||||||
|
|
||||||
static uint8_t send_key_shift_bit[SHIFT_BIT_SIZE];
|
static uint8_t send_key_shift_bit[SHIFT_BIT_SIZE];
|
||||||
|
|||||||
+26
-24
@@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License
|
|||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef CONFIG_H
|
#pragma once
|
||||||
#define CONFIG_H
|
|
||||||
|
|
||||||
#include "config_common.h"
|
#include "config_common.h"
|
||||||
|
|
||||||
@@ -32,42 +31,43 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#define MATRIX_ROWS 6
|
#define MATRIX_ROWS 6
|
||||||
#define MATRIX_COLS 4
|
#define MATRIX_COLS 4
|
||||||
|
|
||||||
// ROWS: Top to bottom, COLS: Left to right
|
/*
|
||||||
|
* Keyboard Matrix Assignments
|
||||||
|
*
|
||||||
|
* Change this to how you wired your keyboard
|
||||||
|
* COLS: AVR pins used for columns, left to right
|
||||||
|
* ROWS: AVR pins used for rows, top to bottom
|
||||||
|
* DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
|
||||||
|
* ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
|
||||||
|
*
|
||||||
|
*/
|
||||||
#define MATRIX_ROW_PINS { D0, D1, D2, D3, D4, D5 }
|
#define MATRIX_ROW_PINS { D0, D1, D2, D3, D4, D5 }
|
||||||
#define MATRIX_COL_PINS { F0, F1, E6, C7 }
|
#define MATRIX_COL_PINS { F0, F1, E6, C7 }
|
||||||
#define UNUSED_PINS
|
#define UNUSED_PINS
|
||||||
|
|
||||||
#define BACKLIGHT_PIN F7
|
|
||||||
|
|
||||||
/* COL2ROW or ROW2COL */
|
/* COL2ROW or ROW2COL */
|
||||||
#define DIODE_DIRECTION COL2ROW
|
#define DIODE_DIRECTION COL2ROW
|
||||||
|
|
||||||
/* define if matrix has ghost */
|
/* Backlight configuration */
|
||||||
//#define MATRIX_HAS_GHOST
|
#define BACKLIGHT_PIN F7
|
||||||
|
#define BACKLIGHT_LEVELS 1
|
||||||
|
|
||||||
/* Set 0 if debouncing isn't needed */
|
/* Underlight configuration */
|
||||||
|
#define RGB_DI_PIN F6
|
||||||
|
#define RGBLED_NUM 4
|
||||||
|
#define RGBLIGHT_ANIMATIONS
|
||||||
|
|
||||||
|
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
|
||||||
#define DEBOUNCING_DELAY 5
|
#define DEBOUNCING_DELAY 5
|
||||||
|
|
||||||
|
/* define if matrix has ghost (lacks anti-ghosting diodes) */
|
||||||
|
//#define MATRIX_HAS_GHOST
|
||||||
|
|
||||||
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
||||||
//#define LOCKING_SUPPORT_ENABLE
|
//#define LOCKING_SUPPORT_ENABLE
|
||||||
/* Locking resynchronize hack */
|
/* Locking resynchronize hack */
|
||||||
#define LOCKING_RESYNC_ENABLE
|
#define LOCKING_RESYNC_ENABLE
|
||||||
|
|
||||||
/* Backlight configuration
|
|
||||||
*/
|
|
||||||
#define BACKLIGHT_LEVELS 4
|
|
||||||
|
|
||||||
/* Underlight configuration
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define RGB_DI_PIN F6
|
|
||||||
#define RGBLIGHT_ANIMATIONS
|
|
||||||
#define RGBLED_NUM 4 // Number of LEDs
|
|
||||||
#define RGBLIGHT_HUE_STEP 10
|
|
||||||
#define RGBLIGHT_SAT_STEP 17
|
|
||||||
#define RGBLIGHT_VAL_STEP 17
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 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 +86,6 @@ 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
|
/* Bootmagic Lite key configuration */
|
||||||
|
// #define BOOTMAGIC_LITE_ROW 0
|
||||||
|
// #define BOOTMAGIC_LITE_COLUMN 0
|
||||||
+27
-31
@@ -1,37 +1,33 @@
|
|||||||
|
|
||||||
|
/* Copyright 2019
|
||||||
|
*
|
||||||
|
* 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 "cospad.h"
|
#include "cospad.h"
|
||||||
#include "led.h"
|
|
||||||
|
|
||||||
extern inline void cospad_bl_led_on(void);
|
#ifdef BACKLIGHT_ENABLE
|
||||||
extern inline void cospad_bl_led_off(void);
|
|
||||||
extern inline void cospad_bl_led_togg(void);
|
|
||||||
|
|
||||||
void matrix_init_kb(void) {
|
void backlight_init_ports(void) {
|
||||||
// put your keyboard start-up code here
|
setPinOutput(F7);
|
||||||
// runs once when the firmware starts up
|
|
||||||
matrix_init_user();
|
|
||||||
led_init_ports();
|
|
||||||
};
|
|
||||||
|
|
||||||
void matrix_scan_kb(void) {
|
|
||||||
// put your looping keyboard code here
|
|
||||||
// runs every cycle (a lot)
|
|
||||||
matrix_scan_user();
|
|
||||||
};
|
|
||||||
|
|
||||||
void led_init_ports(void) {
|
|
||||||
// * Set our LED pins as output
|
|
||||||
DDRB |= (1<<2);
|
|
||||||
DDRF |= (1<<7);
|
|
||||||
// * Setting BL LEDs to init as off
|
|
||||||
PORTF |= (1<<7);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void led_set_kb(uint8_t usb_led) {
|
void backlight_set(uint8_t level) {
|
||||||
if (usb_led & (1<<USB_LED_NUM_LOCK)) {
|
writePin(F7, !!level);
|
||||||
// Turn numlock on
|
|
||||||
PORTB &= ~(1<<2);
|
|
||||||
} else {
|
|
||||||
// Turn numlock off
|
|
||||||
PORTB |= (1<<2);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void backlight_task(void) {
|
||||||
|
// do nothing - as default implementation of software PWM does not work
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif //BACKLIGHT_ENABLE
|
||||||
+67
-59
@@ -1,10 +1,32 @@
|
|||||||
#ifndef COSPAD_H
|
|
||||||
#define COSPAD_H
|
/* Copyright 2019
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#pragma once
|
||||||
|
|
||||||
#include "quantum.h"
|
#include "quantum.h"
|
||||||
|
#define ___ KC_NO
|
||||||
|
|
||||||
// readability
|
/* This a shortcut to help you visually see your layout.
|
||||||
#define XXX KC_NO
|
*
|
||||||
|
* The first section contains all of the arguments representing the physical
|
||||||
|
* layout of the board and position of the keys.
|
||||||
|
*
|
||||||
|
* The second converts the arguments into a two-dimensional array which
|
||||||
|
* represents the switch matrix.
|
||||||
|
*/
|
||||||
|
|
||||||
/* COSPAD ortho matrix layout
|
/* COSPAD ortho matrix layout
|
||||||
* ,-------------------.
|
* ,-------------------.
|
||||||
@@ -21,40 +43,6 @@
|
|||||||
* | 50 | 51 | 52 | 53 |
|
* | 50 | 51 | 52 | 53 |
|
||||||
* `-------------------'
|
* `-------------------'
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* COSPAD gamepad matrix layout
|
|
||||||
* ,-------------------.
|
|
||||||
* | 00 | 01 | 02 | 03 |
|
|
||||||
* |----|----|----|----|
|
|
||||||
* | 10 | 11 | 12 | 13 |
|
|
||||||
* |----|----|----|----|
|
|
||||||
* | 20 | 21 | 22 | |
|
|
||||||
* |----|----|----| 23 |
|
|
||||||
* | 30 | 31 | 32 | |
|
|
||||||
* |----|----|----|----|
|
|
||||||
* | 40 | 41 | 42 | 43 |
|
|
||||||
* |----|----|----|----|
|
|
||||||
* | 50 | 51 | 52 | 53 |
|
|
||||||
* `-------------------'
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* COSPAD numpad matrix layout
|
|
||||||
* ,-------------------.
|
|
||||||
* | 00 | 01 | 02 | 03 |
|
|
||||||
* |----|----|----|----|
|
|
||||||
* | 10 | 11 | 12 | 13 |
|
|
||||||
* |----|----|----|----|
|
|
||||||
* | 20 | 21 | 22 | |
|
|
||||||
* |----|----|----| 23 |
|
|
||||||
* | 30 | 31 | 32 | |
|
|
||||||
* |----|----|----|----|
|
|
||||||
* | 40 | 41 | 42 | |
|
|
||||||
* |----|----|----| 43 |
|
|
||||||
* | 50 | 52 | |
|
|
||||||
* `-------------------'
|
|
||||||
*/
|
|
||||||
// The first section contains all of the arguments
|
|
||||||
// The second converts the arguments into a two-dimensional array
|
|
||||||
#define LAYOUT_ortho_6x4( \
|
#define LAYOUT_ortho_6x4( \
|
||||||
k00, k01, k02, k03, \
|
k00, k01, k02, k03, \
|
||||||
k10, k11, k12, k13, \
|
k10, k11, k12, k13, \
|
||||||
@@ -72,6 +60,21 @@
|
|||||||
{k50, k51, k52, k53} \
|
{k50, k51, k52, k53} \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* COSPAD gamepad matrix layout
|
||||||
|
* ,-------------------.
|
||||||
|
* | 00 | 01 | 02 | 03 |
|
||||||
|
* |----|----|----|----|
|
||||||
|
* | 10 | 11 | 12 | 13 |
|
||||||
|
* |----|----|----|----|
|
||||||
|
* | 20 | 21 | 22 | |
|
||||||
|
* |----|----|----| 23 |
|
||||||
|
* | 30 | 31 | 32 | |
|
||||||
|
* |----|----|----|----|
|
||||||
|
* | 40 | 41 | 42 | 43 |
|
||||||
|
* |----|----|----|----|
|
||||||
|
* | 50 | 51 | 52 | 53 |
|
||||||
|
* `-------------------'
|
||||||
|
*/
|
||||||
#define LAYOUT_gamepad_6x4( \
|
#define LAYOUT_gamepad_6x4( \
|
||||||
k00, k01, k02, k03, \
|
k00, k01, k02, k03, \
|
||||||
k10, k11, k12, k13, \
|
k10, k11, k12, k13, \
|
||||||
@@ -84,11 +87,26 @@
|
|||||||
{k00, k01, k02, k03}, \
|
{k00, k01, k02, k03}, \
|
||||||
{k10, k11, k12, k13}, \
|
{k10, k11, k12, k13}, \
|
||||||
{k20, k21, k22, k23}, \
|
{k20, k21, k22, k23}, \
|
||||||
{k30, k31, k32, KC_NO}, \
|
{k30, k31, k32, ___}, \
|
||||||
{k40, k41, k42, k43}, \
|
{k40, k41, k42, k43}, \
|
||||||
{k50, k51, k52, k53} \
|
{k50, k51, k52, k53} \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* COSPAD numpad matrix layout
|
||||||
|
* ,-------------------.
|
||||||
|
* | 00 | 01 | 02 | 03 |
|
||||||
|
* |----|----|----|----|
|
||||||
|
* | 10 | 11 | 12 | 13 |
|
||||||
|
* |----|----|----|----|
|
||||||
|
* | 20 | 21 | 22 | |
|
||||||
|
* |----|----|----| 23 |
|
||||||
|
* | 30 | 31 | 32 | |
|
||||||
|
* |----|----|----|----|
|
||||||
|
* | 40 | 41 | 42 | |
|
||||||
|
* |----|----|----| 43 |
|
||||||
|
* | 50 | 52 | |
|
||||||
|
* `-------------------'
|
||||||
|
*/
|
||||||
#define LAYOUT_numpad_6x4( \
|
#define LAYOUT_numpad_6x4( \
|
||||||
k00, k01, k02, k03, \
|
k00, k01, k02, k03, \
|
||||||
k10, k11, k12, k13, \
|
k10, k11, k12, k13, \
|
||||||
@@ -98,25 +116,15 @@
|
|||||||
k50, k52, k43 \
|
k50, k52, k43 \
|
||||||
) \
|
) \
|
||||||
{ \
|
{ \
|
||||||
{k00, k01, k02, k03}, \
|
{k00, k01, k02, k03}, \
|
||||||
{k10, k11, k12, k13}, \
|
{k10, k11, k12, k13}, \
|
||||||
{k20, k21, k22, k23}, \
|
{k20, k21, k22, k23}, \
|
||||||
{k30, k31, k32, KC_NO}, \
|
{k30, k31, k32, ___}, \
|
||||||
{k40, k41, k42, k43}, \
|
{k40, k41, k42, k43}, \
|
||||||
{k50, KC_NO, k52, KC_NO} \
|
{k50, ___, k52, ___} \
|
||||||
}
|
}
|
||||||
void matrix_init_user(void);
|
|
||||||
void matrix_scan_user(void);
|
|
||||||
|
|
||||||
inline void cospad_bl_led_on(void) { PORTF &= ~(1<<7); }
|
// Add backwards compatibility for existing keymaps
|
||||||
inline void cospad_bl_led_off(void) { PORTF |= (1<<7); }
|
#define cospad_bl_led_on backlight_enable
|
||||||
|
#define cospad_bl_led_off backlight_disable
|
||||||
inline void cospad_bl_led_togg(void) {
|
#define cospad_bl_led_togg backlight_toggle
|
||||||
uint8_t bl_mask = PORTF&(1<<7);
|
|
||||||
if (bl_mask) {
|
|
||||||
PORTF &= ~(1<<7);
|
|
||||||
} else {
|
|
||||||
PORTF |= (1<<7);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
+52
-24
@@ -7,6 +7,7 @@
|
|||||||
"height": 6,
|
"height": 6,
|
||||||
"layouts": {
|
"layouts": {
|
||||||
"LAYOUT_numpad_6x4": {
|
"LAYOUT_numpad_6x4": {
|
||||||
|
"key_count": 21,
|
||||||
"layout": [
|
"layout": [
|
||||||
{"label":"Esc", "x":0, "y":0},
|
{"label":"Esc", "x":0, "y":0},
|
||||||
{"label":"Tab", "x":1, "y":0},
|
{"label":"Tab", "x":1, "y":0},
|
||||||
@@ -33,35 +34,62 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
"LAYOUT_gamepad_6x4": {
|
"LAYOUT_gamepad_6x4": {
|
||||||
|
"key_count": 23,
|
||||||
"layout": [
|
"layout": [
|
||||||
{"label":"k00", "x":5, "y":0},
|
{"label":"k00", "x":0, "y":0},
|
||||||
{"label":"k01", "x":5, "y":1},
|
{"label":"k01", "x":1, "y":0},
|
||||||
{"label":"k02", "x":5, "y":2},
|
{"label":"k02", "x":2, "y":0},
|
||||||
{"label":"k03", "x":5, "y":3},
|
{"label":"k03", "x":3, "y":0},
|
||||||
{"label":"k10", "x":4, "y":0},
|
{"label":"k10", "x":0, "y":1},
|
||||||
{"label":"k11", "x":4, "y":1},
|
{"label":"k11", "x":1, "y":1},
|
||||||
{"label":"k12", "x":4, "y":2},
|
{"label":"k12", "x":2, "y":1},
|
||||||
{"label":"k13", "x":4, "y":3},
|
{"label":"k13", "x":3, "y":1},
|
||||||
{"label":"k20", "x":3, "y":0},
|
{"label":"k20", "x":0, "y":2},
|
||||||
{"label":"k21", "x":3, "y":1},
|
{"label":"k21", "x":1, "y":2},
|
||||||
{"label":"k22", "x":3, "y":2},
|
{"label":"k22", "x":2, "y":2},
|
||||||
{"label":"k30", "x":2, "y":0},
|
{"label":"k30", "x":0, "y":3},
|
||||||
{"label":"k31", "x":2, "y":1},
|
{"label":"k31", "x":1, "y":3},
|
||||||
{"label":"k32", "x":2, "y":2},
|
{"label":"k32", "x":2, "y":3},
|
||||||
{"label":"k23", "x":2, "y":3, "w":2},
|
{"label":"k23", "x":3, "y":2, "h":2},
|
||||||
{"label":"k40", "x":1, "y":0},
|
{"label":"k40", "x":0, "y":4},
|
||||||
{"label":"k41", "x":1, "y":1},
|
{"label":"k41", "x":1, "y":4},
|
||||||
{"label":"k42", "x":1, "y":2},
|
{"label":"k42", "x":2, "y":4},
|
||||||
{"label":"k43", "x":1, "y":3},
|
{"label":"k43", "x":3, "y":4},
|
||||||
{"label":"k50", "x":0, "y":0},
|
{"label":"k50", "x":0, "y":5},
|
||||||
{"label":"k51", "x":0, "y":1},
|
{"label":"k51", "x":1, "y":5},
|
||||||
{"label":"k52", "x":0, "y":2},
|
{"label":"k52", "x":2, "y":5},
|
||||||
{"label":"k53", "x":0, "y":3}
|
{"label":"k53", "x":3, "y":5}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
"LAYOUT_ortho_6x4": {
|
"LAYOUT_ortho_6x4": {
|
||||||
"layout": [{"label":"Esc", "x":0, "y":0}, {"label":"Tab", "x":1, "y":0}, {"label":"Fn", "x":2, "y":0}, {"label":"Back", "x":3, "y":0}, {"label":"Num Lock", "x":0, "y":1}, {"label":"/", "x":1, "y":1}, {"label":"*", "x":2, "y":1}, {"label":"-", "x":3, "y":1}, {"label":"7", "x":0, "y":2}, {"label":"8", "x":1, "y":2}, {"label":"9", "x":2, "y":2}, {"label":"+", "x":3, "y":2}, {"label":"4", "x":0, "y":3}, {"label":"5", "x":1, "y":3}, {"label":"6", "x":2, "y":3}, {"x":3, "y":3}, {"label":"1", "x":0, "y":4}, {"label":"2", "x":1, "y":4}, {"label":"3", "x":2, "y":4}, {"label":"Enter", "x":3, "y":4}, {"label":"0", "x":0, "y":5}, {"x":1, "y":5}, {"label":".", "x":2, "y":5}, {"x":3, "y":5}]
|
"key_count": 24,
|
||||||
|
"layout": [
|
||||||
|
{"label":"k00", "x":0, "y":0},
|
||||||
|
{"label":"k01", "x":1, "y":0},
|
||||||
|
{"label":"k02", "x":2, "y":0},
|
||||||
|
{"label":"k03", "x":3, "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},
|
||||||
|
{"label":"k40", "x":0, "y":4},
|
||||||
|
{"label":"k41", "x":1, "y":4},
|
||||||
|
{"label":"k42", "x":2, "y":4},
|
||||||
|
{"label":"k43", "x":3, "y":4},
|
||||||
|
{"label":"k50", "x":0, "y":5},
|
||||||
|
{"label":"k51", "x":1, "y":5},
|
||||||
|
{"label":"k52", "x":2, "y":5},
|
||||||
|
{"label":"k53", "x":3, "y":5}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,80 +1,60 @@
|
|||||||
#include QMK_KEYBOARD_H
|
#include QMK_KEYBOARD_H
|
||||||
#include "led.h"
|
|
||||||
|
|
||||||
// Each layer gets a name for readability, which is then used in the keymap matrix below.
|
// 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.
|
// 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
|
// Layer names don't all need to be of the same length, obviously, and you can also skip them
|
||||||
// entirely and just use numbers.
|
// entirely and just use numbers.
|
||||||
#define _BL 0
|
enum layers {
|
||||||
#define _FL 1
|
_BL = 0,
|
||||||
|
_FL
|
||||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|
||||||
/* Keymap _BL: (Base Layer) Default Layer
|
|
||||||
* ,-------------------.
|
|
||||||
* |Esc |TAB | FN | BS |
|
|
||||||
* |----|----|----|----|
|
|
||||||
* | NL | / | * | - |
|
|
||||||
* |----|----|----|----|
|
|
||||||
* | 7 | 8 | 9 | |
|
|
||||||
* |----|----|----| + |
|
|
||||||
* | 4 | 5 | 6 | |
|
|
||||||
* |----|----|----|----|
|
|
||||||
* | 1 | 2 | 3 | |
|
|
||||||
* |----|----|----| En |
|
|
||||||
* | 0 | . | |
|
|
||||||
* `-------------------'
|
|
||||||
*/
|
|
||||||
|
|
||||||
[_BL] = LAYOUT_numpad_6x4(
|
|
||||||
KC_ESC, KC_TAB, MO(_FL), KC_BSPC, \
|
|
||||||
KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \
|
|
||||||
KC_P7, KC_P8, KC_P9, \
|
|
||||||
KC_P4, KC_P5, KC_P6, KC_PPLS, \
|
|
||||||
KC_P1, KC_P2, KC_P3, \
|
|
||||||
KC_P0, KC_PDOT, KC_PENT),
|
|
||||||
|
|
||||||
/* Keymap _FL: Function Layer
|
|
||||||
* ,-------------------.
|
|
||||||
* |RGBT|TAB | FN | BS |
|
|
||||||
* |----|----|----|----|
|
|
||||||
* |RGBM|RGBP|BTOG| - |
|
|
||||||
* |----|----|----|----|
|
|
||||||
* |HUD |HUI |BON | |
|
|
||||||
* |----|----|----| + |
|
|
||||||
* |SAD |SAI |BOFF| |
|
|
||||||
* |----|----|----|----|
|
|
||||||
* |VAD |VAS | 3 | |
|
|
||||||
* |----|----|----| En |
|
|
||||||
* | 0 |RST | |
|
|
||||||
* `-------------------'
|
|
||||||
*/
|
|
||||||
[_FL] = LAYOUT_numpad_6x4(
|
|
||||||
RGB_TOG, KC_TAB, KC_TRNS, KC_BSPC, \
|
|
||||||
RGB_MOD, RGB_M_P, BL_TOGG, KC_PMNS, \
|
|
||||||
RGB_HUD, RGB_HUI, BL_ON, \
|
|
||||||
RGB_SAD, RGB_SAI, BL_OFF, KC_PPLS, \
|
|
||||||
RGB_VAD, RGB_VAI, KC_P3, \
|
|
||||||
KC_P0, RESET, KC_PENT),
|
|
||||||
};
|
};
|
||||||
|
|
||||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
switch (keycode) {
|
/* Keymap _BL: (Base Layer) Default Layer
|
||||||
case BL_TOGG:
|
* ,-------------------.
|
||||||
if (record->event.pressed) {
|
* |Esc |TAB | FN | BS |
|
||||||
cospad_bl_led_togg();
|
* |----|----|----|----|
|
||||||
}
|
* | NL | / | * | - |
|
||||||
return false;
|
* |----|----|----|----|
|
||||||
case BL_ON:
|
* | 7 | 8 | 9 | |
|
||||||
if (record->event.pressed) {
|
* |----|----|----| + |
|
||||||
cospad_bl_led_on();
|
* | 4 | 5 | 6 | |
|
||||||
}
|
* |----|----|----|----|
|
||||||
return false;
|
* | 1 | 2 | 3 | |
|
||||||
case BL_OFF:
|
* |----|----|----| En |
|
||||||
if(record->event.pressed) {
|
* | 0 | . | |
|
||||||
cospad_bl_led_off();
|
* `-------------------'
|
||||||
}
|
*/
|
||||||
return false;
|
[_BL] = LAYOUT_numpad_6x4(
|
||||||
default:
|
KC_ESC, KC_TAB, MO(_FL), KC_BSPC, \
|
||||||
return true;
|
KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \
|
||||||
}
|
KC_P7, KC_P8, KC_P9, \
|
||||||
}
|
KC_P4, KC_P5, KC_P6, KC_PPLS, \
|
||||||
|
KC_P1, KC_P2, KC_P3, \
|
||||||
|
KC_P0, KC_PDOT, KC_PENT
|
||||||
|
),
|
||||||
|
|
||||||
|
/* Keymap _FL: Function Layer
|
||||||
|
* ,-------------------.
|
||||||
|
* |RGBT| | | |
|
||||||
|
* |----|----|----|----|
|
||||||
|
* |RGBM|RGBP|BTOG| |
|
||||||
|
* |----|----|----|----|
|
||||||
|
* |HUD |HUI |BON | |
|
||||||
|
* |----|----|----| |
|
||||||
|
* |SAD |SAI |BOFF| |
|
||||||
|
* |----|----|----|----|
|
||||||
|
* |VAD |VAS |BSTP| |
|
||||||
|
* |----|----|----| |
|
||||||
|
* | |RST | |
|
||||||
|
* `-------------------'
|
||||||
|
*/
|
||||||
|
[_FL] = LAYOUT_numpad_6x4(
|
||||||
|
RGB_TOG, _______, _______, _______, \
|
||||||
|
RGB_MOD, RGB_M_P, BL_TOGG, _______, \
|
||||||
|
RGB_HUD, RGB_HUI, BL_ON, \
|
||||||
|
RGB_SAD, RGB_SAI, BL_OFF, _______, \
|
||||||
|
RGB_VAD, RGB_VAI, BL_STEP, \
|
||||||
|
_______, RESET, _______
|
||||||
|
),
|
||||||
|
};
|
||||||
+29
-14
@@ -1,6 +1,5 @@
|
|||||||
|
|
||||||
# MCU name
|
# MCU name
|
||||||
#MCU = at90usb1287
|
|
||||||
MCU = atmega32u4
|
MCU = atmega32u4
|
||||||
|
|
||||||
# Processor frequency.
|
# Processor frequency.
|
||||||
@@ -40,27 +39,43 @@ F_USB = $(F_CPU)
|
|||||||
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 = atmel-dfu
|
||||||
|
|
||||||
|
|
||||||
# Boot Section Size in *bytes*
|
# Boot Section Size in *bytes*
|
||||||
# Teensy halfKay 512
|
# Teensy halfKay 512
|
||||||
# Teensy++ halfKay 1024
|
# Teensy++ halfKay 1024
|
||||||
# Atmel DFU loader 4096
|
# Atmel DFU loader 4096
|
||||||
# LUFA bootloader 4096
|
# LUFA bootloader 4096
|
||||||
# USBaspLoader 2048
|
# USBaspLoader 2048
|
||||||
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
# OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||||
|
|
||||||
|
|
||||||
# Build Options
|
# Build Options
|
||||||
# comment out to disable the options.
|
# comment out to disable the options.
|
||||||
#
|
#
|
||||||
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
|
BOOTMAGIC_ENABLE = lite # 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 = no # Console for debug(+400)
|
CONSOLE_ENABLE = no # Console for debug(+400)
|
||||||
COMMAND_ENABLE = no # Commands for debug and configuration
|
COMMAND_ENABLE = no # Commands for debug and configuration
|
||||||
NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||||
RGBLIGHT_ENABLE = yes # Enable keyboard underlight functionality (+4870)
|
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
|
||||||
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality (+1150)
|
BACKLIGHT_CUSTOM_DRIVER = yes
|
||||||
MIDI_ENABLE = no # MIDI controls
|
RGBLIGHT_ENABLE = yes # Enable keyboard underlight functionality (+4870)
|
||||||
AUDIO_ENABLE = no
|
MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config)
|
||||||
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
|
||||||
|
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)
|
||||||
|
|
||||||
|
|
||||||
|
LAYOUTS = numpad_6x4 ortho_6x4
|
||||||
@@ -27,7 +27,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
// #define MASTER_RIGHT
|
// #define MASTER_RIGHT
|
||||||
#define EE_HANDS
|
#define EE_HANDS
|
||||||
|
|
||||||
#define SSD1306OLED
|
// #define SSD1306OLED
|
||||||
|
|
||||||
#define USE_SERIAL_PD2
|
#define USE_SERIAL_PD2
|
||||||
|
|
||||||
@@ -48,3 +48,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#define B6_AUDIO
|
#define B6_AUDIO
|
||||||
// #define NO_MUSIC_MODE
|
// #define NO_MUSIC_MODE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#undef PRODUCT
|
||||||
|
#define PRODUCT Drashna Hacked Corne Keyboard
|
||||||
|
|
||||||
|
#define OLED_FONT_H "keyboards/crkbd/keymaps/drashna/glcdfont.c"
|
||||||
|
// #define OLED_FONT_WIDTH 5
|
||||||
|
// #define OLED_FONT_HEIGHT 7
|
||||||
|
|
||||||
|
#define TAPPING_TERM_PER_KEY
|
||||||
@@ -0,0 +1,240 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifdef __AVR__
|
||||||
|
#include <avr/io.h>
|
||||||
|
#include <avr/pgmspace.h>
|
||||||
|
#elif defined(ESP8266)
|
||||||
|
#include <pgmspace.h>
|
||||||
|
#else
|
||||||
|
#define PROGMEM
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Helidox 8x6 font with QMK Firmware Logo
|
||||||
|
// Online editor: http://teripom.x0.com/
|
||||||
|
|
||||||
|
const unsigned char font[] PROGMEM = {
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x3E, 0x5B, 0x4F, 0x5B, 0x3E, 0x00,
|
||||||
|
0x3E, 0x6B, 0x4F, 0x6B, 0x3E, 0x00,
|
||||||
|
0x1C, 0x3E, 0x7C, 0x3E, 0x1C, 0x00,
|
||||||
|
0x18, 0x3C, 0x7E, 0x3C, 0x18, 0x00,
|
||||||
|
0x1C, 0x57, 0x7D, 0x57, 0x1C, 0x00,
|
||||||
|
0x1C, 0x5E, 0x7F, 0x5E, 0x1C, 0x00,
|
||||||
|
0x00, 0x18, 0x3C, 0x18, 0x00, 0x00,
|
||||||
|
0xFF, 0xE7, 0xC3, 0xE7, 0xFF, 0x00,
|
||||||
|
0x00, 0x18, 0x24, 0x18, 0x00, 0x00,
|
||||||
|
0xFF, 0xE7, 0xDB, 0xE7, 0xFF, 0x00,
|
||||||
|
0x30, 0x48, 0x3A, 0x06, 0x0E, 0x00,
|
||||||
|
0x26, 0x29, 0x79, 0x29, 0x26, 0x00,
|
||||||
|
0x40, 0x7F, 0x05, 0x05, 0x07, 0x00,
|
||||||
|
0x40, 0x7F, 0x05, 0x25, 0x3F, 0x00,
|
||||||
|
0x5A, 0x3C, 0xE7, 0x3C, 0x5A, 0x00,
|
||||||
|
0x7F, 0x3E, 0x1C, 0x1C, 0x08, 0x00,
|
||||||
|
0x08, 0x1C, 0x1C, 0x3E, 0x7F, 0x00,
|
||||||
|
0x14, 0x22, 0x7F, 0x22, 0x14, 0x00,
|
||||||
|
0x5F, 0x5F, 0x00, 0x5F, 0x5F, 0x00,
|
||||||
|
0x06, 0x09, 0x7F, 0x01, 0x7F, 0x00,
|
||||||
|
0x00, 0x66, 0x89, 0x95, 0x6A, 0x00,
|
||||||
|
0x60, 0x60, 0x60, 0x60, 0x60, 0x00,
|
||||||
|
0x94, 0xA2, 0xFF, 0xA2, 0x94, 0x00,
|
||||||
|
0x08, 0x04, 0x7E, 0x04, 0x08, 0x00,
|
||||||
|
0x10, 0x20, 0x7E, 0x20, 0x10, 0x00,
|
||||||
|
0x08, 0x08, 0x2A, 0x1C, 0x08, 0x00,
|
||||||
|
0x08, 0x1C, 0x2A, 0x08, 0x08, 0x00,
|
||||||
|
0x1E, 0x10, 0x10, 0x10, 0x10, 0x00,
|
||||||
|
0x0C, 0x1E, 0x0C, 0x1E, 0x0C, 0x00,
|
||||||
|
0x30, 0x38, 0x3E, 0x38, 0x30, 0x00,
|
||||||
|
0x06, 0x0E, 0x3E, 0x0E, 0x06, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x5F, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x07, 0x00, 0x07, 0x00, 0x00,
|
||||||
|
0x14, 0x7F, 0x14, 0x7F, 0x14, 0x00,
|
||||||
|
0x24, 0x2A, 0x7F, 0x2A, 0x12, 0x00,
|
||||||
|
0x23, 0x13, 0x08, 0x64, 0x62, 0x00,
|
||||||
|
0x36, 0x49, 0x56, 0x20, 0x50, 0x00,
|
||||||
|
0x00, 0x08, 0x07, 0x03, 0x00, 0x00,
|
||||||
|
0x00, 0x1C, 0x22, 0x41, 0x00, 0x00,
|
||||||
|
0x00, 0x41, 0x22, 0x1C, 0x00, 0x00,
|
||||||
|
0x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x00,
|
||||||
|
0x08, 0x08, 0x3E, 0x08, 0x08, 0x00,
|
||||||
|
0x00, 0x80, 0x70, 0x30, 0x00, 0x00,
|
||||||
|
0x08, 0x08, 0x08, 0x08, 0x08, 0x00,
|
||||||
|
0x00, 0x00, 0x60, 0x60, 0x00, 0x00,
|
||||||
|
0x20, 0x10, 0x08, 0x04, 0x02, 0x00,
|
||||||
|
0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00,
|
||||||
|
0x00, 0x42, 0x7F, 0x40, 0x00, 0x00,
|
||||||
|
0x72, 0x49, 0x49, 0x49, 0x46, 0x00,
|
||||||
|
0x21, 0x41, 0x49, 0x4D, 0x33, 0x00,
|
||||||
|
0x18, 0x14, 0x12, 0x7F, 0x10, 0x00,
|
||||||
|
0x27, 0x45, 0x45, 0x45, 0x39, 0x00,
|
||||||
|
0x3C, 0x4A, 0x49, 0x49, 0x31, 0x00,
|
||||||
|
0x41, 0x21, 0x11, 0x09, 0x07, 0x00,
|
||||||
|
0x36, 0x49, 0x49, 0x49, 0x36, 0x00,
|
||||||
|
0x46, 0x49, 0x49, 0x29, 0x1E, 0x00,
|
||||||
|
0x00, 0x00, 0x14, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x40, 0x34, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x08, 0x14, 0x22, 0x41, 0x00,
|
||||||
|
0x14, 0x14, 0x14, 0x14, 0x14, 0x00,
|
||||||
|
0x00, 0x41, 0x22, 0x14, 0x08, 0x00,
|
||||||
|
0x02, 0x01, 0x59, 0x09, 0x06, 0x00,
|
||||||
|
0x3E, 0x41, 0x5D, 0x59, 0x4E, 0x00,
|
||||||
|
0x7C, 0x12, 0x11, 0x12, 0x7C, 0x00,
|
||||||
|
0x7F, 0x49, 0x49, 0x49, 0x36, 0x00,
|
||||||
|
0x3E, 0x41, 0x41, 0x41, 0x22, 0x00,
|
||||||
|
0x7F, 0x41, 0x41, 0x41, 0x3E, 0x00,
|
||||||
|
0x7F, 0x49, 0x49, 0x49, 0x41, 0x00,
|
||||||
|
0x7F, 0x09, 0x09, 0x09, 0x01, 0x00,
|
||||||
|
0x3E, 0x41, 0x41, 0x51, 0x73, 0x00,
|
||||||
|
0x7F, 0x08, 0x08, 0x08, 0x7F, 0x00,
|
||||||
|
0x00, 0x41, 0x7F, 0x41, 0x00, 0x00,
|
||||||
|
0x20, 0x40, 0x41, 0x3F, 0x01, 0x00,
|
||||||
|
0x7F, 0x08, 0x14, 0x22, 0x41, 0x00,
|
||||||
|
0x7F, 0x40, 0x40, 0x40, 0x40, 0x00,
|
||||||
|
0x7F, 0x02, 0x1C, 0x02, 0x7F, 0x00,
|
||||||
|
0x7F, 0x04, 0x08, 0x10, 0x7F, 0x00,
|
||||||
|
0x3E, 0x41, 0x41, 0x41, 0x3E, 0x00,
|
||||||
|
0x7F, 0x09, 0x09, 0x09, 0x06, 0x00,
|
||||||
|
0x3E, 0x41, 0x51, 0x21, 0x5E, 0x00,
|
||||||
|
0x7F, 0x09, 0x19, 0x29, 0x46, 0x00,
|
||||||
|
0x26, 0x49, 0x49, 0x49, 0x32, 0x00,
|
||||||
|
0x03, 0x01, 0x7F, 0x01, 0x03, 0x00,
|
||||||
|
0x3F, 0x40, 0x40, 0x40, 0x3F, 0x00,
|
||||||
|
0x1F, 0x20, 0x40, 0x20, 0x1F, 0x00,
|
||||||
|
0x3F, 0x40, 0x38, 0x40, 0x3F, 0x00,
|
||||||
|
0x63, 0x14, 0x08, 0x14, 0x63, 0x00,
|
||||||
|
0x03, 0x04, 0x78, 0x04, 0x03, 0x00,
|
||||||
|
0x61, 0x59, 0x49, 0x4D, 0x43, 0x00,
|
||||||
|
0x00, 0x7F, 0x41, 0x41, 0x41, 0x00,
|
||||||
|
0x02, 0x04, 0x08, 0x10, 0x20, 0x00,
|
||||||
|
0x00, 0x41, 0x41, 0x41, 0x7F, 0x00,
|
||||||
|
0x04, 0x02, 0x01, 0x02, 0x04, 0x00,
|
||||||
|
0x40, 0x40, 0x40, 0x40, 0x40, 0x00,
|
||||||
|
0x00, 0x03, 0x07, 0x08, 0x00, 0x00,
|
||||||
|
0x20, 0x54, 0x54, 0x78, 0x40, 0x00,
|
||||||
|
0x7F, 0x28, 0x44, 0x44, 0x38, 0x00,
|
||||||
|
0x38, 0x44, 0x44, 0x44, 0x28, 0x00,
|
||||||
|
0x38, 0x44, 0x44, 0x28, 0x7F, 0x00,
|
||||||
|
0x38, 0x54, 0x54, 0x54, 0x18, 0x00,
|
||||||
|
0x00, 0x08, 0x7E, 0x09, 0x02, 0x00,
|
||||||
|
0x18, 0x24, 0x24, 0x1C, 0x78, 0x00,
|
||||||
|
0x7F, 0x08, 0x04, 0x04, 0x78, 0x00,
|
||||||
|
0x00, 0x44, 0x7D, 0x40, 0x00, 0x00,
|
||||||
|
0x20, 0x40, 0x40, 0x3D, 0x00, 0x00,
|
||||||
|
0x7F, 0x10, 0x28, 0x44, 0x00, 0x00,
|
||||||
|
0x00, 0x41, 0x7F, 0x40, 0x00, 0x00,
|
||||||
|
0x7C, 0x04, 0x78, 0x04, 0x78, 0x00,
|
||||||
|
0x7C, 0x08, 0x04, 0x04, 0x78, 0x00,
|
||||||
|
0x38, 0x44, 0x44, 0x44, 0x38, 0x00,
|
||||||
|
0x7C, 0x18, 0x24, 0x24, 0x18, 0x00,
|
||||||
|
0x18, 0x24, 0x24, 0x18, 0x7C, 0x00,
|
||||||
|
0x7C, 0x08, 0x04, 0x04, 0x08, 0x00,
|
||||||
|
0x48, 0x54, 0x54, 0x54, 0x24, 0x00,
|
||||||
|
0x04, 0x04, 0x3F, 0x44, 0x24, 0x00,
|
||||||
|
0x3C, 0x40, 0x40, 0x20, 0x7C, 0x00,
|
||||||
|
0x1C, 0x20, 0x40, 0x20, 0x1C, 0x00,
|
||||||
|
0x3C, 0x40, 0x30, 0x40, 0x3C, 0x00,
|
||||||
|
0x44, 0x28, 0x10, 0x28, 0x44, 0x00,
|
||||||
|
0x4C, 0x90, 0x90, 0x90, 0x7C, 0x00,
|
||||||
|
0x44, 0x64, 0x54, 0x4C, 0x44, 0x00,
|
||||||
|
0x00, 0x08, 0x36, 0x41, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x77, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x41, 0x36, 0x08, 0x00, 0x00,
|
||||||
|
0x02, 0x01, 0x02, 0x04, 0x02, 0x00,
|
||||||
|
0x3C, 0x26, 0x23, 0x26, 0x3C, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0xC0, 0xE0,
|
||||||
|
0xF0, 0xF8, 0xF8, 0x18, 0x00, 0xC0,
|
||||||
|
0xF0, 0xFC, 0xFE, 0xFF, 0xFF, 0xFF,
|
||||||
|
0xFF, 0xFF, 0xFF, 0xFF, 0x7E, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x80, 0xC0, 0xE0, 0xE0,
|
||||||
|
0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0,
|
||||||
|
0xC0, 0x80, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x80, 0xC0, 0xE0, 0xE0, 0xE0, 0xE0,
|
||||||
|
0xE0, 0xE0, 0xE0, 0xE0, 0xC0, 0x80,
|
||||||
|
0x00, 0x00, 0x00, 0xE0, 0xE0, 0xC0,
|
||||||
|
0xC0, 0xE0, 0xE0, 0xE0, 0xE0, 0x00,
|
||||||
|
0x00, 0xE0, 0xE0, 0xC0, 0xC0, 0xE0,
|
||||||
|
0xE0, 0xE0, 0xE0, 0xE0, 0xC0, 0x80,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x80, 0xC0,
|
||||||
|
0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0,
|
||||||
|
0xE0, 0xE0, 0xC0, 0x80, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0xE0, 0xF0, 0xF0, 0xF0, 0xE0, 0xEC,
|
||||||
|
0xEE, 0xF7, 0xF3, 0x70, 0x20, 0x00,
|
||||||
|
0x7C, 0x7C, 0x7C, 0x7E, 0x00, 0x7E,
|
||||||
|
0x7E, 0x7E, 0x7F, 0x7F, 0x7F, 0x00,
|
||||||
|
0x00, 0x80, 0xC0, 0xE0, 0x7E, 0x5B,
|
||||||
|
0x4F, 0x5B, 0xFE, 0xC0, 0x00, 0x00,
|
||||||
|
0xC0, 0x00, 0xDC, 0xD7, 0xDE, 0xDE,
|
||||||
|
0xDE, 0xD7, 0xDC, 0x00, 0xC0, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0xF8, 0xFC, 0xFE,
|
||||||
|
0xFF, 0xE0, 0x00, 0xFF, 0xFF, 0xFF,
|
||||||
|
0xFF, 0xFF, 0xFF, 0x80, 0xFF, 0xFF,
|
||||||
|
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
||||||
|
0xFF, 0x1F, 0x07, 0x01, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0xFF, 0xFF, 0xFF, 0x81, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x81,
|
||||||
|
0xC3, 0xC3, 0xC3, 0x00, 0x00, 0xFF,
|
||||||
|
0xFF, 0xFF, 0x81, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x81, 0xFF, 0xFF,
|
||||||
|
0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF,
|
||||||
|
0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0xFF, 0xFF, 0xFF, 0x01, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF,
|
||||||
|
0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF,
|
||||||
|
0x9D, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C,
|
||||||
|
0x1C, 0x9D, 0xDF, 0xDF, 0xDF, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x0F, 0x1F, 0x3F, 0x7F, 0x7F, 0x7F,
|
||||||
|
0x7F, 0x7F, 0x3F, 0x1E, 0x0C, 0x00,
|
||||||
|
0x1F, 0x1F, 0x1F, 0x3F, 0x00, 0x3F,
|
||||||
|
0x3F, 0x3F, 0x7F, 0x7F, 0x7F, 0x00,
|
||||||
|
0x30, 0x7B, 0x7F, 0x78, 0x30, 0x20,
|
||||||
|
0x20, 0x30, 0x78, 0x7F, 0x3B, 0x00,
|
||||||
|
0x03, 0x00, 0x0F, 0x7F, 0x0F, 0x0F,
|
||||||
|
0x0F, 0x7F, 0x0F, 0x00, 0x03, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x03, 0x0F, 0x1F,
|
||||||
|
0x3F, 0x3F, 0x3F, 0x3F, 0x1F, 0x1F,
|
||||||
|
0x3F, 0x3F, 0x7F, 0x7F, 0x7F, 0x3F,
|
||||||
|
0x3F, 0x1F, 0x3F, 0x7F, 0x7F, 0x7F,
|
||||||
|
0x7F, 0x7C, 0x78, 0x78, 0x38, 0x1C,
|
||||||
|
0x0F, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x01, 0x03, 0x07, 0x07,
|
||||||
|
0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
|
||||||
|
0x03, 0x01, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x01, 0x03, 0x07, 0x07, 0x07, 0x07,
|
||||||
|
0x07, 0x07, 0x07, 0x07, 0x03, 0x01,
|
||||||
|
0x00, 0x00, 0x00, 0x07, 0x07, 0x07,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x07, 0x07, 0x07, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x07, 0x07,
|
||||||
|
0x07, 0x00, 0x00, 0x00, 0x01, 0x03,
|
||||||
|
0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
|
||||||
|
0x07, 0x07, 0x03, 0x01, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
|
};
|
||||||
@@ -7,6 +7,9 @@
|
|||||||
#ifdef SSD1306OLED
|
#ifdef SSD1306OLED
|
||||||
#include "ssd1306.h"
|
#include "ssd1306.h"
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef OLED_DRIVER_ENABLE
|
||||||
|
#include "oled_driver.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
extern keymap_config_t keymap_config;
|
extern keymap_config_t keymap_config;
|
||||||
extern uint8_t is_master;
|
extern uint8_t is_master;
|
||||||
@@ -288,3 +291,123 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef OLED_DRIVER_ENABLE
|
||||||
|
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
||||||
|
if (is_master) {
|
||||||
|
return OLED_ROTATION_270;
|
||||||
|
} else {
|
||||||
|
return rotation;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void render_crkbd_logo(void) {
|
||||||
|
static const char PROGMEM crkbd_logo[] = {
|
||||||
|
0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94,
|
||||||
|
0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4,
|
||||||
|
0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4,
|
||||||
|
0};
|
||||||
|
oled_write_P(crkbd_logo, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void render_status(void) {
|
||||||
|
|
||||||
|
oled_write_P(PSTR("Layer"), false);
|
||||||
|
switch (biton32(layer_state)) {
|
||||||
|
case 0:
|
||||||
|
oled_write_P(PSTR("Base "), false);
|
||||||
|
break;
|
||||||
|
case _RAISE:
|
||||||
|
oled_write_P(PSTR("Raise"), false);
|
||||||
|
break;
|
||||||
|
case _LOWER:
|
||||||
|
oled_write_P(PSTR("Lower"), false);
|
||||||
|
break;
|
||||||
|
case _ADJUST:
|
||||||
|
oled_write_P(PSTR("Adjst"), false);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
oled_write_P(PSTR("Unkn "), false);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
oled_write_P(PSTR("Lyout"), false);
|
||||||
|
switch (biton32(default_layer_state)) {
|
||||||
|
case _QWERTY:
|
||||||
|
oled_write_P(PSTR("QWRTY"), false);
|
||||||
|
break;
|
||||||
|
case _COLEMAK:
|
||||||
|
oled_write_P(PSTR("COLMK"), false);
|
||||||
|
break;
|
||||||
|
case _DVORAK:
|
||||||
|
oled_write_P(PSTR("DVRAK"), false);
|
||||||
|
break;
|
||||||
|
case _WORKMAN:
|
||||||
|
oled_write_P(PSTR("WRKMN"), false);
|
||||||
|
break;
|
||||||
|
case _NORMAN:
|
||||||
|
oled_write_P(PSTR("NORMN"), false);
|
||||||
|
break;
|
||||||
|
case _MALTRON:
|
||||||
|
oled_write_P(PSTR("MLTRN"), false);
|
||||||
|
break;
|
||||||
|
case _EUCALYN:
|
||||||
|
oled_write_P(PSTR("ECLYN"), false);
|
||||||
|
break;
|
||||||
|
case _CARPLAX:
|
||||||
|
oled_write_P(PSTR("CRPLX"), false);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t modifiers = get_mods();
|
||||||
|
uint8_t one_shot = get_oneshot_mods();
|
||||||
|
|
||||||
|
oled_write_P(PSTR("Mods:"), false);
|
||||||
|
oled_write_P( (modifiers & MOD_MASK_CTRL || one_shot & MOD_MASK_CTRL ) ? PSTR(" CTL ") : PSTR(" "), false);
|
||||||
|
oled_write_P( (modifiers & MOD_MASK_GUI || one_shot & MOD_MASK_GUI ) ? PSTR(" GUI ") : PSTR(" "), false);
|
||||||
|
oled_write_P( (modifiers & MOD_MASK_ALT || one_shot & MOD_MASK_ALT ) ? PSTR(" ALT ") : PSTR(" "), false);
|
||||||
|
oled_write_P( (modifiers & MOD_MASK_SHIFT || one_shot & MOD_MASK_SHIFT) ? PSTR(" SFT ") : PSTR(" "), false);
|
||||||
|
|
||||||
|
|
||||||
|
oled_write_P(PSTR("BTMGK"), false);
|
||||||
|
static const char PROGMEM mode_logo[4][4] = {
|
||||||
|
{0x95,0x96,0x0a,0},
|
||||||
|
{0xb5,0xb6,0x0a,0},
|
||||||
|
{0x97,0x98,0x0a,0},
|
||||||
|
{0xb7,0xb8,0x0a,0} };
|
||||||
|
|
||||||
|
if (keymap_config.swap_lalt_lgui != false) {
|
||||||
|
oled_write_P(mode_logo[0], false);
|
||||||
|
oled_write_P(mode_logo[1], false);
|
||||||
|
} else {
|
||||||
|
oled_write_P(mode_logo[2], false);
|
||||||
|
oled_write_P(mode_logo[3], false);
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t led_usb_state = host_keyboard_leds();
|
||||||
|
oled_write_P(PSTR("Lock:"), false);
|
||||||
|
oled_write_P(led_usb_state & (1<<USB_LED_NUM_LOCK) ? PSTR(" NUM ") : PSTR(" "), false);
|
||||||
|
oled_write_P(led_usb_state & (1<<USB_LED_CAPS_LOCK) ? PSTR(" CAPS") : PSTR(" "), false);
|
||||||
|
oled_write_P(led_usb_state & (1<<USB_LED_SCROLL_LOCK) ? PSTR(" SCRL") : PSTR(" "), false);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void oled_task_user(void) {
|
||||||
|
if (is_master) {
|
||||||
|
render_status(); // Renders the current keyboard state (layer, lock, caps, scroll, etc)
|
||||||
|
} else {
|
||||||
|
render_crkbd_logo();
|
||||||
|
oled_scroll_left(); // Turns on scrolling
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
uint16_t get_tapping_term(uint16_t keycode) {
|
||||||
|
switch (keycode) {
|
||||||
|
case ALT_T(KC_A):
|
||||||
|
return TAPPING_TERM + 100;
|
||||||
|
default:
|
||||||
|
return TAPPING_TERM;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,31 +3,24 @@
|
|||||||
# 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
|
||||||
#
|
#
|
||||||
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 = no # Console for debug(+400)
|
CONSOLE_ENABLE = no # Console for debug(+400)
|
||||||
COMMAND_ENABLE = no # Commands for debug and configuration
|
COMMAND_ENABLE = no # Commands for debug and configuration
|
||||||
NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
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 = no # Enable keyboard backlight functionality
|
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
|
||||||
MIDI_ENABLE = no # MIDI controls
|
MIDI_ENABLE = no # MIDI controls
|
||||||
AUDIO_ENABLE = no # 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 = yes # Enable WS2812 RGB underlight.
|
RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight.
|
||||||
SWAP_HANDS_ENABLE = no # Enable one-hand typing
|
SWAP_HANDS_ENABLE = no # Enable one-hand typing
|
||||||
|
RGBLIGHT_STARTUP_ANIMATION = yes
|
||||||
|
|
||||||
# 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
|
||||||
|
|
||||||
BOOTLOADER = qmk-dfu
|
BOOTLOADER = qmk-dfu
|
||||||
|
|
||||||
# If you want to change the display of OLED, you need to change here
|
OLED_DRIVER_ENABLE = yes
|
||||||
SRC += ./lib/glcdfont.c \
|
|
||||||
./lib/logo_reader.c \
|
|
||||||
# ./lib/rgb_state_reader.c \
|
|
||||||
# ./lib/keylogger.c \
|
|
||||||
# ./lib/host_led_state_reader.c \
|
|
||||||
# ./lib/mode_icon_reader.c \
|
|
||||||
# ./lib/layer_state_reader.c \
|
|
||||||
# ./lib/timelogger.c \
|
|
||||||
+67
-125
@@ -55,133 +55,75 @@ void led_set_kb(uint8_t usb_led) {
|
|||||||
* | {x=0..224, y=0..64} physical layout
|
* | {x=0..224, y=0..64} physical layout
|
||||||
* | | | modifier
|
* | | | modifier
|
||||||
* | | | */
|
* | | | */
|
||||||
const rgb_led g_rgb_leds_left[27] = {
|
#define RGB_MATRIX_LEFT_LEDS \
|
||||||
//LEFT
|
{ { 0xFF }, { 85, 16 }, 0 }, /* 1 */ \
|
||||||
{ { 0xFF }, { 85, 16 }, 0 }, // 1
|
{ { 0xFF }, { 50, 13 }, 0 }, /* 2 */ \
|
||||||
{ { 0xFF }, { 50, 13 }, 0 }, // 2
|
{ { 0xFF }, { 16, 20 }, 0 }, /* 3 */ \
|
||||||
{ { 0xFF }, { 16, 20 }, 0 }, // 3
|
{ { 0xFF }, { 16, 38 }, 0 }, /* 4 */ \
|
||||||
{ { 0xFF }, { 16, 38 }, 0 }, // 4
|
{ { 0xFF }, { 50, 48 }, 0 }, /* 5 */ \
|
||||||
{ { 0xFF }, { 50, 48 }, 0 }, // 5
|
{ { 0xFF }, { 85, 52 }, 0 }, /* 6 */ \
|
||||||
{ { 0xFF }, { 85, 52 }, 0 }, // 6
|
{ { 3 | ( 5 << 4 ) }, { 95, 63 }, 1 }, /* 7 */ \
|
||||||
|
{ { 2 | ( 5 << 4 ) }, { 85, 39 }, 0 }, /* 8 */ \
|
||||||
|
{ { 1 | ( 5 << 4 ) }, { 85, 21 }, 0 }, /* 9 */ \
|
||||||
|
{ { 0 | ( 5 << 4 ) }, { 85, 4 }, 0 }, /* 10 */ \
|
||||||
|
{ { 0 | ( 4 << 4 ) }, { 68, 02 }, 0 }, /* 11 */ \
|
||||||
|
{ { 1 | ( 4 << 4 ) }, { 68, 19 }, 0 }, /* 12 */ \
|
||||||
|
{ { 2 | ( 4 << 4 ) }, { 68, 37 }, 0 }, /* 13 */ \
|
||||||
|
{ { 3 | ( 4 << 4 ) }, { 80, 58 }, 1 }, /* 14 */ \
|
||||||
|
{ { 3 | ( 3 << 4 ) }, { 60, 55 }, 1 }, /* 15 */ \
|
||||||
|
{ { 2 | ( 3 << 4 ) }, { 50, 35 }, 0 }, /* 16 */ \
|
||||||
|
{ { 1 | ( 3 << 4 ) }, { 50, 13 }, 0 }, /* 17 */ \
|
||||||
|
{ { 0 | ( 3 << 4 ) }, { 50, 0 }, 0 }, /* 18 */ \
|
||||||
|
{ { 0 | ( 2 << 4 ) }, { 33, 3 }, 0 }, /* 19 */ \
|
||||||
|
{ { 1 | ( 2 << 4 ) }, { 33, 20 }, 0 }, /* 20 */ \
|
||||||
|
{ { 2 | ( 2 << 4 ) }, { 33, 37 }, 0 }, /* 21 */ \
|
||||||
|
{ { 2 | ( 1 << 4 ) }, { 16, 42 }, 0 }, /* 22 */ \
|
||||||
|
{ { 1 | ( 1 << 4 ) }, { 16, 24 }, 0 }, /* 23 */ \
|
||||||
|
{ { 0 | ( 1 << 4 ) }, { 16, 7 }, 0 }, /* 24 */ \
|
||||||
|
{ { 0 | ( 0 << 4 ) }, { 0, 7 }, 1 }, /* 25 */ \
|
||||||
|
{ { 1 | ( 0 << 4 ) }, { 0, 24 }, 1 }, /* 26 */ \
|
||||||
|
{ { 2 | ( 0 << 4 ) }, { 0, 41 }, 1 }, /* 27 */
|
||||||
|
|
||||||
{ { 3 | ( 5 << 4 ) }, { 95, 63 }, 1 }, // 7
|
#define RGB_MATRIX_RIGHT_LEDS \
|
||||||
{ { 2 | ( 5 << 4 ) }, { 85, 39 }, 0 }, // 8
|
{ { 0xFF }, { 139, 16 }, 0 }, /* 1 */ \
|
||||||
{ { 1 | ( 5 << 4 ) }, { 85, 21 }, 0 }, // 9
|
{ { 0xFF }, { 174, 13 }, 0 }, /* 2 */ \
|
||||||
{ { 0 | ( 5 << 4 ) }, { 85, 4 }, 0 }, //10
|
{ { 0xFF }, { 208, 20 }, 0 }, /* 3 */ \
|
||||||
{ { 0 | ( 4 << 4 ) }, { 68, 02 }, 0 }, //11
|
{ { 0xFF }, { 208, 38 }, 0 }, /* 4 */ \
|
||||||
{ { 1 | ( 4 << 4 ) }, { 68, 19 }, 0 }, //12
|
{ { 0xFF }, { 174, 48 }, 0 }, /* 5 */ \
|
||||||
{ { 2 | ( 4 << 4 ) }, { 68, 37 }, 0 }, //13
|
{ { 0xFF }, { 139, 52 }, 0 }, /* 6 */ \
|
||||||
{ { 3 | ( 4 << 4 ) }, { 80, 58 }, 1 }, //14
|
{ { 7 | ( 5 << 4 ) }, { 129, 63 }, 1 }, /* 7 */ \
|
||||||
{ { 3 | ( 3 << 4 ) }, { 60, 55 }, 1 }, //15
|
{ { 6 | ( 5 << 4 ) }, { 139, 39 }, 0 }, /* 8 */ \
|
||||||
{ { 2 | ( 3 << 4 ) }, { 50, 35 }, 0 }, //16
|
{ { 5 | ( 5 << 4 ) }, { 139, 21 }, 0 }, /* 9 */ \
|
||||||
{ { 1 | ( 3 << 4 ) }, { 50, 13 }, 0 }, //17
|
{ { 4 | ( 5 << 4 ) }, { 139, 4 }, 0 }, /* 10 */ \
|
||||||
{ { 0 | ( 3 << 4 ) }, { 50, 0 }, 0 }, //18
|
{ { 4 | ( 4 << 4 ) }, { 156, 02 }, 0 }, /* 11 */ \
|
||||||
{ { 0 | ( 2 << 4 ) }, { 33, 3 }, 0 }, //19
|
{ { 5 | ( 4 << 4 ) }, { 156, 19 }, 0 }, /* 12 */ \
|
||||||
{ { 1 | ( 2 << 4 ) }, { 33, 20 }, 0 }, //20
|
{ { 6 | ( 4 << 4 ) }, { 156, 37 }, 0 }, /* 13 */ \
|
||||||
{ { 2 | ( 2 << 4 ) }, { 33, 37 }, 0 }, //21
|
{ { 7 | ( 4 << 4 ) }, { 144, 58 }, 1 }, /* 14 */ \
|
||||||
{ { 2 | ( 1 << 4 ) }, { 16, 42 }, 0 }, //22
|
{ { 7 | ( 3 << 4 ) }, { 164, 55 }, 1 }, /* 15 */ \
|
||||||
{ { 1 | ( 1 << 4 ) }, { 16, 24 }, 0 }, //23
|
{ { 6 | ( 3 << 4 ) }, { 174, 35 }, 0 }, /* 16 */ \
|
||||||
{ { 0 | ( 1 << 4 ) }, { 16, 7 }, 0 }, //24
|
{ { 5 | ( 3 << 4 ) }, { 174, 13 }, 0 }, /* 17 */ \
|
||||||
{ { 0 | ( 0 << 4 ) }, { 0, 7 }, 1 }, //25
|
{ { 4 | ( 3 << 4 ) }, { 174, 0 }, 0 }, /* 18 */ \
|
||||||
{ { 1 | ( 0 << 4 ) }, { 0, 24 }, 1 }, //26
|
{ { 4 | ( 2 << 4 ) }, { 191, 3 }, 0 }, /* 19 */ \
|
||||||
{ { 2 | ( 0 << 4 ) }, { 0, 41 }, 1 }, //27
|
{ { 5 | ( 2 << 4 ) }, { 191, 20 }, 0 }, /* 20 */ \
|
||||||
};
|
{ { 6 | ( 2 << 4 ) }, { 191, 37 }, 0 }, /* 21 */ \
|
||||||
const rgb_led g_rgb_leds_right[27] = {
|
{ { 6 | ( 1 << 4 ) }, { 208, 42 }, 0 }, /* 22 */ \
|
||||||
//RIGHT
|
{ { 5 | ( 1 << 4 ) }, { 208, 24 }, 0 }, /* 23 */ \
|
||||||
{ { 0xFF }, { 139, 16 }, 0 }, // 1
|
{ { 4 | ( 1 << 4 ) }, { 208, 7 }, 0 }, /* 24 */ \
|
||||||
{ { 0xFF }, { 174, 13 }, 0 }, // 2
|
{ { 4 | ( 0 << 4 ) }, { 224, 7 }, 1 }, /* 25 */ \
|
||||||
{ { 0xFF }, { 208, 20 }, 0 }, // 3
|
{ { 5 | ( 0 << 4 ) }, { 224, 24 }, 1 }, /* 26 */ \
|
||||||
{ { 0xFF }, { 208, 38 }, 0 }, // 4
|
{ { 6 | ( 0 << 4 ) }, { 224, 41 }, 1 }, /* 27 */
|
||||||
{ { 0xFF }, { 174, 48 }, 0 }, // 5
|
|
||||||
{ { 0xFF }, { 139, 52 }, 0 }, // 6
|
|
||||||
|
|
||||||
{ { 7 | ( 5 << 4 ) }, { 129, 63 }, 1 }, // 7
|
#ifdef RGB_MATRIX_SPLIT_RIGHT
|
||||||
{ { 6 | ( 5 << 4 ) }, { 139, 39 }, 0 }, // 8
|
const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
|
||||||
{ { 5 | ( 5 << 4 ) }, { 139, 21 }, 0 }, // 9
|
RGB_MATRIX_RIGHT_LEDS
|
||||||
{ { 4 | ( 5 << 4 ) }, { 139, 4 }, 0 }, //10
|
RGB_MATRIX_LEFT_LEDS
|
||||||
{ { 4 | ( 4 << 4 ) }, { 156, 02 }, 0 }, //11
|
};
|
||||||
{ { 5 | ( 4 << 4 ) }, { 156, 19 }, 0 }, //12
|
#else
|
||||||
{ { 6 | ( 4 << 4 ) }, { 156, 37 }, 0 }, //13
|
const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
|
||||||
{ { 7 | ( 4 << 4 ) }, { 144, 58 }, 1 }, //14
|
RGB_MATRIX_LEFT_LEDS
|
||||||
{ { 7 | ( 3 << 4 ) }, { 164, 55 }, 1 }, //15
|
RGB_MATRIX_RIGHT_LEDS
|
||||||
{ { 6 | ( 3 << 4 ) }, { 174, 35 }, 0 }, //16
|
};
|
||||||
{ { 5 | ( 3 << 4 ) }, { 174, 13 }, 0 }, //17
|
#endif
|
||||||
{ { 4 | ( 3 << 4 ) }, { 174, 0 }, 0 }, //18
|
|
||||||
{ { 4 | ( 2 << 4 ) }, { 191, 3 }, 0 }, //19
|
|
||||||
{ { 5 | ( 2 << 4 ) }, { 191, 20 }, 0 }, //20
|
|
||||||
{ { 6 | ( 2 << 4 ) }, { 191, 37 }, 0 }, //21
|
|
||||||
{ { 6 | ( 1 << 4 ) }, { 208, 42 }, 0 }, //22
|
|
||||||
{ { 5 | ( 1 << 4 ) }, { 208, 24 }, 0 }, //23
|
|
||||||
{ { 4 | ( 1 << 4 ) }, { 208, 7 }, 0 }, //24
|
|
||||||
{ { 4 | ( 0 << 4 ) }, { 224, 7 }, 1 }, //25
|
|
||||||
{ { 5 | ( 0 << 4 ) }, { 224, 24 }, 1 }, //26
|
|
||||||
{ { 6 | ( 0 << 4 ) }, { 224, 41 }, 1 }, //27
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
|
|
||||||
|
|
||||||
//LEFT
|
|
||||||
{ { 0xFF }, { 85, 16 }, 0 }, // 1
|
|
||||||
{ { 0xFF }, { 50, 13 }, 0 }, // 2
|
|
||||||
{ { 0xFF }, { 16, 20 }, 0 }, // 3
|
|
||||||
{ { 0xFF }, { 16, 38 }, 0 }, // 4
|
|
||||||
{ { 0xFF }, { 50, 48 }, 0 }, // 5
|
|
||||||
{ { 0xFF }, { 85, 52 }, 0 }, // 6
|
|
||||||
|
|
||||||
{ { 3 | ( 5 << 4 ) }, { 95, 63 }, 1 }, // 7
|
|
||||||
{ { 2 | ( 5 << 4 ) }, { 85, 39 }, 0 }, // 8
|
|
||||||
{ { 1 | ( 5 << 4 ) }, { 85, 21 }, 0 }, // 9
|
|
||||||
{ { 0 | ( 5 << 4 ) }, { 85, 4 }, 0 }, //10
|
|
||||||
{ { 0 | ( 4 << 4 ) }, { 68, 02 }, 0 }, //11
|
|
||||||
{ { 1 | ( 4 << 4 ) }, { 68, 19 }, 0 }, //12
|
|
||||||
{ { 2 | ( 4 << 4 ) }, { 68, 37 }, 0 }, //13
|
|
||||||
{ { 3 | ( 4 << 4 ) }, { 80, 58 }, 1 }, //14
|
|
||||||
{ { 3 | ( 3 << 4 ) }, { 60, 55 }, 1 }, //15
|
|
||||||
{ { 2 | ( 3 << 4 ) }, { 50, 35 }, 0 }, //16
|
|
||||||
{ { 1 | ( 3 << 4 ) }, { 50, 13 }, 0 }, //17
|
|
||||||
{ { 0 | ( 3 << 4 ) }, { 50, 0 }, 0 }, //18
|
|
||||||
{ { 0 | ( 2 << 4 ) }, { 33, 3 }, 0 }, //19
|
|
||||||
{ { 1 | ( 2 << 4 ) }, { 33, 20 }, 0 }, //20
|
|
||||||
{ { 2 | ( 2 << 4 ) }, { 33, 37 }, 0 }, //21
|
|
||||||
{ { 2 | ( 1 << 4 ) }, { 16, 42 }, 0 }, //22
|
|
||||||
{ { 1 | ( 1 << 4 ) }, { 16, 24 }, 0 }, //23
|
|
||||||
{ { 0 | ( 1 << 4 ) }, { 16, 7 }, 0 }, //24
|
|
||||||
{ { 0 | ( 0 << 4 ) }, { 0, 7 }, 1 }, //25
|
|
||||||
{ { 1 | ( 0 << 4 ) }, { 0, 24 }, 1 }, //26
|
|
||||||
{ { 2 | ( 0 << 4 ) }, { 0, 41 }, 1 }, //27
|
|
||||||
|
|
||||||
//RIGHT
|
|
||||||
{ { 0xFF }, { 139, 16 }, 0 }, // 1
|
|
||||||
{ { 0xFF }, { 174, 13 }, 0 }, // 2
|
|
||||||
{ { 0xFF }, { 208, 20 }, 0 }, // 3
|
|
||||||
{ { 0xFF }, { 208, 38 }, 0 }, // 4
|
|
||||||
{ { 0xFF }, { 174, 48 }, 0 }, // 5
|
|
||||||
{ { 0xFF }, { 139, 52 }, 0 }, // 6
|
|
||||||
|
|
||||||
{ { 7 | ( 5 << 4 ) }, { 129, 63 }, 1 }, // 7
|
|
||||||
{ { 6 | ( 5 << 4 ) }, { 139, 39 }, 0 }, // 8
|
|
||||||
{ { 5 | ( 5 << 4 ) }, { 139, 21 }, 0 }, // 9
|
|
||||||
{ { 4 | ( 5 << 4 ) }, { 139, 4 }, 0 }, //10
|
|
||||||
{ { 4 | ( 4 << 4 ) }, { 156, 02 }, 0 }, //11
|
|
||||||
{ { 5 | ( 4 << 4 ) }, { 156, 19 }, 0 }, //12
|
|
||||||
{ { 6 | ( 4 << 4 ) }, { 156, 37 }, 0 }, //13
|
|
||||||
{ { 7 | ( 4 << 4 ) }, { 144, 58 }, 1 }, //14
|
|
||||||
{ { 7 | ( 3 << 4 ) }, { 164, 55 }, 1 }, //15
|
|
||||||
{ { 6 | ( 3 << 4 ) }, { 174, 35 }, 0 }, //16
|
|
||||||
{ { 5 | ( 3 << 4 ) }, { 174, 13 }, 0 }, //17
|
|
||||||
{ { 4 | ( 3 << 4 ) }, { 174, 0 }, 0 }, //18
|
|
||||||
{ { 4 | ( 2 << 4 ) }, { 191, 3 }, 0 }, //19
|
|
||||||
{ { 5 | ( 2 << 4 ) }, { 191, 20 }, 0 }, //20
|
|
||||||
{ { 6 | ( 2 << 4 ) }, { 191, 37 }, 0 }, //21
|
|
||||||
{ { 6 | ( 1 << 4 ) }, { 208, 42 }, 0 }, //22
|
|
||||||
{ { 5 | ( 1 << 4 ) }, { 208, 24 }, 0 }, //23
|
|
||||||
{ { 4 | ( 1 << 4 ) }, { 208, 7 }, 0 }, //24
|
|
||||||
{ { 4 | ( 0 << 4 ) }, { 224, 7 }, 1 }, //25
|
|
||||||
{ { 5 | ( 0 << 4 ) }, { 224, 24 }, 1 }, //26
|
|
||||||
{ { 6 | ( 0 << 4 ) }, { 224, 41 }, 1 }, //27
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
void matrix_init_kb(void) {
|
void matrix_init_kb(void) {
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
RGB_MATRIX_SPLIT_RIGHT = no # if no, order LEDs for left hand, if yes, order LEDs for right hand
|
||||||
|
|
||||||
|
ifeq ($(strip $(RGB_MATRIX_SPLIT_RIGHT)), yes)
|
||||||
|
OPT_DEFS += -DRGB_MATRIX_SPLIT_RIGHT
|
||||||
|
endif
|
||||||
|
|
||||||
SRC += rev1/matrix.c
|
SRC += rev1/matrix.c
|
||||||
SRC += rev1/split_util.c
|
SRC += rev1/split_util.c
|
||||||
SRC += rev1/split_scomm.c
|
SRC += rev1/split_scomm.c
|
||||||
@@ -1,9 +1,6 @@
|
|||||||
Doro67 Multi PCB
|
# Doro67 Multi PCB
|
||||||
===
|
|
||||||
|
|
||||||
A custom 65% keyboard with multiple layout support.
|
65% custom keyboard made by 80ultraman/Alf/Backprop Studios with multiple layout support. Despite the layout options available, layout is dictated by the selected integrated plate.
|
||||||
|
|
||||||
Do not flash RGB firmware for this board.
|
|
||||||
|
|
||||||
Keyboard Maintainer: [ShadeDream](https://github.com/shadedream)
|
Keyboard Maintainer: [ShadeDream](https://github.com/shadedream)
|
||||||
Hardware Supported: Doro67 Multi PCB
|
Hardware Supported: Doro67 Multi PCB
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
# Doro67
|
||||||
|
|
||||||
|
The Doro67 is a 65% USB C, integrated plate keyboard with blocker based on the M65-a by Keyclack/Rama.
|
||||||
|
|
||||||
|
The [Group Buy](https://geekhack.org/index.php?topic=97265.0) was run by 80ultraman in coordination with Alf for machining and Backprop Studios for PCB design.
|
||||||
|
|
||||||
|
There were 3 different PCBs available for this group buy.
|
||||||
|
## **Please be aware of which PCB you own and flash the correct firmware on it.**
|
||||||
|
|
||||||
|
**Regular:** PCB made for the China GB which only had 1 layout.
|
||||||
|
**Multi:** PCB made for the international GB comprising of multiple layouts. While several layouts were possible, layout was determined by the integrated plate layout chosen by the customer.
|
||||||
|
**RGB:** PCB made for the international GB which had an identical switch matrix and layout to the regular PCB, with the addition of per key RGB LEDs.
|
||||||
@@ -6,8 +6,8 @@
|
|||||||
#define VENDOR_ID 0xFEED
|
#define VENDOR_ID 0xFEED
|
||||||
#define PRODUCT_ID 0x0000
|
#define PRODUCT_ID 0x0000
|
||||||
#define DEVICE_VER 0x0001
|
#define DEVICE_VER 0x0001
|
||||||
#define MANUFACTURER 80ultraman
|
#define MANUFACTURER Backprop Studio
|
||||||
#define PRODUCT doro67
|
#define PRODUCT Doro67 Regular PCB
|
||||||
#define DESCRIPTION 65% custom keyboard
|
#define DESCRIPTION 65% custom keyboard
|
||||||
|
|
||||||
/* key matrix size */
|
/* key matrix size */
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
# Regular PCB for the Doro67
|
# Doro67 Regular PCB
|
||||||
|
|
||||||
Regular PCB for the Doro67 having ONLY one layout. This is not the PCB with RGB support.
|
65% custom keyboard made by 80ultraman/Alf/Backprop Studios available during the China Group Buy.
|
||||||
|
|
||||||
Do not flash RGB firmware for this board.
|
This is not the PCB with RGB support. Do not flash RGB firmware for this board.
|
||||||
|
|
||||||
Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin)
|
Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin)
|
||||||
Hardware Supported: Doro67 Regular PCB
|
Hardware Supported: Doro67 Regular PCB
|
||||||
|
|||||||
@@ -0,0 +1,71 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2019 MechMerlin
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "config_common.h"
|
||||||
|
|
||||||
|
/* USB Device descriptor parameter */
|
||||||
|
#define VENDOR_ID 0xFEED
|
||||||
|
#define PRODUCT_ID 0x0000
|
||||||
|
#define DEVICE_VER 0x0001
|
||||||
|
#define MANUFACTURER Backprop Studio
|
||||||
|
#define PRODUCT Doro67 RGB PCB
|
||||||
|
#define DESCRIPTION 65% custom keyboard
|
||||||
|
|
||||||
|
/* key matrix size */
|
||||||
|
#define MATRIX_ROWS 5
|
||||||
|
#define MATRIX_COLS 15
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Keyboard Matrix Assignments
|
||||||
|
*
|
||||||
|
* Change this to how you wired your keyboard
|
||||||
|
* COLS: AVR pins used for columns, left to right
|
||||||
|
* ROWS: AVR pins used for rows, top to bottom
|
||||||
|
* DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
|
||||||
|
* ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#define MATRIX_ROW_PINS { D0, D1, D2, D3, D5 }
|
||||||
|
#define MATRIX_COL_PINS { B0, B1, B2, B3, D4, D6, D7, B4, B5, B6, C6, C7, F5, F6, F7 }
|
||||||
|
#define UNUSED_PINS
|
||||||
|
|
||||||
|
/* COL2ROW, ROW2COL*/
|
||||||
|
#define DIODE_DIRECTION COL2ROW
|
||||||
|
|
||||||
|
// The pin connected to the data pin of the LEDs
|
||||||
|
#define RGB_DI_PIN B7
|
||||||
|
// The number of LEDs connected
|
||||||
|
#define DRIVER_LED_TOTAL 67
|
||||||
|
|
||||||
|
#define RGB_MATRIX_KEYPRESSES
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN.
|
||||||
|
*/
|
||||||
|
#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6
|
||||||
|
|
||||||
|
#define RGBLED_NUM 67
|
||||||
|
|
||||||
|
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not 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
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
{
|
||||||
|
"keyboard_name": "Doro 67 RGB",
|
||||||
|
"url": "",
|
||||||
|
"maintainer": "qmk",
|
||||||
|
"width": 16,
|
||||||
|
"height": 5,
|
||||||
|
"layouts": {
|
||||||
|
"LAYOUT": {
|
||||||
|
"key_count": 67,
|
||||||
|
"layout": [
|
||||||
|
{"label":"K00", "x":0, "y":0},
|
||||||
|
{"label":"K01", "x":1, "y":0},
|
||||||
|
{"label":"K02", "x":2, "y":0},
|
||||||
|
{"label":"K03", "x":3, "y":0},
|
||||||
|
{"label":"K04", "x":4, "y":0},
|
||||||
|
{"label":"K05", "x":5, "y":0},
|
||||||
|
{"label":"K06", "x":6, "y":0},
|
||||||
|
{"label":"K07", "x":7, "y":0},
|
||||||
|
{"label":"K08", "x":8, "y":0},
|
||||||
|
{"label":"K09", "x":9, "y":0},
|
||||||
|
{"label":"K0A", "x":10, "y":0},
|
||||||
|
{"label":"K0B", "x":11, "y":0},
|
||||||
|
{"label":"K0C", "x":12, "y":0},
|
||||||
|
{"label":"K0D", "x":13, "y":0, "w":2},
|
||||||
|
{"label":"K0E", "x":15, "y":0},
|
||||||
|
{"label":"K10", "x":0, "y":1, "w":1.5},
|
||||||
|
{"label":"K11", "x":1.5, "y":1},
|
||||||
|
{"label":"K12", "x":2.5, "y":1},
|
||||||
|
{"label":"K13", "x":3.5, "y":1},
|
||||||
|
{"label":"K14", "x":4.5, "y":1},
|
||||||
|
{"label":"K15", "x":5.5, "y":1},
|
||||||
|
{"label":"K16", "x":6.5, "y":1},
|
||||||
|
{"label":"K17", "x":7.5, "y":1},
|
||||||
|
{"label":"K18", "x":8.5, "y":1},
|
||||||
|
{"label":"K19", "x":9.5, "y":1},
|
||||||
|
{"label":"K1A", "x":10.5, "y":1},
|
||||||
|
{"label":"K1B", "x":11.5, "y":1},
|
||||||
|
{"label":"K1C", "x":12.5, "y":1},
|
||||||
|
{"label":"K1D", "x":13.5, "y":1, "w":1.5},
|
||||||
|
{"label":"K1E", "x":15, "y":1},
|
||||||
|
{"label":"K20", "x":0, "y":2, "w":1.75},
|
||||||
|
{"label":"K21", "x":1.75, "y":2},
|
||||||
|
{"label":"K22", "x":2.75, "y":2},
|
||||||
|
{"label":"K23", "x":3.75, "y":2},
|
||||||
|
{"label":"K24", "x":4.75, "y":2},
|
||||||
|
{"label":"K25", "x":5.75, "y":2},
|
||||||
|
{"label":"K26", "x":6.75, "y":2},
|
||||||
|
{"label":"K27", "x":7.75, "y":2},
|
||||||
|
{"label":"K28", "x":8.75, "y":2},
|
||||||
|
{"label":"K29", "x":9.75, "y":2},
|
||||||
|
{"label":"K2A", "x":10.75, "y":2},
|
||||||
|
{"label":"K2B", "x":11.75, "y":2},
|
||||||
|
{"label":"K2D", "x":12.75, "y":2, "w":2.25},
|
||||||
|
{"label":"K2E", "x":15, "y":2},
|
||||||
|
{"label":"K30", "x":0, "y":3, "w":2.25},
|
||||||
|
{"label":"K32", "x":2.25, "y":3},
|
||||||
|
{"label":"K33", "x":3.25, "y":3},
|
||||||
|
{"label":"K34", "x":4.25, "y":3},
|
||||||
|
{"label":"K35", "x":5.25, "y":3},
|
||||||
|
{"label":"K36", "x":6.25, "y":3},
|
||||||
|
{"label":"K37", "x":7.25, "y":3},
|
||||||
|
{"label":"K38", "x":8.25, "y":3},
|
||||||
|
{"label":"K39", "x":9.25, "y":3},
|
||||||
|
{"label":"K3A", "x":10.25, "y":3},
|
||||||
|
{"label":"K3B", "x":11.25, "y":3},
|
||||||
|
{"label":"K3C", "x":12.25, "y":3, "w":1.75},
|
||||||
|
{"label":"K3D", "x":14, "y":3},
|
||||||
|
{"label":"K3E", "x":15, "y":3},
|
||||||
|
{"label":"K40", "x":0, "y":4, "w":1.25},
|
||||||
|
{"label":"K41", "x":1.25, "y":4, "w":1.25},
|
||||||
|
{"label":"K42", "x":2.5, "y":4, "w":1.25},
|
||||||
|
{"label":"K43", "x":3.75, "y":4, "w":6.25},
|
||||||
|
{"label":"K49", "x":10, "y":4, "w":1.25},
|
||||||
|
{"label":"K4A", "x":11.25, "y":4, "w":1.25},
|
||||||
|
{"label":"K4C", "x":13, "y":4},
|
||||||
|
{"label":"K4D", "x":14, "y":4},
|
||||||
|
{"label":"K4E", "x":15, "y":4}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
+3
-29
@@ -1,4 +1,4 @@
|
|||||||
/* Copyright 2017 REPLACE_WITH_YOUR_NAME
|
/* Copyright 2019 MechMerlin
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -14,32 +14,6 @@
|
|||||||
* 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 CONFIG_USER_H
|
#pragma once
|
||||||
#define CONFIG_USER_H
|
|
||||||
|
|
||||||
#include QMK_KEYBOARD_CONFIG_H
|
// place overrides here
|
||||||
|
|
||||||
#if (defined(TAP_DANCE_ENABLE) && !defined(TAPPING_TERM))
|
|
||||||
#define TAPPING_TERM 200
|
|
||||||
#endif // TAP_DANCE_ENABLE
|
|
||||||
|
|
||||||
|
|
||||||
#define B5_AUDIO
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef RGBLIGHT_ENABLE
|
|
||||||
#define RGB_DI_PIN D3
|
|
||||||
#define RGBLED_NUM 14 // Number of LEDs
|
|
||||||
#define RGBLIGHT_ANIMATIONS
|
|
||||||
#define RGBLIGHT_HUE_STEP 12
|
|
||||||
#define RGBLIGHT_SAT_STEP 12
|
|
||||||
#define RGBLIGHT_VAL_STEP 12
|
|
||||||
#define RGBLIGHT_EFFECT_KNIGHT_LENGTH 4
|
|
||||||
#define RGBLIGHT_EFFECT_SNAKE_LENGTH 3
|
|
||||||
#define RGBLIGHT_EFFECT_BREATHE_CENTER 1
|
|
||||||
#define RGBLIGHT_SLEEP
|
|
||||||
#endif // RGBLIGHT_ENABLE
|
|
||||||
|
|
||||||
#define FORCE_NKRO
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
/* Copyright 2019 MechMerlin
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
|
||||||
|
// Defines the keycodes used by our macros in process_record_user
|
||||||
|
enum custom_keycodes {
|
||||||
|
QMKBEST = SAFE_RANGE,
|
||||||
|
QMKURL
|
||||||
|
};
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
[0] = LAYOUT( \
|
||||||
|
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_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_LSFT, KC_UP, KC_PGDN, \
|
||||||
|
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_LALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT \
|
||||||
|
),
|
||||||
|
|
||||||
|
[1] = LAYOUT( \
|
||||||
|
KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, \
|
||||||
|
QMKBEST, QMKURL, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
|
||||||
|
RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
|
||||||
|
KC_TRNS, RGB_RMOD, RGB_HUD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \
|
||||||
|
),
|
||||||
|
};
|
||||||
|
|
||||||
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
switch (keycode) {
|
||||||
|
case QMKBEST:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
// when keycode QMKBEST is pressed
|
||||||
|
SEND_STRING("QMK is the best thing ever!");
|
||||||
|
} else {
|
||||||
|
// when keycode QMKBEST is released
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case QMKURL:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
// when keycode QMKURL is pressed
|
||||||
|
SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER));
|
||||||
|
} else {
|
||||||
|
// when keycode QMKURL is released
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
# The default keymap for rgb
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
# Doro67 RGB PCB
|
||||||
|
|
||||||
|
65% custom keyboard made by 80ultraman/Alf/Backprop Studios with in switch RGB featuring the same switch matrix and layout as the regular PCB.
|
||||||
|
|
||||||
|
Flashing the regular PCB firmware on this board will work, but will disable RGB lighting.
|
||||||
|
|
||||||
|
Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin)
|
||||||
|
Hardware Supported: Doro 67 RGB PCB
|
||||||
|
Hardware Availability: [Geekhack GB](https://geekhack.org/index.php?topic=97265.0)
|
||||||
|
|
||||||
|
Make example for this keyboard (after setting up your build environment):
|
||||||
|
|
||||||
|
make doro67/rgb:default
|
||||||
|
|
||||||
|
**RGB Note:** The WS2812 string of LEDs starts from the `K00` key connected to pin `B7` and is connected from left to right, top to bottom, following the physical layout of the board.
|
||||||
|
|
||||||
|
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).
|
||||||
@@ -0,0 +1,127 @@
|
|||||||
|
/* Copyright 2019 MechMerlin
|
||||||
|
*
|
||||||
|
* 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 "rgb.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
|
||||||
|
setPinOutput(E6);
|
||||||
|
matrix_init_user();
|
||||||
|
}
|
||||||
|
|
||||||
|
void matrix_scan_kb(void) {
|
||||||
|
// put your looping keyboard code here
|
||||||
|
// runs every cycle (a lot)
|
||||||
|
|
||||||
|
matrix_scan_user();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
// put your per-action keyboard code here
|
||||||
|
// runs for every action, just before processing by the firmware
|
||||||
|
|
||||||
|
return process_record_user(keycode, record);
|
||||||
|
}
|
||||||
|
|
||||||
|
void led_set_kb(uint8_t usb_led) {
|
||||||
|
// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
|
||||||
|
if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) {
|
||||||
|
writePinLow(E6);
|
||||||
|
} else {
|
||||||
|
writePinHigh(E6);
|
||||||
|
}
|
||||||
|
led_set_user(usb_led);
|
||||||
|
}
|
||||||
|
|
||||||
|
const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
|
||||||
|
{{0|(0<<4)}, {15*0, 0}, 0}, // Esc
|
||||||
|
{{0|(1<<4)}, {15*1, 0}, 0}, // 1
|
||||||
|
{{0|(2<<4)}, {15*2, 0}, 0}, // 2
|
||||||
|
{{0|(3<<4)}, {15*3, 0}, 0}, // 3
|
||||||
|
{{0|(4<<4)}, {15*4, 0}, 0}, // 4
|
||||||
|
{{0|(5<<4)}, {15*5, 0}, 0}, // 5
|
||||||
|
{{0|(6<<4)}, {15*6, 0}, 0}, // 6
|
||||||
|
{{0|(7<<4)}, {15*7, 0}, 0}, // 7
|
||||||
|
{{0|(8<<4)}, {15*8, 0}, 0}, // 8
|
||||||
|
{{0|(9<<4)}, {15*9, 0}, 0}, // 9
|
||||||
|
{{0|(10<<4)}, {15*10, 0}, 0}, // 0
|
||||||
|
{{0|(11<<4)}, {15*11, 0}, 0}, // -
|
||||||
|
{{0|(12<<4)}, {15*12, 0}, 0}, // =
|
||||||
|
{{0|(13<<4)}, {15*13.5, 0}, 1}, // Backspace
|
||||||
|
{{0|(14<<4)}, {15*15, 0}, 1}, // Ins
|
||||||
|
|
||||||
|
{{1|(0<<4)}, {15*0.5, 16}, 1}, // Tab
|
||||||
|
{{1|(1<<4)}, {15*1.5, 16}, 0}, // Q
|
||||||
|
{{1|(2<<4)}, {15*2.5, 16}, 0}, // W
|
||||||
|
{{1|(3<<4)}, {15*3.5, 16}, 0}, // E
|
||||||
|
{{1|(4<<4)}, {15*4.5, 16}, 0}, // R
|
||||||
|
{{1|(5<<4)}, {15*5.5, 16}, 0}, // T
|
||||||
|
{{1|(6<<4)}, {15*6.5, 16}, 0}, // Y
|
||||||
|
{{1|(7<<4)}, {15*7.5, 16}, 0}, // U
|
||||||
|
{{1|(8<<4)}, {15*8.5, 16}, 0}, // I
|
||||||
|
{{1|(9<<4)}, {15*9.5, 16}, 0}, // O
|
||||||
|
{{1|(10<<4)}, {15*10.5, 16}, 0}, // P
|
||||||
|
{{1|(11<<4)}, {15*11.5, 16}, 0}, // [
|
||||||
|
{{1|(12<<4)}, {15*12.5, 16}, 0}, // ]
|
||||||
|
{{1|(13<<4)}, {15*13.75, 16}, 1}, //
|
||||||
|
{{1|(14<<4)}, {15*15, 16}, 1}, // Del
|
||||||
|
|
||||||
|
{{2|(0<<4)}, {15*0.75, 32}, 1}, // Capslock
|
||||||
|
{{2|(1<<4)}, {15*1.75, 32}, 0}, // A
|
||||||
|
{{2|(2<<4)}, {15*2.75, 32}, 0}, // S
|
||||||
|
{{2|(3<<4)}, {15*3.75, 32}, 0}, // D
|
||||||
|
{{2|(4<<4)}, {15*4.75, 32}, 0}, // F
|
||||||
|
{{2|(5<<4)}, {15*5.75, 32}, 0}, // G
|
||||||
|
{{2|(6<<4)}, {15*6.75, 32}, 0}, // H
|
||||||
|
{{2|(7<<4)}, {15*7.75, 32}, 0}, // J
|
||||||
|
{{2|(8<<4)}, {15*8.75, 32}, 0}, // K
|
||||||
|
{{2|(9<<4)}, {15*9.75, 32}, 0}, // L
|
||||||
|
{{2|(10<<4)}, {15*10.75, 32}, 0}, // ;
|
||||||
|
{{2|(11<<4)}, {15*11.75, 32}, 0}, // '
|
||||||
|
{{2|(13<<4)}, {15*13.25, 32}, 1}, // Enter
|
||||||
|
{{2|(14<<4)}, {15*15, 32}, 1}, // Pgup
|
||||||
|
|
||||||
|
{{3|(0<<4)}, {15*1.25, 48}, 1}, // LShift
|
||||||
|
{{3|(2<<4)}, {15*2, 48}, 0}, // Z
|
||||||
|
{{3|(3<<4)}, {15*3, 48}, 0}, // X
|
||||||
|
{{3|(4<<4)}, {15*4, 48}, 0}, // C
|
||||||
|
{{3|(5<<4)}, {15*5, 48}, 0}, // V
|
||||||
|
{{3|(6<<4)}, {15*6, 48}, 0}, // B
|
||||||
|
{{3|(7<<4)}, {15*7, 48}, 0}, // N
|
||||||
|
{{3|(8<<4)}, {15*8, 48}, 0}, // M
|
||||||
|
{{3|(9<<4)}, {15*9, 48}, 0}, // ,
|
||||||
|
{{3|(10<<4)}, {15*10, 48}, 0}, // .
|
||||||
|
{{3|(11<<4)}, {15*11, 48}, 0}, // /
|
||||||
|
{{3|(12<<4)}, {15*12.75, 48}, 1}, // Shift
|
||||||
|
{{3|(13<<4)}, {15*14, 48}, 1}, // Up
|
||||||
|
{{3|(14<<4)}, {15*15, 48}, 1}, // Pgdn
|
||||||
|
|
||||||
|
{{4|(0<<4)}, {15*0.25, 64}, 1}, // Ctrl
|
||||||
|
{{4|(1<<4)}, {15*1.5, 64}, 1}, // GUI
|
||||||
|
{{4|(2<<4)}, {15*2.25, 64}, 1}, // Alt
|
||||||
|
{{4|(3<<4)}, {15*6.75, 64}, 0}, // Space
|
||||||
|
{{4|(9<<4)}, {15*9, 64}, 1}, // RAlt
|
||||||
|
{{4|(10<<4)}, {15*10.25, 64}, 1}, // FN
|
||||||
|
{{4|(12<<4)}, {15*13, 64}, 1}, // Left
|
||||||
|
{{4|(13<<4)}, {15*14, 64}, 1}, // Down
|
||||||
|
{{4|(14<<4)}, {15*15, 64}, 1}, // Right
|
||||||
|
};
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
/* Copyright 2019 MechMerlin
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "quantum.h"
|
||||||
|
|
||||||
|
/* This a shortcut to help you visually see your layout.
|
||||||
|
*
|
||||||
|
* The first section contains all of the arguments representing the physical
|
||||||
|
* layout of the board and position of the keys.
|
||||||
|
*
|
||||||
|
* The second converts the arguments into a two-dimensional array which
|
||||||
|
* represents the switch matrix.
|
||||||
|
*/
|
||||||
|
#define LAYOUT( \
|
||||||
|
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, \
|
||||||
|
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E, \
|
||||||
|
k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2D, k2E, \
|
||||||
|
k30, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, k3E, \
|
||||||
|
k40, k41, k42, k43, k49, k4A, k4C, k4D, k4E \
|
||||||
|
) \
|
||||||
|
{ \
|
||||||
|
{ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E }, \
|
||||||
|
{ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E }, \
|
||||||
|
{ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, KC_NO, k2D, k2E }, \
|
||||||
|
{ k30, KC_NO, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, k3E }, \
|
||||||
|
{ k40, k41, k42, k43, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k49, k4A, KC_NO, k4C, k4D, k4E }, \
|
||||||
|
}
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
# MCU name
|
||||||
|
#MCU = at90usb1286
|
||||||
|
MCU = atmega32u4
|
||||||
|
|
||||||
|
# Processor frequency.
|
||||||
|
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||||
|
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||||
|
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||||
|
# automatically to create a 32-bit value in your source code.
|
||||||
|
#
|
||||||
|
# This will be an integer division of F_USB below, as it is sourced by
|
||||||
|
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||||
|
# does not *change* the processor frequency - it should merely be updated to
|
||||||
|
# reflect the processor speed set externally so that the code can use accurate
|
||||||
|
# software delays.
|
||||||
|
F_CPU = 16000000
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# LUFA specific
|
||||||
|
#
|
||||||
|
# Target architecture (see library "Board Types" documentation).
|
||||||
|
ARCH = AVR8
|
||||||
|
|
||||||
|
# Input clock frequency.
|
||||||
|
# This will define a symbol, F_USB, in all source code files equal to the
|
||||||
|
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||||
|
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||||
|
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||||
|
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||||
|
# at the end, this will be done automatically to create a 32-bit value in your
|
||||||
|
# source code.
|
||||||
|
#
|
||||||
|
# If no clock division is performed on the input clock inside the AVR (via the
|
||||||
|
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||||
|
F_USB = $(F_CPU)
|
||||||
|
|
||||||
|
# Interrupt driven control endpoint task(+60)
|
||||||
|
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||||
|
|
||||||
|
|
||||||
|
# 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
|
||||||
|
|
||||||
|
RGB_MATRIX_ENABLE = WS2812
|
||||||
|
|
||||||
|
|
||||||
|
# Build Options
|
||||||
|
# change yes to no to disable
|
||||||
|
#
|
||||||
|
BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000)
|
||||||
|
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
|
||||||
|
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
|
||||||
|
CONSOLE_ENABLE = no # Console for debug(+400)
|
||||||
|
COMMAND_ENABLE = no # Commands for debug and configuration
|
||||||
|
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||||
|
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||||
|
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||||
|
NKRO_ENABLE = no # USB Nkey Rollover
|
||||||
|
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default
|
||||||
|
RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
|
||||||
|
MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config)
|
||||||
|
UNICODE_ENABLE = no # Unicode
|
||||||
|
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||||
|
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)
|
||||||
@@ -2,10 +2,6 @@
|
|||||||
|
|
||||||
Non official firmware for custom Korean keyboard with 60% key layout made by Duck.
|
Non official firmware for custom Korean keyboard with 60% key layout made by Duck.
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
Newest version is the [Eagle/Viper V2](http://duck0113.tistory.com/127)
|
Newest version is the [Eagle/Viper V2](http://duck0113.tistory.com/127)
|
||||||
|
|
||||||
Make example for this keyboard (after setting up your build environment):
|
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).
|
||||||
|
|
||||||
make duck/eagle_viper/v2:default
|
|
||||||
@@ -123,31 +123,27 @@ void matrix_print(void) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Row pin configuration
|
/* Row pin configuration - diode connected
|
||||||
* row: 0 1 2 3 4 5
|
* row: 0 1 2 3 4
|
||||||
* pin: PB7 PD0 PD1 PD2 PD3 PD5
|
* pin: PD0 PD1 PD2 PD3 PD5
|
||||||
*
|
*
|
||||||
* Esc uses its own pin PE2
|
* Caps Lock uses its own pin PE2 on the column pin, row pin is grounded
|
||||||
*/
|
*/
|
||||||
static void init_rows(void) {
|
static void init_rows(void) {
|
||||||
DDRD &= ~0b00101111;
|
DDRD &= ~0b00101111;
|
||||||
PORTD &= ~0b00101111;
|
PORTD &= ~0b00101111;
|
||||||
|
|
||||||
DDRB &= ~0b10000000;
|
|
||||||
PORTB &= ~0b10000000;
|
|
||||||
|
|
||||||
DDRE &= ~0b00000100;
|
DDRE &= ~0b00000100;
|
||||||
PORTE |= 0b00000100;
|
PORTE |= 0b00000100;
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint8_t read_rows(uint8_t col) {
|
static uint8_t read_rows(uint8_t col) {
|
||||||
|
|
||||||
return (PIND&(1<<0) ? (1<<0) : 0) |
|
return (PIND&(1<<0) ? (1<<0) : 0) |
|
||||||
(PIND&(1<<1) ? (1<<1) : 0) |
|
(PIND&(1<<1) ? (1<<1) : 0) |
|
||||||
(PIND&(1<<2) ? (1<<2) : 0) |
|
(PIND&(1<<2) ? (1<<2) : 0) |
|
||||||
(PIND&(1<<3) ? (1<<3) : 0) |
|
(PIND&(1<<3) ? (1<<3) : 0) |
|
||||||
(PIND&(1<<5) ? (1<<4) : 0) |
|
(PIND&(1<<5) ? (1<<4) : 0) |
|
||||||
(PINB&(1<<7) ? (1<<5) : 0) |
|
|
||||||
(col==0 ? ((PINE&(1<<2) ? 0 : (1<<2))) : 0);
|
(col==0 ? ((PINE&(1<<2) ? 0 : (1<<2))) : 0);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -158,24 +154,31 @@ uint8_t read_fwkey(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Columns 0 - 15
|
/* Columns 0 - 15
|
||||||
|
*
|
||||||
|
* atmega32u4 decoder pin
|
||||||
|
* PC6 U1 E3
|
||||||
|
* PB6 U2 E3
|
||||||
|
* PF0 U1, U2 A0
|
||||||
|
* PF1 U1, U2 A1
|
||||||
|
* PC7 U1, U2 A2
|
||||||
|
*
|
||||||
* These columns uses two 74HC237D 3 to 8 bit demultiplexers.
|
* These columns uses two 74HC237D 3 to 8 bit demultiplexers.
|
||||||
* col / pin: PC6 PB6 PF0 PF1 PC7
|
* col / pin: PC6 PB6 PF0 PF1 PC7 Decoder Pin
|
||||||
* 0: 1 0 0 0 0
|
* 0: 1 0 0 0 0 U1 Y0
|
||||||
* 1: 1 0 1 0 0
|
* 1: 1 0 1 0 0 U1 Y1
|
||||||
* 2: 1 0 0 1 0
|
* 2: 1 0 0 1 0 U1 Y2
|
||||||
* 3: 1 0 1 1 0
|
* 3: 1 0 1 1 0 U1 Y3
|
||||||
* 4: 1 0 0 0 1
|
* 4: 1 0 0 0 1 U1 Y4
|
||||||
* 5: 1 0 1 0 1
|
* 5: 1 0 1 0 1 U1 Y5
|
||||||
* 6: 1 0 0 1 1
|
* 6: 1 0 0 1 1 U1 Y6
|
||||||
* 7: 1 0 1 1 1
|
* 7: 1 0 1 1 1 U1 Y7
|
||||||
* 8: 0 1 0 0 0
|
* 8: 0 1 0 0 0 U2 Y0
|
||||||
* 9: 0 1 1 0 0
|
* 9: 0 1 1 0 0 U2 Y1
|
||||||
* 10: 0 1 0 1 0
|
* 10: 0 1 0 1 0 U2 Y2
|
||||||
* 11: 0 1 1 1 0
|
* 11: 0 1 1 1 0 U2 Y3
|
||||||
* 12: 0 1 0 0 1
|
* 12: 0 1 0 0 1 U2 Y4
|
||||||
* 13: 0 1 1 0 1
|
* 13: 0 1 1 0 1 U2 Y5
|
||||||
* 14: 0 1 0 1 1
|
* 14: 0 1 0 1 1 U2 Y6
|
||||||
* 15: 0 1 1 1 1
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
static void unselect_cols(void) {
|
static void unselect_cols(void) {
|
||||||
@@ -251,10 +254,5 @@ static void select_col(uint8_t col) {
|
|||||||
PORTF |= 0b00000010;
|
PORTF |= 0b00000010;
|
||||||
PORTC |= 0b10000000;
|
PORTC |= 0b10000000;
|
||||||
break;
|
break;
|
||||||
case 15:
|
|
||||||
PORTB |= 0b01000000;
|
|
||||||
PORTF |= 0b00000011;
|
|
||||||
PORTC |= 0b10000000;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -13,7 +13,7 @@ Make example for this keyboard (after setting up your build environment):
|
|||||||
|
|
||||||
**Reset Key:** To put the Eagle/Viper V2 into reset, hold caps lock key (`K2A`) while plugging in.
|
**Reset Key:** To put the Eagle/Viper V2 into reset, hold caps lock key (`K2A`) while plugging in.
|
||||||
|
|
||||||
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.
|
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).
|
||||||
|
|
||||||
## Hardware Notes
|
## Hardware Notes
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
# dfu-programmer atmega32u4 erase --force
|
||||||
|
# dfu-programmer atmega32u4 flash /path/to/firmware.hex
|
||||||
|
# dfu-programmer atmega32u4 reset
|
||||||
|
|
||||||
|
# run this in the qmk_firmware directory
|
||||||
|
make dz60:billiams
|
||||||
|
dfu-programmer atmega32u4 erase --force && \
|
||||||
|
dfu-programmer atmega32u4 flash dz60_billiams.hex && \
|
||||||
|
dfu-programmer atmega32u4 reset
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
#define GRAVE_ESC_GUI_OVERRIDE # Always send Escape if GUI is pressed
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
|
||||||
|
/* Qwerty
|
||||||
|
* ,-----------------------------------------------------------------------------------------.
|
||||||
|
* | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Bkspc |
|
||||||
|
* |-----------------------------------------------------------------------------------------+
|
||||||
|
* | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ |
|
||||||
|
* |-----------------------------------------------------------------------------------------+
|
||||||
|
* | Fn | A | S | D | F | G | H | J | K | L | ; | ' | Enter |
|
||||||
|
* |-----------------------------------------------------------------------------------------+
|
||||||
|
* | Shift | Z | X | C | V | B | N | M | , | . |Tap(/) Shft| U | ESC |
|
||||||
|
* |-----------------------------------------------------------------------------------------+
|
||||||
|
* | Ctrl | Alt | Cmd | Space | Cmd | Fn | L | D | R |
|
||||||
|
* `-----------------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
|
||||||
|
LAYOUT_directional(
|
||||||
|
KC_GRAVE, 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_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,
|
||||||
|
MO(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
|
||||||
|
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, _______, RSFT_T(KC_SLSH) , KC_UP, KC_ESCAPE,
|
||||||
|
KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_SPC, KC_SPC, KC_RGUI, MO(1), KC_LEFT, KC_DOWN, KC_RIGHT
|
||||||
|
),
|
||||||
|
|
||||||
|
/* FN Layer
|
||||||
|
* ,-----------------------------------------------------------------------------------------.
|
||||||
|
* | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | DEL |
|
||||||
|
* |-----------------------------------------------------------------------------------------+
|
||||||
|
* | |RBB T|RGB M| Hue-| Hue+| Sat-| Sat+| Val-| Val+| | | MUTE | Vol- | Vol+ |
|
||||||
|
* |-----------------------------------------------------------------------------------------+
|
||||||
|
* | | | | | | | | | | | Prev | Next | Play/Pause |
|
||||||
|
* |-----------------------------------------------------------------------------------------+
|
||||||
|
* | | | | | | | | |Scr- |Scr+ | |PG_UP|RESET|
|
||||||
|
* |-----------------------------------------------------------------------------------------+
|
||||||
|
* | | | | | | | HOME|PG_DN| END |
|
||||||
|
* `-----------------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
|
||||||
|
LAYOUT_directional(
|
||||||
|
_______, 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, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, _______, _______, KC_MUTE, KC__VOLDOWN, KC__VOLUP,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MRWD, KC_MFFD,
|
||||||
|
KC_MPLY, _______, _______, _______, _______, _______, _______, _______, _______, KC_BRID, KC_BRIU, _______, _______, KC_PGUP, RESET,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDOWN, KC_END
|
||||||
|
),
|
||||||
|
};
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
## Billiam's DZ60 layout
|
||||||
|
|
||||||
|
This layout is optimized for MacOS and is for a Build 4 DZ60 with a 2U left shift, 2U right shift and an arrow
|
||||||
|
cluster in the bottom right. Don't use this layout if you didn't get Build 4, you will enter a world of pain Donny.
|
||||||
|
|
||||||
|
Settings:
|
||||||
|
|
||||||
|
* The `CAPS LOCK` key is replaced with a second function key.
|
||||||
|
* The `ALT` and `CMD` keys are swapped to replicate the Mac layout.
|
||||||
|
* Del is available as `Fn` + `Backspace`
|
||||||
|
* `/ ?` are available when you tap the right shift. Otherwise RShift is shift when held down
|
||||||
|
* RESET is available as `Fn`+ ` ESC`
|
||||||
|
* Underglow toggle and mode selection are available as `Fn` + `Q` and `Fn` + `S`. Yes your keyboard has lights even if you didn't get the LEDs. Bonus!
|
||||||
|
* Media play/pause doesn't seem to work with anything but iTunes at the moment. FML
|
||||||
|
|
||||||
|
|
||||||
|
### Initial Installation
|
||||||
|
|
||||||
|
I found the instructions to be longer than they had to be, and I ended up having to Google some steps anyway. These are the steps I took to get my keyboard setup, in case you are new to the process.
|
||||||
|
|
||||||
|
1. Clone the qmk_firmware repo locally
|
||||||
|
```
|
||||||
|
# Choose one:
|
||||||
|
git clone [email protected]:qmk/qmk_firmware.git # OR
|
||||||
|
git clone https://github.com/qmk/qmk_firmware.git
|
||||||
|
```
|
||||||
|
2. Customize your layout by starting with a [keymap](https://github.com/qmk/qmk_firmware/tree/master/keyboards/dz60/keymaps). I copied [StephenGrier](https://github.com/qmk/qmk_firmware/tree/master/keyboards/dz60/keymaps/stephengrier)'s and modified it for DZ60 Build 4 and changed a few things, like the `grave` key, `ESC` and `/`.
|
||||||
|
|
||||||
|
3. Build your hex file
|
||||||
|
```
|
||||||
|
make dz60:billiams # be in the qmk_firmware directory to do this
|
||||||
|
```
|
||||||
|
A hex file `dz60_billiams.hex` will be created in the base qmk_firmware directory
|
||||||
|
|
||||||
|
4. Before plugging in your keyboard into your computer, hold `SPACE` and `B` keys down
|
||||||
|
5. Holding those keys down, plug the keyboard into your computer, which will put the keyboard in bootlegger mode
|
||||||
|
6. If you are using [QMK toolbox](https://github.com/qmk/qmk_toolbox/releases), upload the .hex file you made above, select it and hit the flash button. For the love of all that is good and holy on Earth, don't hit the load button, that will load the default keymap and that's not what you want! Unless it is, in which case click away.
|
||||||
|
|
||||||
|
Note: If you didn't follow my instructions in 4 and accidentally loaded the default keymap, then to `RESET` the keyboard and kick it into bootleg mode again, hold the `down arrow` key and `\`. The default layout is Build 1 and sets the `MENU` key on that build to `Fn`. `MENU` corresponds to `down arrow` in build 4. Note that you don't have to unplug the keyboard.
|
||||||
|
|
||||||
|
Hope this helps!
|
||||||
|
|
||||||
|
### 0 Qwerty
|
||||||
|
```
|
||||||
|
,-----------------------------------------------------------------------------------------.
|
||||||
|
| ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Bkspc |
|
||||||
|
|-----------------------------------------------------------------------------------------+
|
||||||
|
| Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ |
|
||||||
|
|-----------------------------------------------------------------------------------------+
|
||||||
|
| Fn | A | S | D | F | G | H | J | K | L | ; | ' | Enter |
|
||||||
|
|-----------------------------------------------------------------------------------------+
|
||||||
|
| Shift | Z | X | C | V | B | N | M | , | . | Tap:/ RSh | U | ESC |
|
||||||
|
|-----------------------------------------------------------------------------------------+
|
||||||
|
| Ctrl | Alt | Cmd | Space | Cmd | Fn | L | D | R |
|
||||||
|
`-----------------------------------------------------------------------------------------'
|
||||||
|
```
|
||||||
|
|
||||||
|
### 1 Fn Layer
|
||||||
|
```
|
||||||
|
FN Layer
|
||||||
|
,-----------------------------------------------------------------------------------------.
|
||||||
|
| ` | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | DEL |
|
||||||
|
|-----------------------------------------------------------------------------------------+
|
||||||
|
| |RBB T|RGB M| Hue-| Hue+| Sat-| Sat+| Val-| Val+| | | MUTE | Vol- | Vol+ |
|
||||||
|
|-----------------------------------------------------------------------------------------+
|
||||||
|
| | | | | | | | | | | Prev | Next | Play/Pause |
|
||||||
|
|-----------------------------------------------------------------------------------------+
|
||||||
|
| | | | | | | | |Scr- |Scr+ | | PG_UP |RESET|
|
||||||
|
|-----------------------------------------------------------------------------------------+
|
||||||
|
| | | | | | | HOME | PG_DN | END |
|
||||||
|
`-----------------------------------------------------------------------------------------'
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
|
||||||
|
LAYOUT(
|
||||||
|
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_NO, KC_BSPC,
|
||||||
|
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS,
|
||||||
|
KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
|
||||||
|
KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_NO,
|
||||||
|
KC_CAPS, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, MO(2), KC_NO, MO(1), KC_RCTL),
|
||||||
|
|
||||||
|
LAYOUT(
|
||||||
|
KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_DEL,
|
||||||
|
KC_TRNS, KC_PGUP, KC_UP, KC_PGDN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||||
|
KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||||
|
KC_TRNS, KC_TRNS, KC_SCROLLLOCK, KC_PAUSE, KC_HOME, KC_END, KC_INSERT, KC_PSCR, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
|
||||||
|
|
||||||
|
LAYOUT(
|
||||||
|
RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
|
||||||
|
};
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
#define DEBOUNCE 3
|
#define DEBOUNCE 3
|
||||||
#define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects
|
#define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects
|
||||||
#define RGB_DISABLE_WHEN_USB_SUSPENDED false // turn off effects when suspended
|
#define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended
|
||||||
#define RGB_MATRIX_KEYPRESSES
|
#define RGB_MATRIX_KEYPRESSES
|
||||||
#define RGB_MATRIX_LED_PROCESS_LIMIT 4
|
#define RGB_MATRIX_LED_PROCESS_LIMIT 4
|
||||||
#define RGB_MATRIX_LED_FLUSH_LIMIT 26
|
#define RGB_MATRIX_LED_FLUSH_LIMIT 26
|
||||||
|
|||||||
@@ -1,14 +1,7 @@
|
|||||||
#include "dz60rgb.h"
|
#include "dz60rgb.h"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#if defined (dzrgb60_iso)
|
#if defined (dzrgb60_iso)
|
||||||
|
|
||||||
const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
|
const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
|
||||||
/* Refer to IS31 manual for these locations
|
|
||||||
* driver
|
|
||||||
* | R location
|
|
||||||
* | | G location
|
|
||||||
* | | | B location
|
|
||||||
* | | | | */
|
|
||||||
{0, K_14, J_14, L_14},
|
{0, K_14, J_14, L_14},
|
||||||
{0, K_13, J_13, L_13},
|
{0, K_13, J_13, L_13},
|
||||||
{0, K_12, J_12, L_12},
|
{0, K_12, J_12, L_12},
|
||||||
@@ -23,7 +16,6 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
|
|||||||
{0, K_3, J_3, L_3},
|
{0, K_3, J_3, L_3},
|
||||||
{0, K_2, J_2, L_2},
|
{0, K_2, J_2, L_2},
|
||||||
{0, K_1, J_1, L_1},
|
{0, K_1, J_1, L_1},
|
||||||
|
|
||||||
{0, H_15, G_15, I_15},
|
{0, H_15, G_15, I_15},
|
||||||
{0, H_13, G_13, I_13},
|
{0, H_13, G_13, I_13},
|
||||||
{0, H_12, G_12, I_12},
|
{0, H_12, G_12, I_12},
|
||||||
@@ -38,7 +30,6 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
|
|||||||
{0, H_3, G_3, I_3},
|
{0, H_3, G_3, I_3},
|
||||||
{0, H_2, G_2, I_2},
|
{0, H_2, G_2, I_2},
|
||||||
{0, H_1, G_1, I_1},
|
{0, H_1, G_1, I_1},
|
||||||
|
|
||||||
{0, B_14, A_14, C_14},
|
{0, B_14, A_14, C_14},
|
||||||
{0, E_12, D_12, F_12},
|
{0, E_12, D_12, F_12},
|
||||||
{0, E_11, D_11, F_11},
|
{0, E_11, D_11, F_11},
|
||||||
@@ -52,7 +43,6 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
|
|||||||
{0, E_3, D_3, F_3},
|
{0, E_3, D_3, F_3},
|
||||||
{0, E_2, D_2, F_2},
|
{0, E_2, D_2, F_2},
|
||||||
{0, E_1, D_1, F_1},
|
{0, E_1, D_1, F_1},
|
||||||
|
|
||||||
{0, B_13, A_13, C_13},
|
{0, B_13, A_13, C_13},
|
||||||
{0, B_11, A_11, C_11},
|
{0, B_11, A_11, C_11},
|
||||||
{0, B_10, A_10, C_10},
|
{0, B_10, A_10, C_10},
|
||||||
@@ -65,7 +55,6 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
|
|||||||
{0, B_3, A_3, C_3},
|
{0, B_3, A_3, C_3},
|
||||||
{0, B_2, A_2, C_2},
|
{0, B_2, A_2, C_2},
|
||||||
{0, B_1, A_1, C_1},
|
{0, B_1, A_1, C_1},
|
||||||
|
|
||||||
{0, B_15, A_15, C_15},
|
{0, B_15, A_15, C_15},
|
||||||
{0, E_13, D_13, F_13},
|
{0, E_13, D_13, F_13},
|
||||||
{0, B_12, A_12, C_12},
|
{0, B_12, A_12, C_12},
|
||||||
@@ -73,9 +62,8 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
|
|||||||
{0, B_16, A_16, C_16},
|
{0, B_16, A_16, C_16},
|
||||||
{0, E_16, D_16, F_16},
|
{0, E_16, D_16, F_16},
|
||||||
{0, H_16, G_16, I_16},
|
{0, H_16, G_16, I_16},
|
||||||
{0, K_16, J_16, L_16}
|
{0, K_16, J_16, L_16},
|
||||||
};
|
};
|
||||||
|
|
||||||
const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
|
const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
|
||||||
{{0|(13<<4)}, {16*13.5, 0}, 1},
|
{{0|(13<<4)}, {16*13.5, 0}, 1},
|
||||||
{{0|(12<<4)}, {16*12, 0}, 1},
|
{{0|(12<<4)}, {16*12, 0}, 1},
|
||||||
@@ -91,7 +79,6 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
|
|||||||
{{0|(2<<4)}, {16*2, 0}, 1},
|
{{0|(2<<4)}, {16*2, 0}, 1},
|
||||||
{{0|(1<<4)}, {16*1, 0}, 1},
|
{{0|(1<<4)}, {16*1, 0}, 1},
|
||||||
{{0|(0<<4)}, {16*0, 0}, 1},
|
{{0|(0<<4)}, {16*0, 0}, 1},
|
||||||
|
|
||||||
{{2|(13<<4)}, {16*13.75, 24}, 1},
|
{{2|(13<<4)}, {16*13.75, 24}, 1},
|
||||||
{{1|(12<<4)}, {16*12.5, 16}, 0},
|
{{1|(12<<4)}, {16*12.5, 16}, 0},
|
||||||
{{1|(11<<4)}, {16*11.5, 16}, 0},
|
{{1|(11<<4)}, {16*11.5, 16}, 0},
|
||||||
@@ -106,7 +93,6 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
|
|||||||
{{1|(2<<4)}, { 16*2.5, 16}, 0},
|
{{1|(2<<4)}, { 16*2.5, 16}, 0},
|
||||||
{{1|(1<<4)}, { 16*1.5, 16}, 0},
|
{{1|(1<<4)}, { 16*1.5, 16}, 0},
|
||||||
{{1|(0<<4)}, { 16*0.25, 16}, 1},
|
{{1|(0<<4)}, { 16*0.25, 16}, 1},
|
||||||
|
|
||||||
{{1|(13<<4)}, {16*12.75, 32}, 1},
|
{{1|(13<<4)}, {16*12.75, 32}, 1},
|
||||||
{{2|(11<<4)}, {16*11.75, 32}, 0},
|
{{2|(11<<4)}, {16*11.75, 32}, 0},
|
||||||
{{2|(10<<4)}, {16*10.75, 32}, 0},
|
{{2|(10<<4)}, {16*10.75, 32}, 0},
|
||||||
@@ -120,7 +106,6 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
|
|||||||
{{2|(2<<4)}, { 16*2.75, 32}, 0},
|
{{2|(2<<4)}, { 16*2.75, 32}, 0},
|
||||||
{{2|(1<<4)}, { 16*1.75, 32}, 0},
|
{{2|(1<<4)}, { 16*1.75, 32}, 0},
|
||||||
{{2|(0<<4)}, { 16*0.375, 32}, 1},
|
{{2|(0<<4)}, { 16*0.375, 32}, 1},
|
||||||
|
|
||||||
{{3|(11<<4)}, {16*13.125, 48}, 1},
|
{{3|(11<<4)}, {16*13.125, 48}, 1},
|
||||||
{{3|(10<<4)}, {16*11.25, 48}, 0},
|
{{3|(10<<4)}, {16*11.25, 48}, 0},
|
||||||
{{3|(9<<4)}, {16*10.25, 48}, 0},
|
{{3|(9<<4)}, {16*10.25, 48}, 0},
|
||||||
@@ -133,7 +118,6 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
|
|||||||
{{3|(2<<4)}, {16*3.25, 48}, 0},
|
{{3|(2<<4)}, {16*3.25, 48}, 0},
|
||||||
{{3|(1<<4)}, {16*1.25, 48}, 0},
|
{{3|(1<<4)}, {16*1.25, 48}, 0},
|
||||||
{{3|(0<<4)}, {16*0.625, 48}, 1},
|
{{3|(0<<4)}, {16*0.625, 48}, 1},
|
||||||
|
|
||||||
{{4|(13<<4)}, {16*13.875, 64}, 1},
|
{{4|(13<<4)}, {16*13.875, 64}, 1},
|
||||||
{{4|(11<<4)}, {16*12.625, 64}, 1},
|
{{4|(11<<4)}, {16*12.625, 64}, 1},
|
||||||
{{4|(10<<4)}, {16*11.375, 64}, 1},
|
{{4|(10<<4)}, {16*11.375, 64}, 1},
|
||||||
@@ -141,21 +125,10 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
|
|||||||
{{4|(5<<4)}, { 16*6.375, 64}, 0},
|
{{4|(5<<4)}, { 16*6.375, 64}, 0},
|
||||||
{{4|(2<<4)}, { 16*2.625, 64}, 1},
|
{{4|(2<<4)}, { 16*2.625, 64}, 1},
|
||||||
{{4|(1<<4)}, { 16*1.375, 64}, 1},
|
{{4|(1<<4)}, { 16*1.375, 64}, 1},
|
||||||
{{4|(0<<4)}, { 16*0.125, 64}, 1}
|
{{4|(0<<4)}, { 16*0.125, 64}, 1},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#elif defined (dzrgb60_hhkb)
|
#elif defined (dzrgb60_hhkb)
|
||||||
|
|
||||||
const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
|
const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
|
||||||
/* Refer to IS31 manual for these locations
|
|
||||||
* driver
|
|
||||||
* | R location
|
|
||||||
* | | G location
|
|
||||||
* | | | B location
|
|
||||||
* | | | | */
|
|
||||||
{0, H_15, G_15, I_15},
|
{0, H_15, G_15, I_15},
|
||||||
{0, K_14, J_14, L_14},
|
{0, K_14, J_14, L_14},
|
||||||
{0, K_13, J_13, L_13},
|
{0, K_13, J_13, L_13},
|
||||||
@@ -171,7 +144,6 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
|
|||||||
{0, K_3, J_3, L_3},
|
{0, K_3, J_3, L_3},
|
||||||
{0, K_2, J_2, L_2},
|
{0, K_2, J_2, L_2},
|
||||||
{0, K_1, J_1, L_1},
|
{0, K_1, J_1, L_1},
|
||||||
|
|
||||||
{0, H_14, G_14, I_14},
|
{0, H_14, G_14, I_14},
|
||||||
{0, H_13, G_13, I_13},
|
{0, H_13, G_13, I_13},
|
||||||
{0, H_12, G_12, I_12},
|
{0, H_12, G_12, I_12},
|
||||||
@@ -186,7 +158,6 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
|
|||||||
{0, H_3, G_3, I_3},
|
{0, H_3, G_3, I_3},
|
||||||
{0, H_2, G_2, I_2},
|
{0, H_2, G_2, I_2},
|
||||||
{0, H_1, G_1, I_1},
|
{0, H_1, G_1, I_1},
|
||||||
|
|
||||||
{0, E_14, D_14, F_14},
|
{0, E_14, D_14, F_14},
|
||||||
{0, E_12, D_12, F_12},
|
{0, E_12, D_12, F_12},
|
||||||
{0, E_11, D_11, F_11},
|
{0, E_11, D_11, F_11},
|
||||||
@@ -200,7 +171,6 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
|
|||||||
{0, E_3, D_3, F_3},
|
{0, E_3, D_3, F_3},
|
||||||
{0, E_2, D_2, F_2},
|
{0, E_2, D_2, F_2},
|
||||||
{0, E_1, D_1, F_1},
|
{0, E_1, D_1, F_1},
|
||||||
|
|
||||||
{0, B_14, A_14, C_14},
|
{0, B_14, A_14, C_14},
|
||||||
{0, B_13, A_13, C_13},
|
{0, B_13, A_13, C_13},
|
||||||
{0, B_11, A_11, C_11},
|
{0, B_11, A_11, C_11},
|
||||||
@@ -214,16 +184,14 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
|
|||||||
{0, B_3, A_3, C_3},
|
{0, B_3, A_3, C_3},
|
||||||
{0, B_2, A_2, C_2},
|
{0, B_2, A_2, C_2},
|
||||||
{0, B_1, A_1, C_1},
|
{0, B_1, A_1, C_1},
|
||||||
|
|
||||||
{0, B_15, A_15, C_15},
|
{0, B_15, A_15, C_15},
|
||||||
{0, E_13, D_13, F_13},
|
{0, E_13, D_13, F_13},
|
||||||
{0, B_12, A_12, C_12},
|
{0, B_12, A_12, C_12},
|
||||||
{0, B_16, A_16, C_16},
|
{0, B_16, A_16, C_16},
|
||||||
{0, E_16, D_16, F_16},
|
{0, E_16, D_16, F_16},
|
||||||
{0, H_16, G_16, I_16},
|
{0, H_16, G_16, I_16},
|
||||||
{0, K_16, J_16, L_16}
|
{0, K_16, J_16, L_16},
|
||||||
};
|
};
|
||||||
|
|
||||||
const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
|
const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
|
||||||
{{2|(12<<4)}, {16*14, 0}, 1},
|
{{2|(12<<4)}, {16*14, 0}, 1},
|
||||||
{{0|(13<<4)}, {16*13, 0}, 1},
|
{{0|(13<<4)}, {16*13, 0}, 1},
|
||||||
@@ -240,7 +208,6 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
|
|||||||
{{0|(2<<4)}, {16*2, 0}, 1},
|
{{0|(2<<4)}, {16*2, 0}, 1},
|
||||||
{{0|(1<<4)}, {16*1, 0}, 1},
|
{{0|(1<<4)}, {16*1, 0}, 1},
|
||||||
{{0|(0<<4)}, {16*0, 0}, 1},
|
{{0|(0<<4)}, {16*0, 0}, 1},
|
||||||
|
|
||||||
{{1|(13<<4)}, {16*13.75, 16}, 1},
|
{{1|(13<<4)}, {16*13.75, 16}, 1},
|
||||||
{{1|(12<<4)}, {16*12.5, 16}, 0},
|
{{1|(12<<4)}, {16*12.5, 16}, 0},
|
||||||
{{1|(11<<4)}, {16*11.5, 16}, 0},
|
{{1|(11<<4)}, {16*11.5, 16}, 0},
|
||||||
@@ -255,7 +222,6 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
|
|||||||
{{1|(2<<4)}, { 16*2.5, 16}, 0},
|
{{1|(2<<4)}, { 16*2.5, 16}, 0},
|
||||||
{{1|(1<<4)}, { 16*1.5, 16}, 0},
|
{{1|(1<<4)}, { 16*1.5, 16}, 0},
|
||||||
{{1|(0<<4)}, { 16*0.25, 16}, 1},
|
{{1|(0<<4)}, { 16*0.25, 16}, 1},
|
||||||
|
|
||||||
{{2|(13<<4)}, {16*12.75, 32}, 1},
|
{{2|(13<<4)}, {16*12.75, 32}, 1},
|
||||||
{{2|(11<<4)}, {16*11.75, 32}, 0},
|
{{2|(11<<4)}, {16*11.75, 32}, 0},
|
||||||
{{2|(10<<4)}, {16*10.75, 32}, 0},
|
{{2|(10<<4)}, {16*10.75, 32}, 0},
|
||||||
@@ -269,7 +235,6 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
|
|||||||
{{2|(2<<4)}, { 16*2.75, 32}, 0},
|
{{2|(2<<4)}, { 16*2.75, 32}, 0},
|
||||||
{{2|(1<<4)}, { 16*1.75, 32}, 0},
|
{{2|(1<<4)}, { 16*1.75, 32}, 0},
|
||||||
{{2|(0<<4)}, { 16*0.375, 32}, 1},
|
{{2|(0<<4)}, { 16*0.375, 32}, 1},
|
||||||
|
|
||||||
{{3|(13<<4)}, {16*14, 48}, 1},
|
{{3|(13<<4)}, {16*14, 48}, 1},
|
||||||
{{3|(11<<4)}, {16*12.625, 48}, 0},
|
{{3|(11<<4)}, {16*12.625, 48}, 0},
|
||||||
{{3|(10<<4)}, {16*11.25, 48}, 0},
|
{{3|(10<<4)}, {16*11.25, 48}, 0},
|
||||||
@@ -283,24 +248,16 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
|
|||||||
{{3|(2<<4)}, {16*3.25, 48}, 0},
|
{{3|(2<<4)}, {16*3.25, 48}, 0},
|
||||||
{{3|(1<<4)}, {16*1.25, 48}, 0},
|
{{3|(1<<4)}, {16*1.25, 48}, 0},
|
||||||
{{3|(0<<4)}, {16*0.625, 48}, 1},
|
{{3|(0<<4)}, {16*0.625, 48}, 1},
|
||||||
|
|
||||||
{{4|(13<<4)}, {16*13.625, 64}, 1},
|
{{4|(13<<4)}, {16*13.625, 64}, 1},
|
||||||
{{4|(11<<4)}, {16*12.375, 64}, 1},
|
{{4|(11<<4)}, {16*12.375, 64}, 1},
|
||||||
{{4|(10<<4)}, {16*11.125, 64}, 1},
|
{{4|(10<<4)}, {16*11.125, 64}, 1},
|
||||||
{{4|(5<<4)}, { 16*7, 64}, 0},
|
{{4|(5<<4)}, { 16*7, 64}, 0},
|
||||||
{{4|(2<<4)}, { 16*2.875, 64}, 1},
|
{{4|(2<<4)}, { 16*2.875, 64}, 1},
|
||||||
{{4|(1<<4)}, { 16*1.625, 64}, 1},
|
{{4|(1<<4)}, { 16*1.625, 64}, 1},
|
||||||
{{4|(0<<4)}, { 16*0.375, 64}, 1}
|
{{4|(0<<4)}, { 16*0.375, 64}, 1},
|
||||||
|
|
||||||
};
|
};
|
||||||
#elif defined (dzrgb60_hhkb_iso)
|
#elif defined (dzrgb60_hhkb_iso)
|
||||||
const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
|
const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
|
||||||
/* Refer to IS31 manual for these locations
|
|
||||||
* driver
|
|
||||||
* | R location
|
|
||||||
* | | G location
|
|
||||||
* | | | B location
|
|
||||||
* | | | | */
|
|
||||||
{0, H_15, G_15, I_15},
|
{0, H_15, G_15, I_15},
|
||||||
{0, K_14, J_14, L_14},
|
{0, K_14, J_14, L_14},
|
||||||
{0, K_13, J_13, L_13},
|
{0, K_13, J_13, L_13},
|
||||||
@@ -316,7 +273,6 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
|
|||||||
{0, K_3, J_3, L_3},
|
{0, K_3, J_3, L_3},
|
||||||
{0, K_2, J_2, L_2},
|
{0, K_2, J_2, L_2},
|
||||||
{0, K_1, J_1, L_1},
|
{0, K_1, J_1, L_1},
|
||||||
|
|
||||||
{0, K_15, J_15, L_15},
|
{0, K_15, J_15, L_15},
|
||||||
{0, H_13, G_13, I_13},
|
{0, H_13, G_13, I_13},
|
||||||
{0, H_12, G_12, I_12},
|
{0, H_12, G_12, I_12},
|
||||||
@@ -331,7 +287,6 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
|
|||||||
{0, H_3, G_3, I_3},
|
{0, H_3, G_3, I_3},
|
||||||
{0, H_2, G_2, I_2},
|
{0, H_2, G_2, I_2},
|
||||||
{0, H_1, G_1, I_1},
|
{0, H_1, G_1, I_1},
|
||||||
|
|
||||||
{0, E_15, D_15, F_15},
|
{0, E_15, D_15, F_15},
|
||||||
{0, E_12, D_12, F_12},
|
{0, E_12, D_12, F_12},
|
||||||
{0, E_11, D_11, F_11},
|
{0, E_11, D_11, F_11},
|
||||||
@@ -345,7 +300,6 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
|
|||||||
{0, E_3, D_3, F_3},
|
{0, E_3, D_3, F_3},
|
||||||
{0, E_2, D_2, F_2},
|
{0, E_2, D_2, F_2},
|
||||||
{0, E_1, D_1, F_1},
|
{0, E_1, D_1, F_1},
|
||||||
|
|
||||||
{0, B_14, A_14, C_14},
|
{0, B_14, A_14, C_14},
|
||||||
{0, B_13, A_13, C_13},
|
{0, B_13, A_13, C_13},
|
||||||
{0, B_11, A_11, C_11},
|
{0, B_11, A_11, C_11},
|
||||||
@@ -359,16 +313,14 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
|
|||||||
{0, B_3, A_3, C_3},
|
{0, B_3, A_3, C_3},
|
||||||
{0, B_2, A_2, C_2},
|
{0, B_2, A_2, C_2},
|
||||||
{0, B_1, A_1, C_1},
|
{0, B_1, A_1, C_1},
|
||||||
|
|
||||||
{0, B_15, A_15, C_15},
|
{0, B_15, A_15, C_15},
|
||||||
{0, E_13, D_13, F_13},
|
{0, E_13, D_13, F_13},
|
||||||
{0, B_12, A_12, C_12},
|
{0, B_12, A_12, C_12},
|
||||||
{0, B_16, A_16, C_16},
|
{0, B_16, A_16, C_16},
|
||||||
{0, E_16, D_16, F_16},
|
{0, E_16, D_16, F_16},
|
||||||
{0, H_16, G_16, I_16},
|
{0, H_16, G_16, I_16},
|
||||||
{0, K_16, J_16, L_16}
|
{0, K_16, J_16, L_16},
|
||||||
};
|
};
|
||||||
|
|
||||||
const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
|
const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
|
||||||
{{2|(12<<4)}, {16*14, 0}, 1},
|
{{2|(12<<4)}, {16*14, 0}, 1},
|
||||||
{{0|(13<<4)}, {16*13, 0}, 1},
|
{{0|(13<<4)}, {16*13, 0}, 1},
|
||||||
@@ -385,7 +337,6 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
|
|||||||
{{0|(2<<4)}, {16*2, 0}, 1},
|
{{0|(2<<4)}, {16*2, 0}, 1},
|
||||||
{{0|(1<<4)}, {16*1, 0}, 1},
|
{{0|(1<<4)}, {16*1, 0}, 1},
|
||||||
{{0|(0<<4)}, {16*0, 0}, 1},
|
{{0|(0<<4)}, {16*0, 0}, 1},
|
||||||
|
|
||||||
{{2|(13<<4)}, {16*13.75, 24}, 1},
|
{{2|(13<<4)}, {16*13.75, 24}, 1},
|
||||||
{{1|(12<<4)}, {16*12.5, 16}, 0},
|
{{1|(12<<4)}, {16*12.5, 16}, 0},
|
||||||
{{1|(11<<4)}, {16*11.5, 16}, 0},
|
{{1|(11<<4)}, {16*11.5, 16}, 0},
|
||||||
@@ -400,7 +351,6 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
|
|||||||
{{1|(2<<4)}, { 16*2.5, 16}, 0},
|
{{1|(2<<4)}, { 16*2.5, 16}, 0},
|
||||||
{{1|(1<<4)}, { 16*1.5, 16}, 0},
|
{{1|(1<<4)}, { 16*1.5, 16}, 0},
|
||||||
{{1|(0<<4)}, { 16*0.25, 16}, 1},
|
{{1|(0<<4)}, { 16*0.25, 16}, 1},
|
||||||
|
|
||||||
{{1|(13<<4)}, {16*12.75, 32}, 1},
|
{{1|(13<<4)}, {16*12.75, 32}, 1},
|
||||||
{{2|(11<<4)}, {16*11.75, 32}, 0},
|
{{2|(11<<4)}, {16*11.75, 32}, 0},
|
||||||
{{2|(10<<4)}, {16*10.75, 32}, 0},
|
{{2|(10<<4)}, {16*10.75, 32}, 0},
|
||||||
@@ -414,7 +364,6 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
|
|||||||
{{2|(2<<4)}, { 16*2.75, 32}, 0},
|
{{2|(2<<4)}, { 16*2.75, 32}, 0},
|
||||||
{{2|(1<<4)}, { 16*1.75, 32}, 0},
|
{{2|(1<<4)}, { 16*1.75, 32}, 0},
|
||||||
{{2|(0<<4)}, { 16*0.375, 32}, 1},
|
{{2|(0<<4)}, { 16*0.375, 32}, 1},
|
||||||
|
|
||||||
{{3|(13<<4)}, {16*14, 48}, 1},
|
{{3|(13<<4)}, {16*14, 48}, 1},
|
||||||
{{3|(11<<4)}, {16*12.625, 48}, 0},
|
{{3|(11<<4)}, {16*12.625, 48}, 0},
|
||||||
{{3|(10<<4)}, {16*11.25, 48}, 0},
|
{{3|(10<<4)}, {16*11.25, 48}, 0},
|
||||||
@@ -428,24 +377,16 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
|
|||||||
{{3|(2<<4)}, {16*3.25, 48}, 0},
|
{{3|(2<<4)}, {16*3.25, 48}, 0},
|
||||||
{{3|(1<<4)}, {16*1.25, 48}, 0},
|
{{3|(1<<4)}, {16*1.25, 48}, 0},
|
||||||
{{3|(0<<4)}, {16*0.625, 48}, 1},
|
{{3|(0<<4)}, {16*0.625, 48}, 1},
|
||||||
|
|
||||||
{{4|(13<<4)}, {16*13.625, 64}, 1},
|
{{4|(13<<4)}, {16*13.625, 64}, 1},
|
||||||
{{4|(11<<4)}, {16*12.375, 64}, 1},
|
{{4|(11<<4)}, {16*12.375, 64}, 1},
|
||||||
{{4|(10<<4)}, {16*11.125, 64}, 1},
|
{{4|(10<<4)}, {16*11.125, 64}, 1},
|
||||||
{{4|(5<<4)}, { 16*7, 64}, 0},
|
{{4|(5<<4)}, { 16*7, 64}, 0},
|
||||||
{{4|(2<<4)}, { 16*2.875, 64}, 1},
|
{{4|(2<<4)}, { 16*2.875, 64}, 1},
|
||||||
{{4|(1<<4)}, { 16*1.625, 64}, 1},
|
{{4|(1<<4)}, { 16*1.625, 64}, 1},
|
||||||
{{4|(0<<4)}, { 16*0.375, 64}, 1}
|
{{4|(0<<4)}, { 16*0.375, 64}, 1},
|
||||||
|
|
||||||
};
|
};
|
||||||
#elif defined (dzrgb60_ansi)
|
#elif defined (dzrgb60_ansi)
|
||||||
const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
|
const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
|
||||||
/* Refer to IS31 manual for these locations
|
|
||||||
* driver
|
|
||||||
* | R location
|
|
||||||
* | | G location
|
|
||||||
* | | | B location
|
|
||||||
* | | | | */
|
|
||||||
{0, K_14, J_14, L_14},
|
{0, K_14, J_14, L_14},
|
||||||
{0, K_13, J_13, L_13},
|
{0, K_13, J_13, L_13},
|
||||||
{0, K_12, J_12, L_12},
|
{0, K_12, J_12, L_12},
|
||||||
@@ -460,7 +401,6 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
|
|||||||
{0, K_3, J_3, L_3},
|
{0, K_3, J_3, L_3},
|
||||||
{0, K_2, J_2, L_2},
|
{0, K_2, J_2, L_2},
|
||||||
{0, K_1, J_1, L_1},
|
{0, K_1, J_1, L_1},
|
||||||
|
|
||||||
{0, H_14, G_14, I_14},
|
{0, H_14, G_14, I_14},
|
||||||
{0, H_13, G_13, I_13},
|
{0, H_13, G_13, I_13},
|
||||||
{0, H_12, G_12, I_12},
|
{0, H_12, G_12, I_12},
|
||||||
@@ -475,7 +415,6 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
|
|||||||
{0, H_3, G_3, I_3},
|
{0, H_3, G_3, I_3},
|
||||||
{0, H_2, G_2, I_2},
|
{0, H_2, G_2, I_2},
|
||||||
{0, H_1, G_1, I_1},
|
{0, H_1, G_1, I_1},
|
||||||
|
|
||||||
{0, E_14, D_14, F_14},
|
{0, E_14, D_14, F_14},
|
||||||
{0, E_12, D_12, F_12},
|
{0, E_12, D_12, F_12},
|
||||||
{0, E_11, D_11, F_11},
|
{0, E_11, D_11, F_11},
|
||||||
@@ -489,7 +428,6 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
|
|||||||
{0, E_3, D_3, F_3},
|
{0, E_3, D_3, F_3},
|
||||||
{0, E_2, D_2, F_2},
|
{0, E_2, D_2, F_2},
|
||||||
{0, E_1, D_1, F_1},
|
{0, E_1, D_1, F_1},
|
||||||
|
|
||||||
{0, B_13, A_13, C_13},
|
{0, B_13, A_13, C_13},
|
||||||
{0, B_11, A_11, C_11},
|
{0, B_11, A_11, C_11},
|
||||||
{0, B_10, A_10, C_10},
|
{0, B_10, A_10, C_10},
|
||||||
@@ -502,7 +440,6 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
|
|||||||
{0, B_3, A_3, C_3},
|
{0, B_3, A_3, C_3},
|
||||||
{0, B_2, A_2, C_2},
|
{0, B_2, A_2, C_2},
|
||||||
{0, B_1, A_1, C_1},
|
{0, B_1, A_1, C_1},
|
||||||
|
|
||||||
{0, B_15, A_15, C_15},
|
{0, B_15, A_15, C_15},
|
||||||
{0, E_13, D_13, F_13},
|
{0, E_13, D_13, F_13},
|
||||||
{0, B_12, A_12, C_12},
|
{0, B_12, A_12, C_12},
|
||||||
@@ -510,9 +447,8 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
|
|||||||
{0, B_16, A_16, C_16},
|
{0, B_16, A_16, C_16},
|
||||||
{0, E_16, D_16, F_16},
|
{0, E_16, D_16, F_16},
|
||||||
{0, H_16, G_16, I_16},
|
{0, H_16, G_16, I_16},
|
||||||
{0, K_16, J_16, L_16}
|
{0, K_16, J_16, L_16},
|
||||||
};
|
};
|
||||||
|
|
||||||
const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
|
const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
|
||||||
{{0|(13<<4)}, {16*13.5, 0}, 1},
|
{{0|(13<<4)}, {16*13.5, 0}, 1},
|
||||||
{{0|(12<<4)}, {16*12, 0}, 1},
|
{{0|(12<<4)}, {16*12, 0}, 1},
|
||||||
@@ -528,7 +464,6 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
|
|||||||
{{0|(2<<4)}, {16*2, 0}, 1},
|
{{0|(2<<4)}, {16*2, 0}, 1},
|
||||||
{{0|(1<<4)}, {16*1, 0}, 1},
|
{{0|(1<<4)}, {16*1, 0}, 1},
|
||||||
{{0|(0<<4)}, {16*0, 0}, 1},
|
{{0|(0<<4)}, {16*0, 0}, 1},
|
||||||
|
|
||||||
{{1|(13<<4)}, {16*13.75, 16}, 1},
|
{{1|(13<<4)}, {16*13.75, 16}, 1},
|
||||||
{{1|(12<<4)}, {16*12.5, 16}, 0},
|
{{1|(12<<4)}, {16*12.5, 16}, 0},
|
||||||
{{1|(11<<4)}, {16*11.5, 16}, 0},
|
{{1|(11<<4)}, {16*11.5, 16}, 0},
|
||||||
@@ -543,7 +478,6 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
|
|||||||
{{1|(2<<4)}, { 16*2.5, 16}, 0},
|
{{1|(2<<4)}, { 16*2.5, 16}, 0},
|
||||||
{{1|(1<<4)}, { 16*1.5, 16}, 0},
|
{{1|(1<<4)}, { 16*1.5, 16}, 0},
|
||||||
{{1|(0<<4)}, { 16*0.25, 16}, 1},
|
{{1|(0<<4)}, { 16*0.25, 16}, 1},
|
||||||
|
|
||||||
{{2|(13<<4)}, {16*13.375, 24}, 1},
|
{{2|(13<<4)}, {16*13.375, 24}, 1},
|
||||||
{{2|(11<<4)}, {16*11.75, 32}, 0},
|
{{2|(11<<4)}, {16*11.75, 32}, 0},
|
||||||
{{2|(10<<4)}, {16*10.75, 32}, 0},
|
{{2|(10<<4)}, {16*10.75, 32}, 0},
|
||||||
@@ -557,7 +491,6 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
|
|||||||
{{2|(2<<4)}, { 16*2.75, 32}, 0},
|
{{2|(2<<4)}, { 16*2.75, 32}, 0},
|
||||||
{{2|(1<<4)}, { 16*1.75, 32}, 0},
|
{{2|(1<<4)}, { 16*1.75, 32}, 0},
|
||||||
{{2|(0<<4)}, { 16*0.375, 32}, 1},
|
{{2|(0<<4)}, { 16*0.375, 32}, 1},
|
||||||
|
|
||||||
{{3|(11<<4)}, {16*13.125, 48}, 1},
|
{{3|(11<<4)}, {16*13.125, 48}, 1},
|
||||||
{{3|(10<<4)}, {16*11.25, 48}, 0},
|
{{3|(10<<4)}, {16*11.25, 48}, 0},
|
||||||
{{3|(9<<4)}, {16*10.25, 48}, 0},
|
{{3|(9<<4)}, {16*10.25, 48}, 0},
|
||||||
@@ -570,7 +503,6 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
|
|||||||
{{3|(2<<4)}, {16*3.25, 48}, 0},
|
{{3|(2<<4)}, {16*3.25, 48}, 0},
|
||||||
{{3|(1<<4)}, {16*1.25, 48}, 0},
|
{{3|(1<<4)}, {16*1.25, 48}, 0},
|
||||||
{{3|(0<<4)}, {16*0.625, 48}, 1},
|
{{3|(0<<4)}, {16*0.625, 48}, 1},
|
||||||
|
|
||||||
{{4|(13<<4)}, {16*13.875, 64}, 1},
|
{{4|(13<<4)}, {16*13.875, 64}, 1},
|
||||||
{{4|(11<<4)}, {16*12.625, 64}, 1},
|
{{4|(11<<4)}, {16*12.625, 64}, 1},
|
||||||
{{4|(10<<4)}, {16*11.375, 64}, 1},
|
{{4|(10<<4)}, {16*11.375, 64}, 1},
|
||||||
@@ -578,17 +510,10 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
|
|||||||
{{4|(5<<4)}, { 16*6.375, 64}, 0},
|
{{4|(5<<4)}, { 16*6.375, 64}, 0},
|
||||||
{{4|(2<<4)}, { 16*2.625, 64}, 1},
|
{{4|(2<<4)}, { 16*2.625, 64}, 1},
|
||||||
{{4|(1<<4)}, { 16*1.375, 64}, 1},
|
{{4|(1<<4)}, { 16*1.375, 64}, 1},
|
||||||
{{4|(0<<4)}, { 16*0.125, 64}, 1}
|
{{4|(0<<4)}, { 16*0.125, 64}, 1},
|
||||||
};
|
};
|
||||||
#else
|
#else
|
||||||
|
|
||||||
const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
|
const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
|
||||||
/* Refer to IS31 manual for these locations
|
|
||||||
* driver
|
|
||||||
* | R location
|
|
||||||
* | | G location
|
|
||||||
* | | | B location
|
|
||||||
* | | | | */
|
|
||||||
{0, K_14, J_14, L_14},
|
{0, K_14, J_14, L_14},
|
||||||
{0, K_13, J_13, L_13},
|
{0, K_13, J_13, L_13},
|
||||||
{0, K_12, J_12, L_12},
|
{0, K_12, J_12, L_12},
|
||||||
@@ -603,7 +528,6 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
|
|||||||
{0, K_3, J_3, L_3},
|
{0, K_3, J_3, L_3},
|
||||||
{0, K_2, J_2, L_2},
|
{0, K_2, J_2, L_2},
|
||||||
{0, K_1, J_1, L_1},
|
{0, K_1, J_1, L_1},
|
||||||
|
|
||||||
{0, H_14, G_14, I_14},
|
{0, H_14, G_14, I_14},
|
||||||
{0, H_13, G_13, I_13},
|
{0, H_13, G_13, I_13},
|
||||||
{0, H_12, G_12, I_12},
|
{0, H_12, G_12, I_12},
|
||||||
@@ -618,7 +542,6 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
|
|||||||
{0, H_3, G_3, I_3},
|
{0, H_3, G_3, I_3},
|
||||||
{0, H_2, G_2, I_2},
|
{0, H_2, G_2, I_2},
|
||||||
{0, H_1, G_1, I_1},
|
{0, H_1, G_1, I_1},
|
||||||
|
|
||||||
{0, E_14, D_14, F_14},
|
{0, E_14, D_14, F_14},
|
||||||
{0, E_12, D_12, F_12},
|
{0, E_12, D_12, F_12},
|
||||||
{0, E_11, D_11, F_11},
|
{0, E_11, D_11, F_11},
|
||||||
@@ -632,7 +555,6 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
|
|||||||
{0, E_3, D_3, F_3},
|
{0, E_3, D_3, F_3},
|
||||||
{0, E_2, D_2, F_2},
|
{0, E_2, D_2, F_2},
|
||||||
{0, E_1, D_1, F_1},
|
{0, E_1, D_1, F_1},
|
||||||
|
|
||||||
{0, B_14, A_14, C_14},
|
{0, B_14, A_14, C_14},
|
||||||
{0, B_13, A_13, C_13},
|
{0, B_13, A_13, C_13},
|
||||||
{0, B_11, A_11, C_11},
|
{0, B_11, A_11, C_11},
|
||||||
@@ -646,7 +568,6 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
|
|||||||
{0, B_3, A_3, C_3},
|
{0, B_3, A_3, C_3},
|
||||||
{0, B_2, A_2, C_2},
|
{0, B_2, A_2, C_2},
|
||||||
{0, B_1, A_1, C_1},
|
{0, B_1, A_1, C_1},
|
||||||
|
|
||||||
{0, B_15, A_15, C_15},
|
{0, B_15, A_15, C_15},
|
||||||
{0, E_13, D_13, F_13},
|
{0, E_13, D_13, F_13},
|
||||||
{0, B_12, A_12, C_12},
|
{0, B_12, A_12, C_12},
|
||||||
@@ -655,9 +576,8 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
|
|||||||
{0, B_16, A_16, C_16},
|
{0, B_16, A_16, C_16},
|
||||||
{0, E_16, D_16, F_16},
|
{0, E_16, D_16, F_16},
|
||||||
{0, H_16, G_16, I_16},
|
{0, H_16, G_16, I_16},
|
||||||
{0, K_16, J_16, L_16}
|
{0, K_16, J_16, L_16},
|
||||||
};
|
};
|
||||||
|
|
||||||
const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
|
const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
|
||||||
{{0|(13<<4)}, {17.23*13, 0}, 1},
|
{{0|(13<<4)}, {17.23*13, 0}, 1},
|
||||||
{{0|(12<<4)}, {17.23*12, 0}, 1},
|
{{0|(12<<4)}, {17.23*12, 0}, 1},
|
||||||
@@ -673,7 +593,6 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
|
|||||||
{{0|(2<<4)}, { 17.23*2, 0}, 1},
|
{{0|(2<<4)}, { 17.23*2, 0}, 1},
|
||||||
{{0|(1<<4)}, { 17.23*1, 0}, 1},
|
{{0|(1<<4)}, { 17.23*1, 0}, 1},
|
||||||
{{0|(0<<4)}, { 17.23*0, 0}, 1},
|
{{0|(0<<4)}, { 17.23*0, 0}, 1},
|
||||||
|
|
||||||
{{1|(13<<4)}, {17.23*13, 16}, 1},
|
{{1|(13<<4)}, {17.23*13, 16}, 1},
|
||||||
{{1|(12<<4)}, {17.23*12, 16}, 0},
|
{{1|(12<<4)}, {17.23*12, 16}, 0},
|
||||||
{{1|(11<<4)}, {17.23*11, 16}, 0},
|
{{1|(11<<4)}, {17.23*11, 16}, 0},
|
||||||
@@ -688,7 +607,6 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
|
|||||||
{{1|(2<<4)}, { 17.23*2, 16}, 0},
|
{{1|(2<<4)}, { 17.23*2, 16}, 0},
|
||||||
{{1|(1<<4)}, { 17.23*1, 16}, 0},
|
{{1|(1<<4)}, { 17.23*1, 16}, 0},
|
||||||
{{1|(0<<4)}, { 17.23*0, 16}, 1},
|
{{1|(0<<4)}, { 17.23*0, 16}, 1},
|
||||||
|
|
||||||
{{2|(13<<4)}, {17.23*13, 32}, 1},
|
{{2|(13<<4)}, {17.23*13, 32}, 1},
|
||||||
{{2|(11<<4)}, {17.23*11, 32}, 0},
|
{{2|(11<<4)}, {17.23*11, 32}, 0},
|
||||||
{{2|(10<<4)}, {17.23*10, 32}, 0},
|
{{2|(10<<4)}, {17.23*10, 32}, 0},
|
||||||
@@ -702,7 +620,6 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
|
|||||||
{{2|(2<<4)}, { 17.23*2, 32}, 0},
|
{{2|(2<<4)}, { 17.23*2, 32}, 0},
|
||||||
{{2|(1<<4)}, { 17.23*1, 32}, 0},
|
{{2|(1<<4)}, { 17.23*1, 32}, 0},
|
||||||
{{2|(0<<4)}, { 17.23*0, 32}, 1},
|
{{2|(0<<4)}, { 17.23*0, 32}, 1},
|
||||||
|
|
||||||
{{3|(13<<4)}, {17.23*13, 48}, 1},
|
{{3|(13<<4)}, {17.23*13, 48}, 1},
|
||||||
{{3|(11<<4)}, {17.23*11, 48}, 0},
|
{{3|(11<<4)}, {17.23*11, 48}, 0},
|
||||||
{{3|(10<<4)}, {17.23*10, 48}, 0},
|
{{3|(10<<4)}, {17.23*10, 48}, 0},
|
||||||
@@ -716,7 +633,6 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
|
|||||||
{{3|(2<<4)}, { 17.23*2, 48}, 0},
|
{{3|(2<<4)}, { 17.23*2, 48}, 0},
|
||||||
{{3|(1<<4)}, { 17.23*1, 48}, 0},
|
{{3|(1<<4)}, { 17.23*1, 48}, 0},
|
||||||
{{3|(0<<4)}, { 17.23*0, 48}, 1},
|
{{3|(0<<4)}, { 17.23*0, 48}, 1},
|
||||||
|
|
||||||
{{4|(13<<4)}, {17.23*13, 64}, 1},
|
{{4|(13<<4)}, {17.23*13, 64}, 1},
|
||||||
{{4|(11<<4)}, {17.23*11, 64}, 1},
|
{{4|(11<<4)}, {17.23*11, 64}, 1},
|
||||||
{{4|(10<<4)}, {17.23*10, 64}, 1},
|
{{4|(10<<4)}, {17.23*10, 64}, 1},
|
||||||
@@ -725,32 +641,27 @@ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
|
|||||||
{{4|(5<<4)}, { 17.23*5, 64}, 0},
|
{{4|(5<<4)}, { 17.23*5, 64}, 0},
|
||||||
{{4|(2<<4)}, { 17.23*2, 64}, 1},
|
{{4|(2<<4)}, { 17.23*2, 64}, 1},
|
||||||
{{4|(1<<4)}, { 17.23*1, 64}, 1},
|
{{4|(1<<4)}, { 17.23*1, 64}, 1},
|
||||||
{{4|(0<<4)}, { 17.23*0, 64}, 1}
|
{{4|(0<<4)}, { 17.23*0, 64}, 1},
|
||||||
|
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void matrix_init_kb(void) {
|
void matrix_init_kb(void) {
|
||||||
matrix_init_user();
|
matrix_init_user();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void matrix_scan_kb(void) {
|
void matrix_scan_kb(void) {
|
||||||
matrix_scan_user();
|
matrix_scan_user();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||||
return process_record_user(keycode, record);
|
return process_record_user(keycode, record);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void suspend_power_down_kb(void)
|
void suspend_power_down_kb(void)
|
||||||
{
|
{
|
||||||
rgb_matrix_set_suspend_state(true);
|
rgb_matrix_set_suspend_state(true);
|
||||||
|
suspend_power_down_user();
|
||||||
}
|
}
|
||||||
|
|
||||||
void suspend_wakeup_init_kb(void)
|
void suspend_wakeup_init_kb(void)
|
||||||
{
|
{
|
||||||
rgb_matrix_set_suspend_state(false);
|
rgb_matrix_set_suspend_state(false);
|
||||||
|
suspend_wakeup_init_user();
|
||||||
}
|
}
|
||||||
@@ -5,26 +5,23 @@ extern bool g_suspend_state;
|
|||||||
#define _LAYER2 2
|
#define _LAYER2 2
|
||||||
#define _LAYER3 3
|
#define _LAYER3 3
|
||||||
#define _LAYER4 4
|
#define _LAYER4 4
|
||||||
#define _LAYER5 5
|
|
||||||
#define _LAYER6 6
|
|
||||||
#define _LAYER7 7
|
|
||||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
[_LAYER0] = LAYOUT( /* Base */
|
[_LAYER0] = LAYOUT( /* Base */
|
||||||
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_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_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_BSLASH,\
|
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_BSLASH,\
|
||||||
CTL_T(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, \
|
CTL_T(KC_CAPS), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \
|
||||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, RSFT_T(KC_SLSH), KC_UP, LT(2, KC_DEL),\
|
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, RSFT_T(KC_SLSH), KC_UP, LT(2, KC_DEL),\
|
||||||
KC_LCTL, KC_LGUI, LM(1, MOD_LALT), KC_SPC, KC_RALT, MO(1) , KC_LEFT, KC_DOWN, KC_RIGHT),
|
KC_LCTL, KC_LGUI, LM(1, MOD_LALT), KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RIGHT),
|
||||||
[_LAYER1] = LAYOUT( /* FN */
|
[_LAYER1] = LAYOUT( /* FN */
|
||||||
TO(3), 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 ,\
|
TO(3), KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL ,\
|
||||||
KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_CALC, KC_TRNS, KC_INS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, RESET ,\
|
KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_CALC, KC_TRNS, KC_INS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, RESET ,\
|
||||||
KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGUP, KC_TRNS,\
|
KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGUP, EEP_RST,\
|
||||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_END, KC_PGDOWN,KC_VOLU, KC_MUTE,\
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_END, KC_PGDOWN,KC_VOLU, KC_MUTE,\
|
||||||
KC_TRNS, KC_TRNS, KC_TRNS, TO(4), KC_TRNS, KC_TRNS, KC_MPRV, KC_VOLD, KC_MNXT),
|
KC_TRNS, KC_TRNS, KC_TRNS, TO(4), KC_TRNS, KC_TRNS, KC_MPRV, KC_VOLD, KC_MNXT),
|
||||||
[_LAYER2] = LAYOUT( /* LIGHT */
|
[_LAYER2] = LAYOUT( /* LIGHT */
|
||||||
KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL ,\
|
KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL ,\
|
||||||
KC_TRNS, RGB_TOG, KC_TRNS, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, RGB_MOD, KC_TRNS, KC_TRNS, KC_TRNS, RESET ,\
|
KC_TRNS, RGB_TOG, KC_TRNS, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, RGB_MOD, KC_TRNS, KC_TRNS, KC_TRNS, RESET ,\
|
||||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_SPI, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS,\
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_SPI, RGB_SPD, KC_TRNS, KC_TRNS, EEP_RST,\
|
||||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\
|
||||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
|
||||||
[_LAYER3] = LAYOUT( /* NUMPAD */
|
[_LAYER3] = LAYOUT( /* NUMPAD */
|
||||||
@@ -33,38 +30,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||||||
KC_TRNS, KC_P4, KC_P5, KC_P6, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_P4, KC_P5, KC_P6, KC_TRNS, KC_PENT,\
|
KC_TRNS, KC_P4, KC_P5, KC_P6, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_P4, KC_P5, KC_P6, KC_TRNS, KC_PENT,\
|
||||||
KC_TRNS, KC_P1, KC_P2, KC_P3, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_P1, KC_P2, KC_P3, KC_TRNS, KC_TRNS,\
|
KC_TRNS, KC_P1, KC_P2, KC_P3, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_P1, KC_P2, KC_P3, KC_TRNS, KC_TRNS,\
|
||||||
KC_TRNS, KC_P0, KC_PDOT, KC_PENT, KC_P0, KC_PDOT, KC_TRNS, KC_TRNS, KC_TRNS),
|
KC_TRNS, KC_P0, KC_PDOT, KC_PENT, KC_P0, KC_PDOT, KC_TRNS, KC_TRNS, KC_TRNS),
|
||||||
[_LAYER4] = LAYOUT( /* MAC */
|
[_LAYER4] = LAYOUT( /* SWITCH LALT AND LGUI */
|
||||||
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_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_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_BSLASH,\
|
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_BSLASH,\
|
||||||
CTL_T(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, \
|
CTL_T(KC_CAPS), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \
|
||||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, RSFT_T(KC_SLSH), KC_UP, LT(2, KC_DEL),\
|
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, RSFT_T(KC_SLSH), KC_UP, LT(2, KC_DEL),\
|
||||||
KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MO(5) , KC_LEFT, KC_DOWN, KC_RIGHT),
|
KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, TO(0), KC_LEFT, KC_DOWN, KC_RIGHT),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool default_layer) {
|
|
||||||
rgb_led led;
|
|
||||||
for (int i = 0; i < DRIVER_LED_TOTAL; i++) {
|
|
||||||
led = g_rgb_leds[i];
|
|
||||||
if (led.matrix_co.raw < 0xFF) {
|
|
||||||
if (led.modifier) {
|
|
||||||
rgb_matrix_set_color( i, red, green, blue );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void rgb_matrix_indicators_user(void) {
|
void rgb_matrix_indicators_user(void) {
|
||||||
uint8_t this_led = host_keyboard_leds();
|
uint8_t this_led = host_keyboard_leds();
|
||||||
if (!g_suspend_state) {
|
if (!g_suspend_state) {
|
||||||
switch (biton32(layer_state)) {
|
switch (biton32(layer_state)) {
|
||||||
case _LAYER1:
|
|
||||||
rgb_matrix_layer_helper(0xFF, 0x00, 0x00, false);
|
|
||||||
break;
|
|
||||||
case _LAYER2:
|
|
||||||
rgb_matrix_layer_helper(0x00, 0xFF, 0x00, false);
|
|
||||||
break;
|
|
||||||
case _LAYER3:
|
case _LAYER3:
|
||||||
if ( this_led & (1<<USB_LED_NUM_LOCK)) {
|
if ( this_led & (1<<USB_LED_NUM_LOCK)) {
|
||||||
rgb_matrix_set_color(13, 0xFF, 0x00, 0x00);
|
rgb_matrix_set_color(13, 0xFF, 0x00, 0x00);
|
||||||
@@ -136,20 +113,15 @@ void rgb_matrix_indicators_user(void) {
|
|||||||
rgb_matrix_set_color(62, 0x00, 0x00, 0x00);
|
rgb_matrix_set_color(62, 0x00, 0x00, 0x00);
|
||||||
break;
|
break;
|
||||||
case _LAYER4:
|
case _LAYER4:
|
||||||
rgb_matrix_layer_helper(0xFF, 0xFF, 0x00, false);
|
rgb_matrix_set_color_all(0xFF, 0xFF, 0x00);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ( this_led & (1<<USB_LED_CAPS_LOCK)) {
|
if ( this_led & (1<<USB_LED_CAPS_LOCK)) {
|
||||||
rgb_matrix_set_color(40, 0xFF, 0xFF, 0xFF);
|
rgb_matrix_set_color(40, 0xFF, 0xFF, 0xFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void matrix_init_user(void) {
|
void matrix_init_user(void) {
|
||||||
//user initialization
|
//user initialization
|
||||||
}
|
}
|
||||||
@@ -158,6 +130,6 @@ void matrix_scan_user(void) {
|
|||||||
//user matrix
|
//user matrix
|
||||||
}
|
}
|
||||||
|
|
||||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -33,17 +33,10 @@ USE_FPU = yes
|
|||||||
# OPT_DEFS = -DCORTEX_VTOR_INIT=0x08005000
|
# OPT_DEFS = -DCORTEX_VTOR_INIT=0x08005000
|
||||||
OPT_DEFS =
|
OPT_DEFS =
|
||||||
|
|
||||||
# Do not put the microcontroller into power saving mode
|
|
||||||
# when we get USB suspend event. We want it to keep updating
|
|
||||||
# backlight effects.
|
|
||||||
OPT_DEFS += -DNO_SUSPEND_POWER_DOWN
|
|
||||||
|
|
||||||
# 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
|
||||||
|
|
||||||
# Build Options
|
|
||||||
# comment out to disable the options.
|
|
||||||
#
|
|
||||||
BACKLIGHT_ENABLE = no
|
BACKLIGHT_ENABLE = no
|
||||||
BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration
|
BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration
|
||||||
MOUSEKEY_ENABLE = yes # Mouse keys
|
MOUSEKEY_ENABLE = yes # Mouse keys
|
||||||
|
|||||||
@@ -0,0 +1,50 @@
|
|||||||
|
{
|
||||||
|
"keyboard_name": "NQG (Not Quite Gherkin)",
|
||||||
|
"url": "",
|
||||||
|
"maintainer": "culturalsnow",
|
||||||
|
"width": 11,
|
||||||
|
"height": 4,
|
||||||
|
"layouts": {
|
||||||
|
"LAYOUT": {
|
||||||
|
"layout": [
|
||||||
|
{"label":"Q", "x":1, "y":0},
|
||||||
|
{"label":"W", "x":2, "y":0},
|
||||||
|
{"label":"E", "x":3, "y":0},
|
||||||
|
{"label":"R", "x":4, "y":0},
|
||||||
|
{"label":"T", "x":5, "y":0},
|
||||||
|
{"label":"Y", "x":6, "y":0},
|
||||||
|
{"label":"U", "x":7, "y":0},
|
||||||
|
{"label":"I", "x":8, "y":0},
|
||||||
|
{"label":"O", "x":9, "y":0},
|
||||||
|
{"label":"P", "x":10, "y":0},
|
||||||
|
{"label":"A", "x":1, "y":1},
|
||||||
|
{"label":"S", "x":2, "y":1},
|
||||||
|
{"label":"D", "x":3, "y":1},
|
||||||
|
{"label":"F", "x":4, "y":1},
|
||||||
|
{"label":"G", "x":5, "y":1},
|
||||||
|
{"label":"H", "x":6, "y":1},
|
||||||
|
{"label":"J", "x":7, "y":1},
|
||||||
|
{"label":"K", "x":8, "y":1},
|
||||||
|
{"label":"L", "x":9, "y":1},
|
||||||
|
{"label":"; '", "x":10, "y":1},
|
||||||
|
{"label":"Z", "x":1, "y":2},
|
||||||
|
{"label":"X", "x":2, "y":2},
|
||||||
|
{"label":"C", "x":3, "y":2},
|
||||||
|
{"label":"V", "x":4, "y":2},
|
||||||
|
{"label":"B", "x":5, "y":2},
|
||||||
|
{"label":"N", "x":6, "y":2},
|
||||||
|
{"label":"M", "x":7, "y":2},
|
||||||
|
{"label":",", "x":8, "y":2},
|
||||||
|
{"label":".", "x":9, "y":2},
|
||||||
|
{"label":"/ Enter", "x":10, "y":2},
|
||||||
|
{"label":"Shift / Tab", "x":0, "y":2},
|
||||||
|
{"label":"LT(_LOWER, KC_ESC)", "x":3, "y":3},
|
||||||
|
{"label":"Ctrl / Backspace", "x":4, "y":3},
|
||||||
|
{"label":"Ctrl / Backspace", "x":5, "y":3},
|
||||||
|
{"label":"Space", "x":6, "y":3},
|
||||||
|
{"label":"Space", "x":7, "y":3},
|
||||||
|
{"label":"MO(_RAISE)", "x":8, "y":3}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
NQG (Not Quite Gherkin) is a 30% ortholinear keyboard with a macro key and dedicated row for thumb keys, made by emptystring studio.
|
NQG (Not Quite Gherkin) is a 30% ortholinear keyboard with a macro key and dedicated row for thumb keys, made by emptystring studio.
|
||||||
|
|
||||||
Keyboard Maintainer: [Culturalsnow](http://github.com/culturalsnow)
|
Keyboard Maintainer: [Culturalsnow](http://github.com/culturalsnow)
|
||||||
Hardware Supported: NQG PCB, Pro Micro
|
Hardware Supported: NQG PCB, Pro Micro
|
||||||
Hardware Availability: Kits are available from [SA_EndlessGame](http://twitter.com/SA_EndlessGame)
|
Hardware Availability: Kits are available from [SA_EndlessGame](http://twitter.com/SA_EndlessGame)
|
||||||
|
|
||||||
|
|||||||
Loaded 100 of 284 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user