mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-07-17 13:12:08 +00:00
Merge branch 'master' into roguepullrequest
This commit is contained in:
commit
fd6b3ee373
@ -1,4 +1,4 @@
|
||||
---
|
||||
---
|
||||
BasedOnStyle: Google
|
||||
AlignAfterOpenBracket: Align
|
||||
AlignConsecutiveAssignments: 'true'
|
||||
@ -20,7 +20,7 @@ SortIncludes: 'false'
|
||||
SpaceBeforeAssignmentOperators: 'true'
|
||||
SpaceBeforeParens: ControlStatements
|
||||
SpaceInEmptyParentheses: 'false'
|
||||
TabWidth: '2'
|
||||
TabWidth: '4'
|
||||
UseTab: Never
|
||||
|
||||
...
|
||||
|
@ -5,7 +5,7 @@ root = true
|
||||
|
||||
[*]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
indent_size = 4
|
||||
|
||||
# We recommend you to keep these unchanged
|
||||
charset = utf-8
|
||||
|
@ -21,7 +21,7 @@ before_script:
|
||||
- avr-gcc --version
|
||||
script:
|
||||
- git rev-parse --short HEAD
|
||||
- make test:all
|
||||
- bash util/travis_test.sh
|
||||
- bash util/travis_build.sh
|
||||
- bash util/travis_docs.sh
|
||||
addons:
|
||||
|
@ -280,6 +280,23 @@ ifneq ("$(wildcard $(KEYBOARD_PATH_1)/config.h)","")
|
||||
CONFIG_H += $(KEYBOARD_PATH_1)/config.h
|
||||
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
|
||||
PROJECT_DEFS := $(OPT_DEFS)
|
||||
PROJECT_INC := $(VPATH) $(EXTRAINCDIRS) $(KEYBOARD_PATHS)
|
||||
@ -355,6 +372,7 @@ ifeq ($(strip $(VISUALIZER_ENABLE)), yes)
|
||||
include $(VISUALIZER_PATH)/visualizer.mk
|
||||
endif
|
||||
|
||||
CONFIG_H += $(POST_CONFIG_H)
|
||||
ALL_CONFIGS := $(PROJECT_CONFIG) $(CONFIG_H)
|
||||
|
||||
OUTPUTS := $(KEYMAP_OUTPUT) $(KEYBOARD_OUTPUT)
|
||||
|
@ -103,6 +103,7 @@ ifeq ($(strip $(UNICODE_COMMON)), yes)
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
|
||||
POST_CONFIG_H += $(QUANTUM_DIR)/rgblight_post_config.h
|
||||
OPT_DEFS += -DRGBLIGHT_ENABLE
|
||||
SRC += $(QUANTUM_DIR)/rgblight.c
|
||||
CIE1931_CURVE = yes
|
||||
@ -318,6 +319,7 @@ ifneq ($(strip $(DEBOUNCE_TYPE)), custom)
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(SPLIT_KEYBOARD)), yes)
|
||||
POST_CONFIG_H += $(QUANTUM_DIR)/split_common/post_config.h
|
||||
OPT_DEFS += -DSPLIT_KEYBOARD
|
||||
|
||||
# Include files used by all split keyboards
|
||||
@ -334,3 +336,10 @@ ifeq ($(strip $(SPLIT_KEYBOARD)), yes)
|
||||
endif
|
||||
COMMON_VPATH += $(QUANTUM_PATH)/split_common
|
||||
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
|
||||
* `#define RGBLED_NUM 12`
|
||||
* 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 }`
|
||||
* 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
|
||||
* 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`
|
||||
* units to step when in/decreasing hue
|
||||
* `#define RGBLIGHT_SAT_STEP 25`
|
||||
|
@ -56,7 +56,7 @@ Never made an open source contribution before? Wondering how contributions work
|
||||
|
||||
Most of our style is pretty easy to pick up on, but right now it's not entirely consistent. You should match the style of the code surrounding your change, but if that code is inconsistent or unclear use the following guidelines:
|
||||
|
||||
* We indent using two spaces (soft tabs)
|
||||
* We indent using four (4) spaces (soft tabs)
|
||||
* We use a modified One True Brace Style
|
||||
* Opening Brace: At the end of the same line as the statement that opens the block
|
||||
* Closing Brace: Lined up with the first character of the statement that opens the block
|
||||
@ -71,6 +71,14 @@ Most of our style is pretty easy to pick up on, but right now it's not entirely
|
||||
* If you not sure if a comment is obvious, go ahead and include it.
|
||||
* In general we don't wrap lines, they can be as long as needed. If you do choose to wrap lines please do not wrap any wider than 76 columns.
|
||||
* We use `#pragma once` at the start of header files rather than old-style include guards (`#ifndef THIS_FILE_H`, `#define THIS_FILE_H`, ..., `#endif`)
|
||||
* We accept both forms of preprocessor if's: `#ifdef DEFINED` and `#if defined(DEFINED)`
|
||||
* If you are not sure which to prefer use the `#if defined(DEFINED)` form.
|
||||
* Do not change existing code from one style to the other, except when moving to a multiple condition `#if`.
|
||||
* Do not put whitespace between `#` and `if`.
|
||||
* When deciding how (or if) to indent directives keep these points in mind:
|
||||
* Readability is more important than consistency.
|
||||
* Follow the file's existing style. If the file is mixed follow the style that makes sense for the section you are modifying.
|
||||
* When choosing to indent you can follow the indention level of the surrounding C code, or preprocessor directives can have their own indent level. Choose the style that best communicates the intent of your code.
|
||||
|
||||
Here is an example for easy reference:
|
||||
|
||||
|
@ -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.
|
||||
|
||||
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
|
||||
|
||||
@ -39,11 +63,26 @@ To change the behaviour of the backlighting, `#define` these in your `config.h`:
|
||||
|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_PINS` |*Not defined*|experimental: see below for more information|
|
||||
|`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_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 |
|
||||
|
||||
## 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
|
||||
|
||||
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.
|
||||
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
|
||||
|
||||
|Function |Description |
|
||||
|
@ -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,
|
||||
and add the relevant [keycodes](#mapping-mouse-actions-to-keyboard-keys) to your keymap.
|
||||
### Enabling mouse keys
|
||||
|
||||
#### 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
|
||||
```
|
||||
|
||||
#### 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 |
|
||||
|----------------|---------|-----------------------------------|
|
||||
|`KC_MS_UP` |`KC_MS_U`|Mouse Cursor Up |
|
||||
|`KC_MS_DOWN` |`KC_MS_D`|Mouse Cursor Down |
|
||||
|`KC_MS_LEFT` |`KC_MS_L`|Mouse Cursor Left |
|
||||
|`KC_MS_RIGHT` |`KC_MS_R`|Mouse Cursor Right |
|
||||
|`KC_MS_BTN1` |`KC_BTN1`|Mouse Button 1 |
|
||||
|`KC_MS_BTN2` |`KC_BTN2`|Mouse Button 2 |
|
||||
|`KC_MS_BTN3` |`KC_BTN3`|Mouse Button 3 |
|
||||
|`KC_MS_BTN4` |`KC_BTN4`|Mouse Button 4 |
|
||||
|`KC_MS_BTN5` |`KC_BTN5`|Mouse Button 5 |
|
||||
|`KC_MS_WH_UP` |`KC_WH_U`|Mouse Wheel Up |
|
||||
|`KC_MS_WH_DOWN` |`KC_WH_D`|Mouse Wheel Down |
|
||||
|`KC_MS_WH_LEFT` |`KC_WH_L`|Mouse Wheel Left |
|
||||
|`KC_MS_WH_RIGHT`|`KC_WH_R`|Mouse Wheel Right |
|
||||
|`KC_MS_ACCEL0` |`KC_ACL0`|Set mouse acceleration to 0(slow) |
|
||||
|`KC_MS_ACCEL1` |`KC_ACL1`|Set mouse acceleration to 1(medium)|
|
||||
|`KC_MS_ACCEL2` |`KC_ACL2`|Set mouse acceleration to 2(fast) |
|
||||
|Key |Aliases |Description |
|
||||
|----------------|---------|-----------------|
|
||||
|`KC_MS_UP` |`KC_MS_U`|Move cursor up |
|
||||
|`KC_MS_DOWN` |`KC_MS_D`|Move cursor down |
|
||||
|`KC_MS_LEFT` |`KC_MS_L`|Move cursor left |
|
||||
|`KC_MS_RIGHT` |`KC_MS_R`|Move cursor right|
|
||||
|`KC_MS_BTN1` |`KC_BTN1`|Press button 1 |
|
||||
|`KC_MS_BTN2` |`KC_BTN2`|Press button 2 |
|
||||
|`KC_MS_BTN3` |`KC_BTN3`|Press button 3 |
|
||||
|`KC_MS_BTN4` |`KC_BTN4`|Press button 4 |
|
||||
|`KC_MS_BTN5` |`KC_BTN5`|Press button 5 |
|
||||
|`KC_MS_WH_UP` |`KC_WH_U`|Move wheel up |
|
||||
|`KC_MS_WH_DOWN` |`KC_WH_D`|Move wheel down |
|
||||
|`KC_MS_WH_LEFT` |`KC_WH_L`|Move wheel left |
|
||||
|`KC_MS_WH_RIGHT`|`KC_WH_R`|Move wheel right |
|
||||
|`KC_MS_ACCEL0` |`KC_ACL0`|Set speed to 0 |
|
||||
|`KC_MS_ACCEL1` |`KC_ACL1`|Set speed to 1 |
|
||||
|`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.
|
||||
|
||||
```
|
||||
#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
|
||||
```
|
||||
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.
|
||||
|
||||
#### `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
|
||||
|
||||
In your keymap's `config.h`, you must add the line:
|
||||
```
|
||||
```c
|
||||
#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`:
|
||||
|
||||
```
|
||||
#define MK_3_SPEED
|
||||
#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
|
||||
```c
|
||||
#define MK_MOMENTARY_ACCEL
|
||||
```
|
||||
|
||||
Medium values will be used as the default or unmodified speed.
|
||||
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.
|
||||
Use the following settings if you want to adjust cursor movement or scrolling:
|
||||
|
||||
|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`) |
|
||||
|
274
docs/feature_oled_driver.md
Normal file
274
docs/feature_oled_driver.md
Normal file
@ -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` |
|
@ -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
|
||||
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
|
||||
x = 224 / ( NUMBER_OF_COLS - 1 ) * ROW_POSITION
|
||||
y = 64 / (NUMBER_OF_ROWS - 1 ) * COL_POSITION
|
||||
x = 224 / (NUMBER_OF_COLS - 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).
|
||||
|
||||
@ -189,6 +189,12 @@ enum rgb_matrix_effects {
|
||||
#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, // 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_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
|
||||
@ -201,27 +207,33 @@ enum rgb_matrix_effects {
|
||||
You can disable a single effect by defining `DISABLE_[EFFECT_NAME]` in your `config.h`:
|
||||
|
||||
|
||||
|Define |Description |
|
||||
|---------------------------------------------------|--------------------------------------------|
|
||||
|`#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_BREATHING` |Disables `RGB_MATRIX_BREATHING` |
|
||||
|`#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_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_DUAL_BEACON` |Disables `RGB_MATRIX_DUAL_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_RAINDROPS` |Disables `RGB_MATRIX_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_SOLID_REACTIVE` |Disables `RGB_MATRIX_SOLID_REACTIVE` |
|
||||
|`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE` |Disables `RGB_MATRIX_SOLID_REACTIVE_SIMPLEE`|
|
||||
|`#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` |
|
||||
|Define |Description |
|
||||
|-------------------------------------------------------|-----------------------------------------------|
|
||||
|`#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_BREATHING` |Disables `RGB_MATRIX_BREATHING` |
|
||||
|`#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_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_DUAL_BEACON` |Disables `RGB_MATRIX_DUAL_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_RAINDROPS` |Disables `RGB_MATRIX_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_SOLID_REACTIVE` |Disables `RGB_MATRIX_SOLID_REACTIVE` |
|
||||
|`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE` |Disables `RGB_MATRIX_SOLID_REACTIVE_SIMPLE` |
|
||||
|`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE` |Disables `RGB_MATRIX_SOLID_REACTIVE_WIDE` |
|
||||
|`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE` |Disables `RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE` |
|
||||
|`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS` |Disables `RGB_MATRIX_SOLID_REACTIVE_CROSS` |
|
||||
|`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS` |Disables `RGB_MATRIX_SOLID_REACTIVE_MULTICROSS`|
|
||||
|`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS` |Disables `RGB_MATRIX_SOLID_REACTIVE_NEXUS` |
|
||||
|`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS` |Disables `RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS`|
|
||||
|`#define DISABLE_RGB_MATRIX_SPLASH` |Disables `RGB_MATRIX_SPLASH` |
|
||||
|`#define DISABLE_RGB_MATRIX_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
|
||||
@ -236,6 +248,35 @@ void rgb_matrix_indicators_kb(void) {
|
||||
|
||||
A similar function works in the keymap as `rgb_matrix_indicators_user`.
|
||||
|
||||
|
||||
## 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
|
||||
|
||||
```C
|
||||
@ -253,10 +294,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:
|
||||
|
||||
```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
|
||||
|
||||
|
@ -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_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_SPLIT` |*Not defined*|If defined, synchronization functionality for split keyboards is added|
|
||||
|
||||
## 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_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
|
||||
|
||||
|
@ -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.
|
||||
|
||||
## 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
|
||||
|
||||
@ -32,4 +32,4 @@ Support for up to 2 drivers. Each driver impliments 2 charlieplex matrices to in
|
||||
|
||||
## 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.
|
||||
|
32
docs/zh-cn/README.md
Normal file
32
docs/zh-cn/README.md
Normal file
@ -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克隆 (`git@github.com:qmk/qmk_firmware.git`), 或 https (`https://github.com/qmk/qmk_firmware.git`).
|
||||
|
||||
## 如何编译
|
||||
|
||||
在你能编译之前, 你需要[部署环境](getting_started_build_tools.md) 用于 AVR or/and ARM 开发。完成后, 你可以使用 `make` 命令来编译一个键盘和布局使用以下命令:
|
||||
|
||||
make planck/rev4:default
|
||||
|
||||
这将建立 `planck`的`rev4` 修订版本并使用 `default`布局。并非所有键盘都有修订版本 (也叫做子项目或文件夹),在此情况下,修订版本可以省略,如下:
|
||||
|
||||
make preonic:default
|
||||
|
||||
## 如何定制
|
||||
|
||||
QMK 有许多 [特性](features.md)来探索,也有很多 [参考文档](http://docs.qmk.fm) 供您发掘。你可以通过修改 [布局](keymap.md)和[键码](keycodes.md)来利用许多特性。
|
106
docs/zh-cn/_summary.md
Normal file
106
docs/zh-cn/_summary.md
Normal file
@ -0,0 +1,106 @@
|
||||
* [完全菜鸟指南](newbs.md)
|
||||
* [入门](newbs_getting_started.md)
|
||||
* [构建你的第一个固件](newbs_building_firmware.md)
|
||||
* [刷新固件](newbs_flashing.md)
|
||||
* [测试和调试](newbs_testing_debugging.md)
|
||||
* [Git最佳实践](newbs_best_practices.md)
|
||||
* [学习资源](newbs_learn_more_resources.md)
|
||||
|
||||
* [QMK基础](README.md)
|
||||
* [QMK 简介](getting_started_introduction.md)
|
||||
* [贡献 QMK](contributing.md)
|
||||
* [如何使用Github](getting_started_github.md)
|
||||
* [获得帮助](getting_started_getting_help.md)
|
||||
|
||||
* [问题解答](faq.md)
|
||||
* [一般问题](faq_general.md)
|
||||
* [构建/编译QMK](faq_build.md)
|
||||
* [调试/故障排除 QMK](faq_debug.md)
|
||||
* [键盘布局](faq_keymap.md)
|
||||
|
||||
* 详细指南
|
||||
* [安装构建工具](getting_started_build_tools.md)
|
||||
* [流浪者指南](getting_started_vagrant.md)
|
||||
* [构建/编译指令](getting_started_make_guide.md)
|
||||
* [刷新固件](flashing.md)
|
||||
* [定制功能](custom_quantum_functions.md)
|
||||
* [布局概述](keymap.md)
|
||||
|
||||
* [硬件](hardware.md)
|
||||
* [AVR 处理器](hardware_avr.md)
|
||||
* [驱动](hardware_drivers.md)
|
||||
|
||||
* 参考
|
||||
* [键盘指南](hardware_keyboard_guidelines.md)
|
||||
* [配置选项](config_options.md)
|
||||
* [键码](keycodes.md)
|
||||
* [记录最佳实践](documentation_best_practices.md)
|
||||
* [文档指南](documentation_templates.md)
|
||||
* [词汇表](reference_glossary.md)
|
||||
* [单元测试](unit_testing.md)
|
||||
* [有用的功能](ref_functions.md)
|
||||
* [配置器支持](reference_configurator_support.md)
|
||||
* [info.json 格式](reference_info_json.md)
|
||||
|
||||
* [特性](features.md)
|
||||
* [基本键码](keycodes_basic.md)
|
||||
* [US ANSI 控制键](keycodes_us_ansi_shifted.md)
|
||||
* [量子键码](quantum_keycodes.md)
|
||||
* [高级键码](feature_advanced_keycodes.md)
|
||||
* [音频](feature_audio.md)
|
||||
* [自动控制](feature_auto_shift.md)
|
||||
* [背光](feature_backlight.md)
|
||||
* [蓝牙](feature_bluetooth.md)
|
||||
* [Bootmagic](feature_bootmagic.md)
|
||||
* [组合](feature_combo)
|
||||
* [命令](feature_command.md)
|
||||
* [动态宏指令](feature_dynamic_macros.md)
|
||||
* [编码器](feature_encoders.md)
|
||||
* [Grave Escape](feature_grave_esc.md)
|
||||
* [键锁](feature_key_lock.md)
|
||||
* [层](feature_layouts.md)
|
||||
* [引导键](feature_leader_key.md)
|
||||
* [LED 阵列](feature_led_matrix.md)
|
||||
* [宏指令](feature_macros.md)
|
||||
* [鼠标键](feature_mouse_keys.md)
|
||||
* [一键功能](feature_advanced_keycodes.md#one-shot-keys)
|
||||
* [指针设备](feature_pointing_device.md)
|
||||
* [PS/2 鼠标](feature_ps2_mouse.md)
|
||||
* [RGB 光](feature_rgblight.md)
|
||||
* [RGB 矩阵](feature_rgb_matrix.md)
|
||||
* [空格候补换挡](feature_space_cadet_shift.md)
|
||||
* [空格候补换挡回车](feature_space_cadet_shift_enter.md)
|
||||
* [速录机](feature_stenography.md)
|
||||
* [换手](feature_swap_hands.md)
|
||||
* [踢踏舞](feature_tap_dance.md)
|
||||
* [终端](feature_terminal.md)
|
||||
* [热敏打印机](feature_thermal_printer.md)
|
||||
* [Unicode](feature_unicode.md)
|
||||
* [用户空间](feature_userspace.md)
|
||||
* [速度键](feature_velocikey.md)
|
||||
|
||||
* 针对制造者和定制者
|
||||
* [飞线指南](hand_wire.md)
|
||||
* [ISP 刷新指南](isp_flashing_guide.md)
|
||||
* [ARM 调试指南](arm_debugging.md)
|
||||
* [I2C 驱动](i2c_driver.md)
|
||||
* [GPIO 控制器](internals_gpio_control.md)
|
||||
* [Proton C 转换](proton_c_conversion.md)
|
||||
|
||||
* 深入了解
|
||||
* [键盘如何工作](how_keyboards_work.md)
|
||||
* [理解 QMK](understanding_qmk.md)
|
||||
|
||||
* 其他话题
|
||||
* [使用Eclipse开发QMK](other_eclipse.md)
|
||||
* [使用VSCode开发QMK](other_vscode.md)
|
||||
* [支持](support.md)
|
||||
|
||||
* QMK 内构 (正在编写)
|
||||
* [定义](internals_defines.md)
|
||||
* [输入回调寄存器](internals_input_callback_reg.md)
|
||||
* [Midi 设备](internals_midi_device.md)
|
||||
* [Midi 设备设置过程](internals_midi_device_setup_process.md)
|
||||
* [Midi 工具库](internals_midi_util.md)
|
||||
* [发送函数](internals_send_functions.md)
|
||||
* [Sysex 工具](internals_sysex_tools.md)
|
@ -42,6 +42,18 @@ static const I2CConfig i2cconfig = {
|
||||
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))
|
||||
void i2c_init(void)
|
||||
{
|
||||
@ -57,29 +69,30 @@ void i2c_init(void)
|
||||
//i2cInit(); //This is invoked by halInit() so no need to redo it.
|
||||
}
|
||||
|
||||
// This is usually not needed
|
||||
uint8_t i2c_start(uint8_t address)
|
||||
i2c_status_t i2c_start(uint8_t address)
|
||||
{
|
||||
i2c_address = address;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
|
||||
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;
|
||||
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);
|
||||
return 0;
|
||||
}
|
||||
|
@ -40,11 +40,17 @@
|
||||
#define I2C_DRIVER I2CD1
|
||||
#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);
|
||||
uint8_t i2c_start(uint8_t address);
|
||||
uint8_t i2c_transmit(uint8_t address, 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);
|
||||
uint8_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);
|
||||
uint8_t i2c_readReg(uint8_t devaddr, uint8_t* regaddr, uint8_t* data, uint16_t length, uint16_t timeout);
|
||||
uint8_t i2c_stop(void);
|
||||
i2c_status_t i2c_start(uint8_t address);
|
||||
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_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_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);
|
||||
void i2c_stop(void);
|
||||
|
@ -121,7 +121,7 @@ int16_t i2c_read_nack(uint16_t timeout) {
|
||||
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);
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
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);
|
||||
if (status >= 0) {
|
||||
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);
|
||||
int16_t i2c_read_ack(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_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);
|
||||
void i2c_stop(void);
|
||||
|
||||
#endif // I2C_MASTER_H
|
||||
#endif // I2C_MASTER_H
|
||||
|
240
drivers/oled/glcdfont.c
Normal file
240
drivers/oled/glcdfont.c
Normal file
@ -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,
|
||||
};
|
45
drivers/oled/licenses.txt
Normal file
45
drivers/oled/licenses.txt
Normal file
@ -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 (bernhard@users.sourceforge.net) 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 (anja@gerwinski.de) 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
|
||||
(pinguin@kernelconcepts.de) 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
|
||||
|
||||
|
||||
Simon.Budig@unix-ag.org
|
||||
http://www.home.unix-ag.org/simon/
|
||||
|
||||
Simon Budig
|
||||
Am Hardtkoeppel 2
|
||||
D-61279 Graevenwiesbach
|
531
drivers/oled/oled_driver.c
Normal file
531
drivers/oled/oled_driver.c
Normal file
@ -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) {
|
||||
}
|
192
drivers/oled/oled_driver.h
Normal file
192
drivers/oled/oled_driver.h
Normal file
@ -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 */
|
||||
#define VENDOR_ID 0xFEED
|
||||
#define PRODUCT_ID 0x0000
|
||||
#define PRODUCT_ID 0x2010
|
||||
#define DEVICE_VER 0x0001
|
||||
#define MANUFACTURER 1upkeyboards
|
||||
#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_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 */
|
||||
/*== all animations enable ==*/
|
||||
// #define RGBLIGHT_ANIMATIONS
|
||||
// /*== or choose animations ==*/
|
||||
/*== all animations enable ==*/
|
||||
#define RGBLIGHT_ANIMATIONS
|
||||
/*== or choose animations ==*/
|
||||
// #define RGBLIGHT_EFFECT_BREATHING
|
||||
// #define RGBLIGHT_EFFECT_RAINBOW_MOOD
|
||||
// #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 MATRIX_HAS_GHOST
|
||||
|
||||
/* number of backlight levels */
|
||||
|
||||
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
||||
#define LOCKING_SUPPORT_ENABLE
|
||||
|
||||
/* Locking resynchronize hack */
|
||||
#define LOCKING_RESYNC_ENABLE
|
||||
|
||||
@ -242,3 +241,5 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
/* Bootmagic Lite key configuration */
|
||||
// #define BOOTMAGIC_LITE_ROW 0
|
||||
// #define BOOTMAGIC_LITE_COLUMN 0
|
||||
|
||||
/* prevent stuck modifiers */
|
||||
|
@ -1,12 +1,15 @@
|
||||
{
|
||||
"keyboard_name": "super16",
|
||||
"url": "",
|
||||
"maintainer": "qmk",
|
||||
"width": 4,
|
||||
"height": 4,
|
||||
"layouts": {
|
||||
"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}]
|
||||
}
|
||||
"keyboard_name": "super16",
|
||||
"url": "",
|
||||
"maintainer": "qmk",
|
||||
"width": 4,
|
||||
"height": 4,
|
||||
"layouts": {
|
||||
"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_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
|
||||
|
||||
// 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_ortho_4x4( /* Base */
|
||||
KC_A, KC_1, KC_2, KC_4, \
|
||||
KC_A, KC_1, KC_2, KC_4, \
|
||||
KC_A, KC_1, KC_2, KC_4, \
|
||||
KC_A, KC_1, KC_2, KC_4 \
|
||||
RGB_TOG, KC_1, KC_U, KC_P,
|
||||
RGB_MOD, KC_1, KC_U, KC_P,
|
||||
RGB_TOG, KC_1, KC_U, KC_P,
|
||||
RGB_MOD, KC_1, KC_U, KC_P
|
||||
),
|
||||
};
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
# MCU name
|
||||
#MCU = at90usb1286
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
@ -15,7 +14,6 @@ MCU = atmega32u4
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
@ -48,7 +46,6 @@ OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
# atmega32a bootloadHID
|
||||
BOOTLOADER = caterina
|
||||
|
||||
|
||||
# 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
|
||||
@ -58,26 +55,27 @@ BOOTLOADER = caterina
|
||||
# USBaspLoader 2048
|
||||
# OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
|
||||
#EXTRAFLAGS += -flto
|
||||
|
||||
# Build Options
|
||||
# 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)
|
||||
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE = yes # Console for debug(+400)
|
||||
COMMAND_ENABLE = yes # Commands for debug and configuration
|
||||
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 = yes # Enable keyboard RGB underglow
|
||||
RGBLIGHT_ENABLE = yes # 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)
|
||||
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"
|
||||
|
||||
void matrix_init_kb(void) {
|
||||
// put your keyboard start-up code here
|
||||
// runs once when the firmware starts up
|
||||
// put your keyboard start-up code here
|
||||
// runs once when the firmware starts up
|
||||
|
||||
matrix_init_user();
|
||||
matrix_init_user();
|
||||
}
|
||||
|
||||
void matrix_scan_kb(void) {
|
||||
// put your looping keyboard code here
|
||||
// runs every cycle (a lot)
|
||||
// put your looping keyboard code here
|
||||
// runs every cycle (a lot)
|
||||
|
||||
matrix_scan_user();
|
||||
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
|
||||
// put your per-action keyboard code here
|
||||
// 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) {
|
||||
// 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
|
||||
* represents the switch matrix.
|
||||
*/
|
||||
|
||||
#define LAYOUT_ortho_4x4( \
|
||||
k00, k01, k02, k03, \
|
||||
k10, k11, k12, k13, \
|
||||
k20, k21, k22, k23, \
|
||||
k30, k31, k32, k33 \
|
||||
) \
|
||||
{ \
|
||||
{ k00, k01, k02, k03 }, \
|
||||
{ k10, k11, k12, k13 }, \
|
||||
{ k20, k21, k22, k23 }, \
|
||||
{ k30, k31, k32, k33 }, \
|
||||
K00, K01, K02, K03, \
|
||||
K10, K11, K12, K13, \
|
||||
K20, K21, K22, K23, \
|
||||
K30, K31, K32, K33 \
|
||||
) { \
|
||||
{ K00, K01, K02, K03 }, \
|
||||
{ K10, K11, K12, K13 }, \
|
||||
{ K20, K21, K22, K23 }, \
|
||||
{ K30, K31, K32, K33 } \
|
||||
}
|
||||
|
||||
#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 } \
|
||||
}
|
||||
|
@ -1,21 +1,24 @@
|
||||
Atreus
|
||||
===
|
||||
======
|
||||
|
||||
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)
|
||||
Hardware Supported: Atreus, PCB-based or hand-wired
|
||||
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
|
||||
the repository, not the directory containing this readme.
|
||||
Teensy:\
|
||||
`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.
|
||||
|
@ -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 = at90usb1287
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
@ -48,34 +33,56 @@ ARCH = AVR8
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Bootloader
|
||||
# This definition is optional, and if your keyboard supports multiple bootloaders of
|
||||
# different sizes, comment this out, and the correct address will be loaded
|
||||
# automatically (+60). See bootloader.mk for all options.
|
||||
ifdef TEENSY2
|
||||
BOOTLOADER = halfkay
|
||||
else
|
||||
BOOTLOADER = caterina
|
||||
endif
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Build Options
|
||||
# comment out to disable the options.
|
||||
#
|
||||
#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE = yes # Console for debug(+400)
|
||||
COMMAND_ENABLE = yes # Commands for debug and configuration
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
# SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
|
||||
NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA
|
||||
# BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
|
||||
# MIDI_ENABLE = YES # MIDI controls
|
||||
UNICODE_ENABLE = YES # Unicode
|
||||
# BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
# Bootloader selection
|
||||
# Teensy halfkay
|
||||
# Pro Micro caterina
|
||||
# Atmel DFU atmel-dfu
|
||||
# LUFA DFU lufa-dfu
|
||||
# QMK DFU qmk-dfu
|
||||
# atmega32a bootloadHID
|
||||
ifdef TEENSY2
|
||||
BOOTLOADER = halfkay
|
||||
OPT_DEFS += -DATREUS_TEENSY2
|
||||
else
|
||||
BOOTLOADER = caterina
|
||||
OPT_DEFS += -DATREUS_ASTAR
|
||||
ifdef PCBDOWN
|
||||
OPT_DEFS += -DPCBDOWN
|
||||
endif
|
||||
endif
|
||||
|
||||
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)
|
||||
|
217
keyboards/boston_meetup/2019/2019.c
Normal file
217
keyboards/boston_meetup/2019/2019.c
Normal file
@ -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();
|
||||
}
|
19
keyboards/boston_meetup/2019/2019.h
Normal file
19
keyboards/boston_meetup/2019/2019.h
Normal file
@ -0,0 +1,19 @@
|
||||
/* Copyright 2019 ishtob
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "boston_meetup.h"
|
||||
|
196
keyboards/boston_meetup/2019/config.h
Normal file
196
keyboards/boston_meetup/2019/config.h
Normal file
@ -0,0 +1,196 @@
|
||||
#pragma once
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define DEVICE_VER 0x07E3
|
||||
|
||||
#undef MATRIX_ROWS
|
||||
#undef MATRIX_COLS
|
||||
/* key matrix size */
|
||||
#define MATRIX_ROWS 4
|
||||
#define MATRIX_COLS 4
|
||||
|
||||
/*
|
||||
* Keyboard Matrix Assignments
|
||||
*
|
||||
* Change this to how you wired your keyboard
|
||||
* COLS: AVR pins used for columns, left to right
|
||||
* ROWS: AVR pins used for rows, top to bottom
|
||||
* DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
|
||||
* ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
|
||||
*
|
||||
*/
|
||||
|
||||
#undef MATRIX_ROW_PINS
|
||||
#undef MATRIX_COL_PINS
|
||||
|
||||
#define MATRIX_ROW_PINS { A3, B8, B9, B1 }
|
||||
#define MATRIX_COL_PINS { A7, A8, B2, B10 }
|
||||
|
||||
#define NUMBER_OF_ENCODERS 1
|
||||
#define ENCODERS_PAD_A { B13 }
|
||||
#define ENCODERS_PAD_B { B14 }
|
||||
|
||||
//Audio
|
||||
#undef AUDIO_VOICES
|
||||
#undef C6_AUDIO
|
||||
|
||||
#ifdef AUDIO_ENABLE
|
||||
#define STARTUP_SONG SONG(ONE_UP_SOUND)
|
||||
// #define STARTUP_SONG SONG(NO_SOUND)
|
||||
|
||||
#define AUDIO_CLICKY
|
||||
/* to enable clicky on startup */
|
||||
//#define AUDIO_CLICKY_ON
|
||||
#define AUDIO_CLICKY_FREQ_RANDOMNESS 1.5f
|
||||
#endif
|
||||
|
||||
//configure qwiic micro_oled driver for the 128x32 oled
|
||||
#ifdef QWIIC_MICRO_OLED_ENABLE
|
||||
|
||||
#undef I2C_ADDRESS_SA0_1
|
||||
#define I2C_ADDRESS_SA0_1 0b0111100
|
||||
#define LCDWIDTH 128
|
||||
#define LCDHEIGHT 32
|
||||
#define micro_oled_rotate_180
|
||||
|
||||
#endif
|
||||
/*
|
||||
* Keyboard Matrix Assignments
|
||||
*
|
||||
* Change this to how you wired your keyboard
|
||||
* COLS: AVR pins used for columns, left to right
|
||||
* ROWS: AVR pins used for rows, top to bottom
|
||||
* DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
|
||||
* ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
|
||||
*
|
||||
*/
|
||||
|
||||
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
|
||||
#define DEBOUNCE 6
|
||||
|
||||
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
||||
//#define LOCKING_SUPPORT_ENABLE
|
||||
/* Locking resynchronize hack */
|
||||
//#define LOCKING_RESYNC_ENABLE
|
||||
|
||||
/*
|
||||
* Force NKRO
|
||||
*
|
||||
* Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
|
||||
* state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
|
||||
* makefile for this to work.)
|
||||
*
|
||||
* If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
|
||||
* until the next keyboard reset.
|
||||
*
|
||||
* NKRO may prevent your keystrokes from being detected in the BIOS, but it is
|
||||
* fully operational during normal computer usage.
|
||||
*
|
||||
* For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
|
||||
* or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
|
||||
* bootmagic, NKRO mode will always be enabled until it is toggled again during a
|
||||
* power-up.
|
||||
*
|
||||
*/
|
||||
//#define FORCE_NKRO
|
||||
|
||||
/*
|
||||
* Feature disable options
|
||||
* These options are also useful to firmware size reduction.
|
||||
*/
|
||||
|
||||
/* disable debug print */
|
||||
//#define NO_DEBUG
|
||||
|
||||
/* disable print */
|
||||
//#define NO_PRINT
|
||||
|
||||
/* disable action features */
|
||||
//#define NO_ACTION_LAYER
|
||||
//#define NO_ACTION_TAPPING
|
||||
//#define NO_ACTION_ONESHOT
|
||||
//#define NO_ACTION_MACRO
|
||||
//#define NO_ACTION_FUNCTION
|
||||
/*
|
||||
* MIDI options
|
||||
*/
|
||||
|
||||
/* Prevent use of disabled MIDI features in the keymap */
|
||||
//#define MIDI_ENABLE_STRICT 1
|
||||
|
||||
/* enable basic MIDI features:
|
||||
- MIDI notes can be sent when in Music mode is on
|
||||
*/
|
||||
|
||||
#define MIDI_BASIC
|
||||
|
||||
/* enable advanced MIDI features:
|
||||
- MIDI notes can be added to the keymap
|
||||
- Octave shift and transpose
|
||||
- Virtual sustain, portamento, and modulation wheel
|
||||
- etc.
|
||||
*/
|
||||
//#define MIDI_ADVANCED
|
||||
|
||||
/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
|
||||
//#define MIDI_TONE_KEYCODE_OCTAVES 2
|
||||
|
||||
/* Haptic Driver initialization settings
|
||||
* Feedback Control Settings */
|
||||
#define FB_ERM_LRA 1 /* For ERM:0 or LRA:1*/
|
||||
#define FB_BRAKEFACTOR 6 /* For 1x:0, 2x:1, 3x:2, 4x:3, 6x:4, 8x:5, 16x:6, Disable Braking:7 */
|
||||
#define FB_LOOPGAIN 1 /* For Low:0, Medium:1, High:2, Very High:3 */
|
||||
|
||||
/* default 3V ERM vibration motor voltage and library*/
|
||||
#if FB_ERM_LRA == 0
|
||||
#define RATED_VOLTAGE 3
|
||||
#define V_RMS 2.3
|
||||
#define V_PEAK 3.30
|
||||
/* Library Selection */
|
||||
#define LIB_SELECTION 4 /* For Empty:0' TS2200 library A to D:1-5, LRA Library: 6 */
|
||||
|
||||
/* default 2V LRA voltage and library */
|
||||
#elif FB_ERM_LRA == 1
|
||||
#define RATED_VOLTAGE 2
|
||||
#define V_RMS 2.0
|
||||
#define V_PEAK 2.85
|
||||
#define F_LRA 200
|
||||
/* Library Selection */
|
||||
#define LIB_SELECTION 6 /* For Empty:0' TS2200 library A to D:1-5, LRA Library: 6 */
|
||||
|
||||
#endif
|
||||
|
||||
/* Control 1 register settings */
|
||||
#define DRIVE_TIME 25
|
||||
#define AC_COUPLE 0
|
||||
#define STARTUP_BOOST 1
|
||||
|
||||
/* Control 2 Settings */
|
||||
#define BIDIR_INPUT 1
|
||||
#define BRAKE_STAB 1 /* Loopgain is reduced when braking is almost complete to improve stability */
|
||||
#define SAMPLE_TIME 3
|
||||
#define BLANKING_TIME 1
|
||||
#define IDISS_TIME 1
|
||||
|
||||
/* Control 3 settings */
|
||||
#define NG_THRESH 2
|
||||
#define ERM_OPEN_LOOP 1
|
||||
#define SUPPLY_COMP_DIS 0
|
||||
#define DATA_FORMAT_RTO 0
|
||||
#define LRA_DRIVE_MODE 0
|
||||
#define N_PWM_ANALOG 0
|
||||
#define LRA_OPEN_LOOP 0
|
||||
/* Control 4 settings */
|
||||
#define ZC_DET_TIME 0
|
||||
#define AUTO_CAL_TIME 3
|
||||
|
||||
#define RGBLIGHT_ANIMATIONS
|
||||
|
||||
#define RGBLED_NUM 10
|
||||
#define RGB_DI_PIN B5
|
||||
#define DRIVER_LED_TOTAL RGBLED_NUM
|
||||
|
||||
#define RGB_MATRIX_KEYPRESSES
|
||||
|
||||
#define SOLENOID_PIN A14
|
||||
|
12
keyboards/boston_meetup/2019/info.json
Normal file
12
keyboards/boston_meetup/2019/info.json
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"keyboard_name": "Boston Meetup 2019",
|
||||
"url": "",
|
||||
"maintainer": "qmk",
|
||||
"width": 4,
|
||||
"height": 4,
|
||||
"layouts": {
|
||||
"LAYOUT": {
|
||||
"key_count": 13,
|
||||
"layout": [{"label":"K00", "x":0, "y":0}, {"label":"K10", "x":0, "y":1}, {"label":"K11", "x":1, "y":1}, {"label":"K12", "x":2, "y":1}, {"label":"K13", "x":3, "y":1}, {"label":"K20", "x":0, "y":2}, {"label":"K21", "x":1, "y":2}, {"label":"K22", "x":2, "y":2}, {"label":"K23", "x":3, "y":2}, {"label":"K30", "x":0, "y":3}, {"label":"K31", "x":1, "y":3}, {"label":"K32", "x":2, "y":3}, {"label":"K33", "x":3, "y":3}] }
|
||||
}
|
||||
}
|
166
keyboards/boston_meetup/2019/keymaps/default/keymap.c
Normal file
166
keyboards/boston_meetup/2019/keymaps/default/keymap.c
Normal file
@ -0,0 +1,166 @@
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
// Each layer gets a name for readability, which is then used in the keymap matrix below.
|
||||
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
|
||||
// Layer names don't all need to be of the same length, obviously, and you can also skip them
|
||||
// entirely and just use numbers.
|
||||
|
||||
enum custom_layers {
|
||||
_BASE,
|
||||
_LOWER,
|
||||
_RAISE,
|
||||
_ADJUST
|
||||
};
|
||||
|
||||
enum custom_keycodes {
|
||||
BASE = SAFE_RANGE,
|
||||
LOWER,
|
||||
RAISE,
|
||||
KC_DEMOMACRO
|
||||
};
|
||||
|
||||
// Custom macros
|
||||
#define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl
|
||||
#define CTL_TTAB CTL_T(KC_TAB) // Tap for Esc, hold for Ctrl
|
||||
#define CTL_ENT CTL_T(KC_ENT) // Tap for Enter, hold for Ctrl
|
||||
#define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift
|
||||
// Requires KC_TRNS/_______ for the trigger key in the destination layer
|
||||
#define LT_MC(kc) LT(_MOUSECURSOR, kc) // L-ayer T-ap M-ouse C-ursor
|
||||
#define LT_RAI(kc) LT(_RAISE, kc) // L-ayer T-ap to Raise
|
||||
#define DEMOMACRO KC_DEMOMACRO // Sample for macros
|
||||
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
/* Base
|
||||
* ,------.
|
||||
* | Esc |
|
||||
* |------+------+-------------.
|
||||
* | : | 7 | 8 | 9 |
|
||||
* |------+------+------+------|
|
||||
* | RAISE| 4 | 5 | 6 |
|
||||
* |------+------+------+------|
|
||||
* | LOWER| 1 | 2 | 3 |
|
||||
* `---------------------------'
|
||||
*/
|
||||
[_BASE] = LAYOUT(
|
||||
KC_ESC,
|
||||
KC_COLN, KC_P7, KC_P8, KC_P9,
|
||||
RAISE, KC_P4, KC_P5, KC_P6,
|
||||
LOWER, KC_P1, KC_P2, KC_P3
|
||||
),
|
||||
|
||||
/* Lower
|
||||
* ,------.
|
||||
* | Nmlk |
|
||||
* |------+------+-------------.
|
||||
* | : | / | * | - |
|
||||
* |------+------+------+------|
|
||||
* | | | = | + |
|
||||
* |------+------+------+------|
|
||||
* | | 0 | . | ENT |
|
||||
* `---------------------------'
|
||||
*/
|
||||
[_LOWER] = LAYOUT(
|
||||
KC_NLCK,
|
||||
KC_COLN, KC_PSLS, KC_PAST, KC_PMNS,
|
||||
_______, XXXXXXX, KC_EQL, KC_PPLS,
|
||||
_______, KC_P0, KC_PDOT, KC_PENT
|
||||
),
|
||||
|
||||
/* Raise
|
||||
* ,------.
|
||||
* | Esc |
|
||||
* |------+------+-------------.
|
||||
* |RGB TG|RGB M+|RGB M-| |
|
||||
* |------+------+------+------|
|
||||
* | |RGB H+|RGB S+|RGB V+|
|
||||
* |------+------+------+------|
|
||||
* | ` |RGB H-|RGB S-|RGB V-|
|
||||
* `---------------------------'
|
||||
*/
|
||||
[_RAISE] = LAYOUT(
|
||||
KC_NLCK,
|
||||
RGB_TOG, RGB_MOD, RGB_RMOD, XXXXXXX,
|
||||
_______, RGB_HUI, RGB_SAI, RGB_VAI,
|
||||
_______, RGB_HUD, RGB_SAD, RGB_VAD
|
||||
|
||||
),
|
||||
|
||||
/* Adjust
|
||||
* ,------.
|
||||
* | DFU |
|
||||
* |------+------+-------------.
|
||||
* |HPT TG|HPT FB|HPT RS| BKSP |
|
||||
* |------+------+------+------|
|
||||
* | |HPT M+| | |
|
||||
* |------+------+------+------|
|
||||
* | |HPT M-|Clk TG| Del |
|
||||
* `---------------------------'
|
||||
*/
|
||||
[_ADJUST] = LAYOUT(
|
||||
RESET,
|
||||
HPT_TOG, HPT_FBK, HPT_RST, KC_BSPC,
|
||||
_______, HPT_MODI, XXXXXXX, XXXXXXX,
|
||||
_______, HPT_MODD, CK_TOGG, KC_DEL
|
||||
),
|
||||
|
||||
|
||||
};
|
||||
|
||||
uint32_t layer_state_set_user(uint32_t state) {
|
||||
return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST);
|
||||
}
|
||||
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
switch (keycode) {
|
||||
case KC_DEMOMACRO:
|
||||
if (record->event.pressed) {
|
||||
// when keycode KC_DEMOMACRO is pressed
|
||||
SEND_STRING("QMK is the best thing ever!");
|
||||
} else {
|
||||
// when keycode KC_DEMOMACRO is released
|
||||
}
|
||||
break;
|
||||
case LOWER:
|
||||
if (record->event.pressed) {
|
||||
//not sure how to have keyboard check mode and set it to a variable, so my work around
|
||||
//uses another variable that would be set to true after the first time a reactive key is pressed.
|
||||
layer_on(_LOWER);
|
||||
} else {
|
||||
layer_off(_LOWER);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case RAISE:
|
||||
if (record->event.pressed) {
|
||||
//not sure how to have keyboard check mode and set it to a variable, so my work around
|
||||
//uses another variable that would be set to true after the first time a reactive key is pressed.
|
||||
layer_on(_RAISE);
|
||||
} else {
|
||||
layer_off(_RAISE);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool music_mask_user(uint16_t keycode) {
|
||||
switch (keycode) {
|
||||
case RAISE:
|
||||
case LOWER:
|
||||
return false;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
void matrix_init_user(void) {
|
||||
}
|
||||
|
||||
|
||||
void matrix_scan_user(void) {
|
||||
}
|
||||
|
51
keyboards/boston_meetup/2019/keymaps/default/readme.md
Normal file
51
keyboards/boston_meetup/2019/keymaps/default/readme.md
Normal file
@ -0,0 +1,51 @@
|
||||
# The Default Boston Meetup 2019 board Layout
|
||||
|
||||
Keymap:
|
||||
```
|
||||
Base
|
||||
,------.
|
||||
| Esc |
|
||||
|------+------+-------------.
|
||||
| : | 7 | 8 | 9 |
|
||||
|------+------+------+------|
|
||||
| RAISE| 4 | 5 | 6 |
|
||||
|------+------+------+------|
|
||||
| LOWER| 1 | 2 | 3 |
|
||||
`---------------------------'
|
||||
|
||||
Lower
|
||||
,------.
|
||||
| Nmlk |
|
||||
|------+------+-------------.
|
||||
| : | / | * | - |
|
||||
|------+------+------+------|
|
||||
| | | = | + |
|
||||
|------+------+------+------|
|
||||
| | 0 | . | ENT |
|
||||
`---------------------------'
|
||||
|
||||
Raise
|
||||
,------.
|
||||
| Esc |
|
||||
|------+------+-------------.
|
||||
|RGB TG|RGB M+|RGB M-| |
|
||||
|------+------+------+------|
|
||||
| |RGB H+|RGB S+|RGB V+|
|
||||
|------+------+------+------|
|
||||
| |RGB H-|RGB S-|RGB V-|
|
||||
`---------------------------'
|
||||
|
||||
Adjust:
|
||||
,------.
|
||||
| DFU |
|
||||
|------+------+-------------.
|
||||
|HPT TG|HPT FB|HPT RS| BKSP |
|
||||
|------+------+------+------|
|
||||
| |HPT M+| | |
|
||||
|------+------+------+------|
|
||||
| |HPT M-|Clk TG| Del |
|
||||
`---------------------------'
|
||||
|
||||
```
|
||||
|
||||
RGB still work in progress
|
22
keyboards/boston_meetup/2019/keymaps/readme.md
Normal file
22
keyboards/boston_meetup/2019/keymaps/readme.md
Normal file
@ -0,0 +1,22 @@
|
||||
# How to add your own keymap
|
||||
|
||||
Folders can be named however you'd like (will be approved upon merging), or should follow the format with a preceding `_`:
|
||||
|
||||
_[ISO 3166-1 alpha-2 code*]_[layout variant]_[layout name/author]
|
||||
|
||||
\* See full list: https://en.wikipedia.org/wiki/ISO_3166-1#Officially_assigned_code_elements
|
||||
|
||||
and contain the following files:
|
||||
|
||||
* `keymap.c`
|
||||
* `readme.md` *recommended*
|
||||
* `config.h` *optional*, found automatically when compiling
|
||||
* `Makefile` *optional*, found automatically when compling
|
||||
|
||||
When adding your keymap to this list, keep it organised alphabetically (select list, edit->sort lines), and use this format:
|
||||
|
||||
* **folder_name** description
|
||||
|
||||
# List of 2019 keymaps
|
||||
|
||||
* **default** default 2019 macropad layout
|
13
keyboards/boston_meetup/2019/readme.md
Normal file
13
keyboards/boston_meetup/2019/readme.md
Normal file
@ -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).
|
24
keyboards/boston_meetup/2019/rules.mk
Normal file
24
keyboards/boston_meetup/2019/rules.mk
Normal file
@ -0,0 +1,24 @@
|
||||
# project specific files
|
||||
|
||||
# Cortex version
|
||||
MCU = STM32F303
|
||||
|
||||
# Build Options
|
||||
# comment out to disable the options.
|
||||
#
|
||||
BACKLIGHT_ENABLE = no
|
||||
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration
|
||||
## (Note that for BOOTMAGIC on Teensy LC you have to use a custom .ld script.)
|
||||
MOUSEKEY_ENABLE = yes # Mouse keys
|
||||
EXTRAKEY_ENABLE = yes # Audio control and System control
|
||||
CONSOLE_ENABLE = no # Console for debug
|
||||
COMMAND_ENABLE = no # Commands for debug and configuration
|
||||
#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
|
||||
NKRO_ENABLE = yes # USB Nkey Rollover
|
||||
CUSTOM_MATRIX = no # Custom matrix file
|
||||
AUDIO_ENABLE = yes
|
||||
RGBLIGHT_ENABLE = no
|
||||
RGB_MATRIX_ENABLE = no #WS2812
|
||||
HAPTIC_ENABLE += DRV2605L
|
||||
QWIIC_ENABLE += MICRO_OLED
|
||||
# SERIAL_LINK_ENABLE = yes
|
2
keyboards/boston_meetup/boston_meetup.c
Normal file
2
keyboards/boston_meetup/boston_meetup.c
Normal file
@ -0,0 +1,2 @@
|
||||
#include "boston_meetup.h"
|
||||
|
19
keyboards/boston_meetup/boston_meetup.h
Normal file
19
keyboards/boston_meetup/boston_meetup.h
Normal file
@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
|
||||
#ifdef KEYBOARD_boston_meetup_2019
|
||||
#include "2019.h"
|
||||
#define LAYOUT( \
|
||||
K00, \
|
||||
K10, K11, K12, K13, \
|
||||
K20, K21, K22, K23, \
|
||||
K30, K31, K32, K33 \
|
||||
) \
|
||||
{ \
|
||||
{ K00, KC_NO, KC_NO, KC_NO }, \
|
||||
{ K10, K11, K12, K13 }, \
|
||||
{ K20, K21, K22, K23 }, \
|
||||
{ K30, K31, K32, K33 } \
|
||||
}
|
||||
#endif
|
||||
|
||||
#include "quantum.h"
|
60
keyboards/boston_meetup/config.h
Normal file
60
keyboards/boston_meetup/config.h
Normal file
@ -0,0 +1,60 @@
|
||||
/*
|
||||
Copyright 2012 Jun Wako <wakojun@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "config_common.h"
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define VENDOR_ID 0xFB30
|
||||
#define PRODUCT_ID 0x26BE
|
||||
#define MANUFACTURER ishtob
|
||||
#define PRODUCT Boston Meetup Board
|
||||
#define DESCRIPTION A limited-run community meetup board
|
||||
|
||||
//#define AUDIO_VOICES
|
||||
|
||||
//#define BACKLIGHT_PIN B7
|
||||
|
||||
/* COL2ROW or ROW2COL */
|
||||
#define DIODE_DIRECTION COL2ROW
|
||||
|
||||
/* define if matrix has ghost */
|
||||
//#define MATRIX_HAS_GHOST
|
||||
|
||||
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
||||
//#define LOCKING_SUPPORT_ENABLE
|
||||
/* Locking resynchronize hack */
|
||||
//#define LOCKING_RESYNC_ENABLE
|
||||
|
||||
/*
|
||||
* Feature disable options
|
||||
* These options are also useful to firmware size reduction.
|
||||
*/
|
||||
|
||||
/* disable debug print */
|
||||
//#define NO_DEBUG
|
||||
|
||||
/* disable print */
|
||||
//#define NO_PRINT
|
||||
|
||||
/* disable action features */
|
||||
//#define NO_ACTION_LAYER
|
||||
//#define NO_ACTION_TAPPING
|
||||
//#define NO_ACTION_ONESHOT
|
||||
//#define NO_ACTION_MACRO
|
||||
//#define NO_ACTION_FUNCTION
|
14
keyboards/boston_meetup/readme.md
Normal file
14
keyboards/boston_meetup/readme.md
Normal file
@ -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).
|
2
keyboards/boston_meetup/rules.mk
Normal file
2
keyboards/boston_meetup/rules.mk
Normal file
@ -0,0 +1,2 @@
|
||||
|
||||
DEFAULT_FOLDER = boston_meetup/2019
|
@ -29,8 +29,6 @@
|
||||
#include "quantum.h"
|
||||
#include <string.h>
|
||||
#include <hal.h>
|
||||
#include "chtypes.h"
|
||||
#include "ch.h"
|
||||
|
||||
static uint8_t i2c_address;
|
||||
|
||||
@ -44,6 +42,18 @@ static const I2CConfig i2cconfig = {
|
||||
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))
|
||||
void i2c_init(void)
|
||||
{
|
||||
@ -59,34 +69,32 @@ void i2c_init(void)
|
||||
//i2cInit(); //This is invoked by halInit() so no need to redo it.
|
||||
}
|
||||
|
||||
// This is usually not needed
|
||||
uint8_t i2c_start(uint8_t address)
|
||||
i2c_status_t i2c_start(uint8_t address)
|
||||
{
|
||||
i2c_address = address;
|
||||
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;
|
||||
i2cStart(&I2C_DRIVER, &i2cconfig);
|
||||
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);
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
|
||||
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;
|
||||
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.
|
||||
uint8_t i2c_stop(void)
|
||||
void i2c_stop(void)
|
||||
{
|
||||
i2cStop(&I2C_DRIVER);
|
||||
return 0;
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "quantum.h"
|
||||
#include "command.h"
|
||||
#include "action_pseudo_lut.h"
|
||||
|
||||
static uint8_t send_key_shift_bit[SHIFT_BIT_SIZE];
|
||||
|
@ -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/>.
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_H
|
||||
#define CONFIG_H
|
||||
#pragma once
|
||||
|
||||
#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_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_COL_PINS { F0, F1, E6, C7 }
|
||||
#define UNUSED_PINS
|
||||
|
||||
#define BACKLIGHT_PIN F7
|
||||
|
||||
/* COL2ROW or ROW2COL */
|
||||
#define DIODE_DIRECTION COL2ROW
|
||||
|
||||
/* define if matrix has ghost */
|
||||
//#define MATRIX_HAS_GHOST
|
||||
/* Backlight configuration */
|
||||
#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 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 */
|
||||
//#define LOCKING_SUPPORT_ENABLE
|
||||
/* Locking resynchronize hack */
|
||||
#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
|
||||
* 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_FUNCTION
|
||||
|
||||
#endif
|
||||
/* Bootmagic Lite key configuration */
|
||||
// #define BOOTMAGIC_LITE_ROW 0
|
||||
// #define BOOTMAGIC_LITE_COLUMN 0
|
||||
|
@ -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 "led.h"
|
||||
|
||||
extern inline void cospad_bl_led_on(void);
|
||||
extern inline void cospad_bl_led_off(void);
|
||||
extern inline void cospad_bl_led_togg(void);
|
||||
#ifdef BACKLIGHT_ENABLE
|
||||
|
||||
void matrix_init_kb(void) {
|
||||
// put your keyboard start-up code here
|
||||
// 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 backlight_init_ports(void) {
|
||||
setPinOutput(F7);
|
||||
}
|
||||
|
||||
void led_set_kb(uint8_t usb_led) {
|
||||
if (usb_led & (1<<USB_LED_NUM_LOCK)) {
|
||||
// Turn numlock on
|
||||
PORTB &= ~(1<<2);
|
||||
} else {
|
||||
// Turn numlock off
|
||||
PORTB |= (1<<2);
|
||||
}
|
||||
void backlight_set(uint8_t level) {
|
||||
writePin(F7, !!level);
|
||||
}
|
||||
|
||||
void backlight_task(void) {
|
||||
// do nothing - as default implementation of software PWM does not work
|
||||
}
|
||||
|
||||
#endif //BACKLIGHT_ENABLE
|
||||
|
@ -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"
|
||||
#define ___ KC_NO
|
||||
|
||||
// readability
|
||||
#define XXX KC_NO
|
||||
/* 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.
|
||||
*/
|
||||
|
||||
/* COSPAD ortho matrix layout
|
||||
* ,-------------------.
|
||||
@ -21,40 +43,6 @@
|
||||
* | 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( \
|
||||
k00, k01, k02, k03, \
|
||||
k10, k11, k12, k13, \
|
||||
@ -72,6 +60,21 @@
|
||||
{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( \
|
||||
k00, k01, k02, k03, \
|
||||
k10, k11, k12, k13, \
|
||||
@ -84,11 +87,26 @@
|
||||
{k00, k01, k02, k03}, \
|
||||
{k10, k11, k12, k13}, \
|
||||
{k20, k21, k22, k23}, \
|
||||
{k30, k31, k32, KC_NO}, \
|
||||
{k30, k31, k32, ___}, \
|
||||
{k40, k41, k42, k43}, \
|
||||
{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( \
|
||||
k00, k01, k02, k03, \
|
||||
k10, k11, k12, k13, \
|
||||
@ -98,25 +116,15 @@
|
||||
k50, k52, k43 \
|
||||
) \
|
||||
{ \
|
||||
{k00, k01, k02, k03}, \
|
||||
{k10, k11, k12, k13}, \
|
||||
{k20, k21, k22, k23}, \
|
||||
{k30, k31, k32, KC_NO}, \
|
||||
{k40, k41, k42, k43}, \
|
||||
{k50, KC_NO, k52, KC_NO} \
|
||||
{k00, k01, k02, k03}, \
|
||||
{k10, k11, k12, k13}, \
|
||||
{k20, k21, k22, k23}, \
|
||||
{k30, k31, k32, ___}, \
|
||||
{k40, k41, k42, k43}, \
|
||||
{k50, ___, k52, ___} \
|
||||
}
|
||||
void matrix_init_user(void);
|
||||
void matrix_scan_user(void);
|
||||
|
||||
inline void cospad_bl_led_on(void) { PORTF &= ~(1<<7); }
|
||||
inline void cospad_bl_led_off(void) { PORTF |= (1<<7); }
|
||||
|
||||
inline void cospad_bl_led_togg(void) {
|
||||
uint8_t bl_mask = PORTF&(1<<7);
|
||||
if (bl_mask) {
|
||||
PORTF &= ~(1<<7);
|
||||
} else {
|
||||
PORTF |= (1<<7);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
// Add backwards compatibility for existing keymaps
|
||||
#define cospad_bl_led_on backlight_enable
|
||||
#define cospad_bl_led_off backlight_disable
|
||||
#define cospad_bl_led_togg backlight_toggle
|
||||
|
@ -7,6 +7,7 @@
|
||||
"height": 6,
|
||||
"layouts": {
|
||||
"LAYOUT_numpad_6x4": {
|
||||
"key_count": 21,
|
||||
"layout": [
|
||||
{"label":"Esc", "x":0, "y":0},
|
||||
{"label":"Tab", "x":1, "y":0},
|
||||
@ -33,35 +34,62 @@
|
||||
},
|
||||
|
||||
"LAYOUT_gamepad_6x4": {
|
||||
"key_count": 23,
|
||||
"layout": [
|
||||
{"label":"k00", "x":5, "y":0},
|
||||
{"label":"k01", "x":5, "y":1},
|
||||
{"label":"k02", "x":5, "y":2},
|
||||
{"label":"k03", "x":5, "y":3},
|
||||
{"label":"k10", "x":4, "y":0},
|
||||
{"label":"k11", "x":4, "y":1},
|
||||
{"label":"k12", "x":4, "y":2},
|
||||
{"label":"k13", "x":4, "y":3},
|
||||
{"label":"k20", "x":3, "y":0},
|
||||
{"label":"k21", "x":3, "y":1},
|
||||
{"label":"k22", "x":3, "y":2},
|
||||
{"label":"k30", "x":2, "y":0},
|
||||
{"label":"k31", "x":2, "y":1},
|
||||
{"label":"k32", "x":2, "y":2},
|
||||
{"label":"k23", "x":2, "y":3, "w":2},
|
||||
{"label":"k40", "x":1, "y":0},
|
||||
{"label":"k41", "x":1, "y":1},
|
||||
{"label":"k42", "x":1, "y":2},
|
||||
{"label":"k43", "x":1, "y":3},
|
||||
{"label":"k50", "x":0, "y":0},
|
||||
{"label":"k51", "x":0, "y":1},
|
||||
{"label":"k52", "x":0, "y":2},
|
||||
{"label":"k53", "x":0, "y":3}
|
||||
{"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":"k30", "x":0, "y":3},
|
||||
{"label":"k31", "x":1, "y":3},
|
||||
{"label":"k32", "x":2, "y":3},
|
||||
{"label":"k23", "x":3, "y":2, "h":2},
|
||||
{"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}
|
||||
]
|
||||
},
|
||||
|
||||
"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 "led.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.
|
||||
#define _BL 0
|
||||
#define _FL 1
|
||||
|
||||
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),
|
||||
enum layers {
|
||||
_BL = 0,
|
||||
_FL
|
||||
};
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
switch (keycode) {
|
||||
case BL_TOGG:
|
||||
if (record->event.pressed) {
|
||||
cospad_bl_led_togg();
|
||||
}
|
||||
return false;
|
||||
case BL_ON:
|
||||
if (record->event.pressed) {
|
||||
cospad_bl_led_on();
|
||||
}
|
||||
return false;
|
||||
case BL_OFF:
|
||||
if(record->event.pressed) {
|
||||
cospad_bl_led_off();
|
||||
}
|
||||
return false;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
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| | | |
|
||||
* |----|----|----|----|
|
||||
* |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, _______
|
||||
),
|
||||
};
|
||||
|
@ -1,6 +1,5 @@
|
||||
|
||||
# MCU name
|
||||
#MCU = at90usb1287
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
@ -40,27 +39,43 @@ F_USB = $(F_CPU)
|
||||
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*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
# OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
|
||||
|
||||
# Build Options
|
||||
# comment out to disable the options.
|
||||
#
|
||||
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE = no # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE = no # Console for debug(+400)
|
||||
COMMAND_ENABLE = no # Commands for debug and configuration
|
||||
NKRO_ENABLE = yes # 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 = no # Enable keyboard backlight functionality (+1150)
|
||||
MIDI_ENABLE = no # MIDI controls
|
||||
AUDIO_ENABLE = no
|
||||
UNICODE_ENABLE = no # Unicode
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE = no # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE = no # Console for debug(+400)
|
||||
COMMAND_ENABLE = no # Commands for debug and configuration
|
||||
NKRO_ENABLE = yes # USB 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_CUSTOM_DRIVER = yes
|
||||
RGBLIGHT_ENABLE = yes # Enable keyboard underlight functionality (+4870)
|
||||
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)
|
||||
|
||||
|
||||
LAYOUTS = numpad_6x4 ortho_6x4
|
||||
|
@ -22,9 +22,9 @@ extern uint8_t is_master;
|
||||
// Layer names don't all need to be of the same length, obviously, and you can also skip them
|
||||
// entirely and just use numbers.
|
||||
#define _QWERTY 0
|
||||
#define _LOWER 3
|
||||
#define _RAISE 4
|
||||
#define _ADJUST 16
|
||||
#define _LOWER 1
|
||||
#define _RAISE 2
|
||||
#define _ADJUST 3
|
||||
|
||||
enum custom_keycodes {
|
||||
QWERTY = SAFE_RANGE,
|
||||
@ -246,4 +246,3 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
// #define MASTER_RIGHT
|
||||
#define EE_HANDS
|
||||
|
||||
#define SSD1306OLED
|
||||
// #define SSD1306OLED
|
||||
|
||||
#define USE_SERIAL_PD2
|
||||
|
||||
@ -48,3 +48,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define B6_AUDIO
|
||||
// #define NO_MUSIC_MODE
|
||||
#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
|
||||
|
240
keyboards/crkbd/keymaps/drashna/glcdfont.c
Normal file
240
keyboards/crkbd/keymaps/drashna/glcdfont.c
Normal file
@ -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
|
||||
#include "ssd1306.h"
|
||||
#endif
|
||||
#ifdef OLED_DRIVER_ENABLE
|
||||
#include "oled_driver.h"
|
||||
#endif
|
||||
|
||||
extern keymap_config_t keymap_config;
|
||||
extern uint8_t is_master;
|
||||
@ -288,3 +291,123 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
|
||||
}
|
||||
|
||||
#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
|
||||
# the appropriate keymap folder that will get included automatically
|
||||
#
|
||||
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE = no # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE = no # Console for debug(+400)
|
||||
COMMAND_ENABLE = no # Commands for debug and configuration
|
||||
NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
|
||||
MIDI_ENABLE = no # MIDI controls
|
||||
AUDIO_ENABLE = no # Audio output on port C6
|
||||
UNICODE_ENABLE = no # Unicode
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight.
|
||||
SWAP_HANDS_ENABLE = no # Enable one-hand typing
|
||||
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE = no # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE = no # Console for debug(+400)
|
||||
COMMAND_ENABLE = no # Commands for debug and configuration
|
||||
NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
|
||||
MIDI_ENABLE = no # MIDI controls
|
||||
AUDIO_ENABLE = no # Audio output on port C6
|
||||
UNICODE_ENABLE = no # Unicode
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight.
|
||||
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
|
||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||
|
||||
BOOTLOADER = qmk-dfu
|
||||
|
||||
# If you want to change the display of OLED, you need to change here
|
||||
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 \
|
||||
OLED_DRIVER_ENABLE = yes
|
||||
|
@ -22,9 +22,9 @@ extern uint8_t is_master;
|
||||
// Layer names don't all need to be of the same length, obviously, and you can also skip them
|
||||
// entirely and just use numbers.
|
||||
#define _QWERTY 0
|
||||
#define _LOWER 3
|
||||
#define _RAISE 4
|
||||
#define _ADJUST 16
|
||||
#define _LOWER 1
|
||||
#define _RAISE 2
|
||||
#define _ADJUST 3
|
||||
|
||||
enum custom_keycodes {
|
||||
QWERTY = SAFE_RANGE,
|
||||
@ -240,4 +240,3 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -22,9 +22,9 @@ extern uint8_t is_master;
|
||||
// Layer names don't all need to be of the same length, obviously, and you can also skip them
|
||||
// entirely and just use numbers.
|
||||
#define _QWERTY 0
|
||||
#define _LOWER 3
|
||||
#define _RAISE 4
|
||||
#define _ADJUST 16
|
||||
#define _LOWER 1
|
||||
#define _RAISE 2
|
||||
#define _ADJUST 3
|
||||
|
||||
enum custom_keycodes {
|
||||
QWERTY = SAFE_RANGE,
|
||||
@ -241,4 +241,3 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -3,11 +3,12 @@
|
||||
#include <stdio.h>
|
||||
#include "crkbd.h"
|
||||
|
||||
// in the future, should use (1U<<_LAYER_NAME) instead, but needs to be moved to keymap,c
|
||||
#define L_BASE 0
|
||||
#define L_LOWER 8
|
||||
#define L_RAISE 16
|
||||
#define L_ADJUST 65536
|
||||
#define L_ADJUST_TRI 65560
|
||||
#define L_LOWER 2
|
||||
#define L_RAISE 4
|
||||
#define L_ADJUST 8
|
||||
#define L_ADJUST_TRI 14
|
||||
|
||||
char layer_state_str[24];
|
||||
|
||||
|
@ -55,133 +55,75 @@ void led_set_kb(uint8_t usb_led) {
|
||||
* | {x=0..224, y=0..64} physical layout
|
||||
* | | | modifier
|
||||
* | | | */
|
||||
const rgb_led g_rgb_leds_left[27] = {
|
||||
//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
|
||||
#define RGB_MATRIX_LEFT_LEDS \
|
||||
{ { 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 */
|
||||
|
||||
{ { 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
|
||||
};
|
||||
const rgb_led g_rgb_leds_right[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
|
||||
#define RGB_MATRIX_RIGHT_LEDS \
|
||||
{ { 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 */
|
||||
|
||||
{ { 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
|
||||
|
||||
};
|
||||
|
||||
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
|
||||
|
||||
};
|
||||
#ifdef RGB_MATRIX_SPLIT_RIGHT
|
||||
const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
|
||||
RGB_MATRIX_RIGHT_LEDS
|
||||
RGB_MATRIX_LEFT_LEDS
|
||||
};
|
||||
#else
|
||||
const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
|
||||
RGB_MATRIX_LEFT_LEDS
|
||||
RGB_MATRIX_RIGHT_LEDS
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif
|
||||
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/split_util.c
|
||||
SRC += rev1/split_scomm.c
|
||||
|
@ -1,9 +1,6 @@
|
||||
Doro67 Multi PCB
|
||||
===
|
||||
# Doro67 Multi PCB
|
||||
|
||||
A custom 65% keyboard with multiple layout support.
|
||||
|
||||
Do not flash RGB firmware for this board.
|
||||
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.
|
||||
|
||||
Keyboard Maintainer: [ShadeDream](https://github.com/shadedream)
|
||||
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 PRODUCT_ID 0x0000
|
||||
#define DEVICE_VER 0x0001
|
||||
#define MANUFACTURER 80ultraman
|
||||
#define PRODUCT doro67
|
||||
#define MANUFACTURER Backprop Studio
|
||||
#define PRODUCT Doro67 Regular PCB
|
||||
#define DESCRIPTION 65% custom keyboard
|
||||
|
||||
/* 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)
|
||||
Hardware Supported: Doro67 Regular PCB
|
||||
|
71
keyboards/doro67/rgb/config.h
Normal file
71
keyboards/doro67/rgb/config.h
Normal file
@ -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
|
82
keyboards/doro67/rgb/info.json
Normal file
82
keyboards/doro67/rgb/info.json
Normal file
@ -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}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_USER_H
|
||||
#define CONFIG_USER_H
|
||||
#pragma once
|
||||
|
||||
#include QMK_KEYBOARD_CONFIG_H
|
||||
|
||||
#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
|
||||
// place overrides here
|
62
keyboards/doro67/rgb/keymaps/default/keymap.c
Normal file
62
keyboards/doro67/rgb/keymaps/default/keymap.c
Normal file
@ -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;
|
||||
}
|
1
keyboards/doro67/rgb/keymaps/default/readme.md
Normal file
1
keyboards/doro67/rgb/keymaps/default/readme.md
Normal file
@ -0,0 +1 @@
|
||||
# The default keymap for rgb
|
17
keyboards/doro67/rgb/readme.md
Normal file
17
keyboards/doro67/rgb/readme.md
Normal file
@ -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).
|
127
keyboards/doro67/rgb/rgb.c
Normal file
127
keyboards/doro67/rgb/rgb.c
Normal file
@ -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
|
||||
};
|
41
keyboards/doro67/rgb/rgb.h
Normal file
41
keyboards/doro67/rgb/rgb.h
Normal file
@ -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 }, \
|
||||
}
|
83
keyboards/doro67/rgb/rules.mk
Normal file
83
keyboards/doro67/rgb/rules.mk
Normal file
@ -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)
|
9
keyboards/dz60/keymaps/billiams/build_flash.sh
Normal file
9
keyboards/dz60/keymaps/billiams/build_flash.sh
Normal file
@ -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
|
1
keyboards/dz60/keymaps/billiams/config.h
Normal file
1
keyboards/dz60/keymaps/billiams/config.h
Normal file
@ -0,0 +1 @@
|
||||
#define GRAVE_ESC_GUI_OVERRIDE # Always send Escape if GUI is pressed
|
48
keyboards/dz60/keymaps/billiams/keymap.c
Normal file
48
keyboards/dz60/keymaps/billiams/keymap.c
Normal file
@ -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
|
||||
),
|
||||
};
|
73
keyboards/dz60/keymaps/billiams/readme.md
Normal file
73
keyboards/dz60/keymaps/billiams/readme.md
Normal file
@ -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 git@github.com: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 |
|
||||
`-----------------------------------------------------------------------------------------'
|
||||
```
|
||||
|
@ -22,7 +22,7 @@
|
||||
|
||||
#define DEBOUNCE 3
|
||||
#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_LED_PROCESS_LIMIT 4
|
||||
#define RGB_MATRIX_LED_FLUSH_LIMIT 26
|
||||
|
@ -1,14 +1,7 @@
|
||||
#include "dz60rgb.h"
|
||||
#include "config.h"
|
||||
#if defined (dzrgb60_iso)
|
||||
|
||||
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_13, J_13, L_13},
|
||||
{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_2, J_2, L_2},
|
||||
{0, K_1, J_1, L_1},
|
||||
|
||||
{0, H_15, G_15, I_15},
|
||||
{0, H_13, G_13, I_13},
|
||||
{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_2, G_2, I_2},
|
||||
{0, H_1, G_1, I_1},
|
||||
|
||||
{0, B_14, A_14, C_14},
|
||||
{0, E_12, D_12, F_12},
|
||||
{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_2, D_2, F_2},
|
||||
{0, E_1, D_1, F_1},
|
||||
|
||||
{0, B_13, A_13, C_13},
|
||||
{0, B_11, A_11, C_11},
|
||||
{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_2, A_2, C_2},
|
||||
{0, B_1, A_1, C_1},
|
||||
|
||||
{0, B_15, A_15, C_15},
|
||||
{0, E_13, D_13, F_13},
|
||||
{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, E_16, D_16, F_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] = {
|
||||
{{0|(13<<4)}, {16*13.5, 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|(1<<4)}, {16*1, 0}, 1},
|
||||
{{0|(0<<4)}, {16*0, 0}, 1},
|
||||
|
||||
{{2|(13<<4)}, {16*13.75, 24}, 1},
|
||||
{{1|(12<<4)}, {16*12.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|(1<<4)}, { 16*1.5, 16}, 0},
|
||||
{{1|(0<<4)}, { 16*0.25, 16}, 1},
|
||||
|
||||
{{1|(13<<4)}, {16*12.75, 32}, 1},
|
||||
{{2|(11<<4)}, {16*11.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|(1<<4)}, { 16*1.75, 32}, 0},
|
||||
{{2|(0<<4)}, { 16*0.375, 32}, 1},
|
||||
|
||||
{{3|(11<<4)}, {16*13.125, 48}, 1},
|
||||
{{3|(10<<4)}, {16*11.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|(1<<4)}, {16*1.25, 48}, 0},
|
||||
{{3|(0<<4)}, {16*0.625, 48}, 1},
|
||||
|
||||
{{4|(13<<4)}, {16*13.875, 64}, 1},
|
||||
{{4|(11<<4)}, {16*12.625, 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|(2<<4)}, { 16*2.625, 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)
|
||||
|
||||
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, K_14, J_14, L_14},
|
||||
{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_2, J_2, L_2},
|
||||
{0, K_1, J_1, L_1},
|
||||
|
||||
{0, H_14, G_14, I_14},
|
||||
{0, H_13, G_13, I_13},
|
||||
{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_2, G_2, I_2},
|
||||
{0, H_1, G_1, I_1},
|
||||
|
||||
{0, E_14, D_14, F_14},
|
||||
{0, E_12, D_12, F_12},
|
||||
{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_2, D_2, F_2},
|
||||
{0, E_1, D_1, F_1},
|
||||
|
||||
{0, B_14, A_14, C_14},
|
||||
{0, B_13, A_13, C_13},
|
||||
{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_2, A_2, C_2},
|
||||
{0, B_1, A_1, C_1},
|
||||
|
||||
{0, B_15, A_15, C_15},
|
||||
{0, E_13, D_13, F_13},
|
||||
{0, B_12, A_12, C_12},
|
||||
{0, B_16, A_16, C_16},
|
||||
{0, E_16, D_16, F_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] = {
|
||||
{{2|(12<<4)}, {16*14, 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|(1<<4)}, {16*1, 0}, 1},
|
||||
{{0|(0<<4)}, {16*0, 0}, 1},
|
||||
|
||||
{{1|(13<<4)}, {16*13.75, 16}, 1},
|
||||
{{1|(12<<4)}, {16*12.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|(1<<4)}, { 16*1.5, 16}, 0},
|
||||
{{1|(0<<4)}, { 16*0.25, 16}, 1},
|
||||
|
||||
{{2|(13<<4)}, {16*12.75, 32}, 1},
|
||||
{{2|(11<<4)}, {16*11.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|(1<<4)}, { 16*1.75, 32}, 0},
|
||||
{{2|(0<<4)}, { 16*0.375, 32}, 1},
|
||||
|
||||
{{3|(13<<4)}, {16*14, 48}, 1},
|
||||
{{3|(11<<4)}, {16*12.625, 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|(1<<4)}, {16*1.25, 48}, 0},
|
||||
{{3|(0<<4)}, {16*0.625, 48}, 1},
|
||||
|
||||
{{4|(13<<4)}, {16*13.625, 64}, 1},
|
||||
{{4|(11<<4)}, {16*12.375, 64}, 1},
|
||||
{{4|(10<<4)}, {16*11.125, 64}, 1},
|
||||
{{4|(5<<4)}, { 16*7, 64}, 0},
|
||||
{{4|(2<<4)}, { 16*2.875, 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)
|
||||
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, K_14, J_14, L_14},
|
||||
{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_2, J_2, L_2},
|
||||
{0, K_1, J_1, L_1},
|
||||
|
||||
{0, K_15, J_15, L_15},
|
||||
{0, H_13, G_13, I_13},
|
||||
{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_2, G_2, I_2},
|
||||
{0, H_1, G_1, I_1},
|
||||
|
||||
{0, E_15, D_15, F_15},
|
||||
{0, E_12, D_12, F_12},
|
||||
{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_2, D_2, F_2},
|
||||
{0, E_1, D_1, F_1},
|
||||
|
||||
{0, B_14, A_14, C_14},
|
||||
{0, B_13, A_13, C_13},
|
||||
{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_2, A_2, C_2},
|
||||
{0, B_1, A_1, C_1},
|
||||
|
||||
{0, B_15, A_15, C_15},
|
||||
{0, E_13, D_13, F_13},
|
||||
{0, B_12, A_12, C_12},
|
||||
{0, B_16, A_16, C_16},
|
||||
{0, E_16, D_16, F_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] = {
|
||||
{{2|(12<<4)}, {16*14, 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|(1<<4)}, {16*1, 0}, 1},
|
||||
{{0|(0<<4)}, {16*0, 0}, 1},
|
||||
|
||||
{{2|(13<<4)}, {16*13.75, 24}, 1},
|
||||
{{1|(12<<4)}, {16*12.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|(1<<4)}, { 16*1.5, 16}, 0},
|
||||
{{1|(0<<4)}, { 16*0.25, 16}, 1},
|
||||
|
||||
{{1|(13<<4)}, {16*12.75, 32}, 1},
|
||||
{{2|(11<<4)}, {16*11.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|(1<<4)}, { 16*1.75, 32}, 0},
|
||||
{{2|(0<<4)}, { 16*0.375, 32}, 1},
|
||||
|
||||
{{3|(13<<4)}, {16*14, 48}, 1},
|
||||
{{3|(11<<4)}, {16*12.625, 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|(1<<4)}, {16*1.25, 48}, 0},
|
||||
{{3|(0<<4)}, {16*0.625, 48}, 1},
|
||||
|
||||
{{4|(13<<4)}, {16*13.625, 64}, 1},
|
||||
{{4|(11<<4)}, {16*12.375, 64}, 1},
|
||||
{{4|(10<<4)}, {16*11.125, 64}, 1},
|
||||
{{4|(5<<4)}, { 16*7, 64}, 0},
|
||||
{{4|(2<<4)}, { 16*2.875, 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)
|
||||
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_13, J_13, L_13},
|
||||
{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_2, J_2, L_2},
|
||||
{0, K_1, J_1, L_1},
|
||||
|
||||
{0, H_14, G_14, I_14},
|
||||
{0, H_13, G_13, I_13},
|
||||
{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_2, G_2, I_2},
|
||||
{0, H_1, G_1, I_1},
|
||||
|
||||
{0, E_14, D_14, F_14},
|
||||
{0, E_12, D_12, F_12},
|
||||
{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_2, D_2, F_2},
|
||||
{0, E_1, D_1, F_1},
|
||||
|
||||
{0, B_13, A_13, C_13},
|
||||
{0, B_11, A_11, C_11},
|
||||
{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_2, A_2, C_2},
|
||||
{0, B_1, A_1, C_1},
|
||||
|
||||
{0, B_15, A_15, C_15},
|
||||
{0, E_13, D_13, F_13},
|
||||
{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, E_16, D_16, F_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] = {
|
||||
{{0|(13<<4)}, {16*13.5, 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|(1<<4)}, {16*1, 0}, 1},
|
||||
{{0|(0<<4)}, {16*0, 0}, 1},
|
||||
|
||||
{{1|(13<<4)}, {16*13.75, 16}, 1},
|
||||
{{1|(12<<4)}, {16*12.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|(1<<4)}, { 16*1.5, 16}, 0},
|
||||
{{1|(0<<4)}, { 16*0.25, 16}, 1},
|
||||
|
||||
{{2|(13<<4)}, {16*13.375, 24}, 1},
|
||||
{{2|(11<<4)}, {16*11.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|(1<<4)}, { 16*1.75, 32}, 0},
|
||||
{{2|(0<<4)}, { 16*0.375, 32}, 1},
|
||||
|
||||
{{3|(11<<4)}, {16*13.125, 48}, 1},
|
||||
{{3|(10<<4)}, {16*11.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|(1<<4)}, {16*1.25, 48}, 0},
|
||||
{{3|(0<<4)}, {16*0.625, 48}, 1},
|
||||
|
||||
{{4|(13<<4)}, {16*13.875, 64}, 1},
|
||||
{{4|(11<<4)}, {16*12.625, 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|(2<<4)}, { 16*2.625, 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
|
||||
|
||||
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_13, J_13, L_13},
|
||||
{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_2, J_2, L_2},
|
||||
{0, K_1, J_1, L_1},
|
||||
|
||||
{0, H_14, G_14, I_14},
|
||||
{0, H_13, G_13, I_13},
|
||||
{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_2, G_2, I_2},
|
||||
{0, H_1, G_1, I_1},
|
||||
|
||||
{0, E_14, D_14, F_14},
|
||||
{0, E_12, D_12, F_12},
|
||||
{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_2, D_2, F_2},
|
||||
{0, E_1, D_1, F_1},
|
||||
|
||||
{0, B_14, A_14, C_14},
|
||||
{0, B_13, A_13, C_13},
|
||||
{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_2, A_2, C_2},
|
||||
{0, B_1, A_1, C_1},
|
||||
|
||||
{0, B_15, A_15, C_15},
|
||||
{0, E_13, D_13, F_13},
|
||||
{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, E_16, D_16, F_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] = {
|
||||
{{0|(13<<4)}, {17.23*13, 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|(1<<4)}, { 17.23*1, 0}, 1},
|
||||
{{0|(0<<4)}, { 17.23*0, 0}, 1},
|
||||
|
||||
{{1|(13<<4)}, {17.23*13, 16}, 1},
|
||||
{{1|(12<<4)}, {17.23*12, 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|(1<<4)}, { 17.23*1, 16}, 0},
|
||||
{{1|(0<<4)}, { 17.23*0, 16}, 1},
|
||||
|
||||
{{2|(13<<4)}, {17.23*13, 32}, 1},
|
||||
{{2|(11<<4)}, {17.23*11, 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|(1<<4)}, { 17.23*1, 32}, 0},
|
||||
{{2|(0<<4)}, { 17.23*0, 32}, 1},
|
||||
|
||||
{{3|(13<<4)}, {17.23*13, 48}, 1},
|
||||
{{3|(11<<4)}, {17.23*11, 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|(1<<4)}, { 17.23*1, 48}, 0},
|
||||
{{3|(0<<4)}, { 17.23*0, 48}, 1},
|
||||
|
||||
{{4|(13<<4)}, {17.23*13, 64}, 1},
|
||||
{{4|(11<<4)}, {17.23*11, 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|(2<<4)}, { 17.23*2, 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
|
||||
|
||||
void matrix_init_kb(void) {
|
||||
matrix_init_user();
|
||||
}
|
||||
|
||||
|
||||
void matrix_scan_kb(void) {
|
||||
matrix_scan_user();
|
||||
}
|
||||
|
||||
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
return process_record_user(keycode, record);
|
||||
}
|
||||
|
||||
|
||||
void suspend_power_down_kb(void)
|
||||
{
|
||||
rgb_matrix_set_suspend_state(true);
|
||||
suspend_power_down_user();
|
||||
}
|
||||
|
||||
void suspend_wakeup_init_kb(void)
|
||||
{
|
||||
rgb_matrix_set_suspend_state(false);
|
||||
suspend_wakeup_init_user();
|
||||
}
|
||||
|
@ -5,26 +5,23 @@ extern bool g_suspend_state;
|
||||
#define _LAYER2 2
|
||||
#define _LAYER3 3
|
||||
#define _LAYER4 4
|
||||
#define _LAYER5 5
|
||||
#define _LAYER6 6
|
||||
#define _LAYER7 7
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[_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_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, \
|
||||
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_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,\
|
||||
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_LCTL, KC_LGUI, LM(1, MOD_LALT), KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RIGHT),
|
||||
[_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 ,\
|
||||
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, TO(4), KC_TRNS, KC_TRNS, KC_MPRV, KC_VOLD, KC_MNXT),
|
||||
[_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, 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),
|
||||
[_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_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),
|
||||
[_LAYER4] = LAYOUT( /* MAC */
|
||||
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,\
|
||||
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_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MO(5) , KC_LEFT, KC_DOWN, KC_RIGHT),
|
||||
[_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_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, \
|
||||
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, 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) {
|
||||
uint8_t this_led = host_keyboard_leds();
|
||||
if (!g_suspend_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:
|
||||
if ( this_led & (1<<USB_LED_NUM_LOCK)) {
|
||||
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);
|
||||
break;
|
||||
case _LAYER4:
|
||||
rgb_matrix_layer_helper(0xFF, 0xFF, 0x00, false);
|
||||
rgb_matrix_set_color_all(0xFF, 0xFF, 0x00);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ( this_led & (1<<USB_LED_CAPS_LOCK)) {
|
||||
rgb_matrix_set_color(40, 0xFF, 0xFF, 0xFF);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void matrix_init_user(void) {
|
||||
//user initialization
|
||||
}
|
||||
@ -158,6 +130,6 @@ void matrix_scan_user(void) {
|
||||
//user matrix
|
||||
}
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
return true;
|
||||
}
|
||||
|
@ -98,7 +98,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* 5, which is now closer to 10ms, but still plenty according to
|
||||
* manufacturer specs.
|
||||
*/
|
||||
#define DEBOUNCE 10
|
||||
|
||||
#define USB_MAX_POWER_CONSUMPTION 500
|
||||
|
||||
|
@ -72,7 +72,7 @@
|
||||
k01, k02, k75, k08, k09 \
|
||||
) \
|
||||
{ \
|
||||
{ KC_NO, k01, k02, KC_NO, KC_NO, k05, KC_NO, KC_NO, k08, k09, KC_NO }, \
|
||||
{ KC_NO, k01, k02, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k08, k09, KC_NO }, \
|
||||
{ k10, k11, k12, k13, k14, k15, KC_NO, KC_NO, k18, k19, KC_NO }, \
|
||||
{ k20, k21, k22, k23, k24, k25, k26, KC_NO, k28, k29, KC_NO }, \
|
||||
{ k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, KC_NO }, \
|
||||
|
@ -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/>.
|
||||
*/
|
||||
|
||||
#ifndef FRENCHDEV_V1_CONFIG_H
|
||||
#define FRENCHDEV_V1_CONFIG_H
|
||||
#pragma once
|
||||
|
||||
#include "config_common.h"
|
||||
|
||||
@ -81,5 +80,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
//#define NO_ACTION_MACRO
|
||||
//#define NO_ACTION_FUNCTION
|
||||
//#define DEBUG_MATRIX_SCAN_RATE
|
||||
|
||||
#endif //FRENCHDEV_V1_CONFIG_H
|
||||
|
@ -1,5 +1,26 @@
|
||||
#include "frenchdev.h"
|
||||
#include "i2cmaster.h"
|
||||
|
||||
extern inline void frenchdev_board_led_on(void);
|
||||
extern inline void frenchdev_led_1_on(void);
|
||||
extern inline void frenchdev_led_2_on(void);
|
||||
extern inline void frenchdev_led_3_on(void);
|
||||
extern inline void frenchdev_led_on(uint8_t led);
|
||||
|
||||
extern inline void frenchdev_board_led_off(void);
|
||||
extern inline void frenchdev_led_1_off(void);
|
||||
extern inline void frenchdev_led_2_off(void);
|
||||
extern inline void frenchdev_led_3_off(void);
|
||||
extern inline void frenchdev_led_off(uint8_t led);
|
||||
|
||||
extern inline void frenchdev_led_all_on(void);
|
||||
extern inline void frenchdev_led_all_off(void);
|
||||
|
||||
extern inline void frenchdev_led_1_set(uint8_t n);
|
||||
extern inline void frenchdev_led_2_set(uint8_t n);
|
||||
extern inline void frenchdev_led_3_set(uint8_t n);
|
||||
extern inline void frenchdev_led_set(uint8_t led, uint8_t n);
|
||||
|
||||
extern inline void frenchdev_led_all_set(uint8_t n);
|
||||
|
||||
bool i2c_initialized = 0;
|
||||
uint8_t mcp23018_status = 0x20;
|
||||
@ -31,15 +52,15 @@ void frenchdev_blink_all_leds(void)
|
||||
frenchdev_led_all_off();
|
||||
frenchdev_led_all_set(LED_BRIGHTNESS_HI);
|
||||
frenchdev_led_1_on();
|
||||
_delay_ms(50);
|
||||
wait_ms(50);
|
||||
frenchdev_led_2_on();
|
||||
_delay_ms(50);
|
||||
wait_ms(50);
|
||||
frenchdev_led_3_on();
|
||||
_delay_ms(50);
|
||||
wait_ms(50);
|
||||
frenchdev_led_1_off();
|
||||
_delay_ms(50);
|
||||
wait_ms(50);
|
||||
frenchdev_led_2_off();
|
||||
_delay_ms(50);
|
||||
wait_ms(50);
|
||||
frenchdev_led_3_off();
|
||||
frenchdev_led_all_off();
|
||||
}
|
||||
@ -54,28 +75,28 @@ uint8_t init_mcp23018(void) {
|
||||
// cli();
|
||||
if (i2c_initialized == 0) {
|
||||
i2c_init(); // on pins D(1,0)
|
||||
i2c_initialized++;
|
||||
_delay_ms(1000);
|
||||
i2c_initialized = true;;
|
||||
wait_ms(1000);
|
||||
}
|
||||
|
||||
// set pin direction
|
||||
// - unused : input : 1
|
||||
// - input : input : 1
|
||||
// - driving : output : 0
|
||||
mcp23018_status = i2c_start(I2C_ADDR_WRITE); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_write(IODIRA); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_write(0b00000000); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_write(0b00111111); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_start(I2C_ADDR_WRITE, I2C_TIMEOUT); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_write(IODIRA, I2C_TIMEOUT); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_write(0b00000000, I2C_TIMEOUT); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_write(0b00111111, I2C_TIMEOUT); if (mcp23018_status) goto out;
|
||||
i2c_stop();
|
||||
|
||||
// set pull-up
|
||||
// - unused : on : 1
|
||||
// - input : on : 1
|
||||
// - driving : off : 0
|
||||
mcp23018_status = i2c_start(I2C_ADDR_WRITE); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_write(GPPUA); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_write(0b00000000); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_write(0b00111111); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_start(I2C_ADDR_WRITE, I2C_TIMEOUT); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_write(GPPUA, I2C_TIMEOUT); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_write(0b00000000, I2C_TIMEOUT); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_write(0b00111111, I2C_TIMEOUT); if (mcp23018_status) goto out;
|
||||
|
||||
out:
|
||||
i2c_stop();
|
||||
@ -84,4 +105,3 @@ out:
|
||||
|
||||
return mcp23018_status;
|
||||
}
|
||||
|
||||
|
@ -1,10 +1,9 @@
|
||||
#ifndef FRENCHDEV_V1_H
|
||||
#define FRENCHDEV_V1_H
|
||||
#pragma once
|
||||
|
||||
#include "quantum.h"
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include "i2cmaster.h"
|
||||
#include "i2c_master.h"
|
||||
#include <util/delay.h>
|
||||
|
||||
#define CPU_PRESCALE(n) (CLKPR = 0x80, CLKPR = (n))
|
||||
@ -24,6 +23,7 @@
|
||||
#define OLATB 0x15
|
||||
|
||||
extern uint8_t mcp23018_status;
|
||||
#define I2C_TIMEOUT 100
|
||||
|
||||
void init_frenchdev(void);
|
||||
void frenchdev_blink_all_leds(void);
|
||||
@ -111,5 +111,3 @@ inline void frenchdev_led_all_set(uint8_t n)
|
||||
{ k51, k41, k31, k21, k11, k01 }, \
|
||||
{ k50, k40, k30, k20, k10, KC_NO } \
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -1,178 +0,0 @@
|
||||
#ifndef _I2CMASTER_H
|
||||
#define _I2CMASTER_H 1
|
||||
/*************************************************************************
|
||||
* Title: C include file for the I2C master interface
|
||||
* (i2cmaster.S or twimaster.c)
|
||||
* Author: Peter Fleury <pfleury@gmx.ch> http://jump.to/fleury
|
||||
* File: $Id: i2cmaster.h,v 1.10 2005/03/06 22:39:57 Peter Exp $
|
||||
* Software: AVR-GCC 3.4.3 / avr-libc 1.2.3
|
||||
* Target: any AVR device
|
||||
* Usage: see Doxygen manual
|
||||
**************************************************************************/
|
||||
|
||||
#ifdef DOXYGEN
|
||||
/**
|
||||
@defgroup pfleury_ic2master I2C Master library
|
||||
@code #include <i2cmaster.h> @endcode
|
||||
|
||||
@brief I2C (TWI) Master Software Library
|
||||
|
||||
Basic routines for communicating with I2C slave devices. This single master
|
||||
implementation is limited to one bus master on the I2C bus.
|
||||
|
||||
This I2c library is implemented as a compact assembler software implementation of the I2C protocol
|
||||
which runs on any AVR (i2cmaster.S) and as a TWI hardware interface for all AVR with built-in TWI hardware (twimaster.c).
|
||||
Since the API for these two implementations is exactly the same, an application can be linked either against the
|
||||
software I2C implementation or the hardware I2C implementation.
|
||||
|
||||
Use 4.7k pull-up resistor on the SDA and SCL pin.
|
||||
|
||||
Adapt the SCL and SDA port and pin definitions and eventually the delay routine in the module
|
||||
i2cmaster.S to your target when using the software I2C implementation !
|
||||
|
||||
Adjust the CPU clock frequence F_CPU in twimaster.c or in the Makfile when using the TWI hardware implementaion.
|
||||
|
||||
@note
|
||||
The module i2cmaster.S is based on the Atmel Application Note AVR300, corrected and adapted
|
||||
to GNU assembler and AVR-GCC C call interface.
|
||||
Replaced the incorrect quarter period delays found in AVR300 with
|
||||
half period delays.
|
||||
|
||||
@author Peter Fleury pfleury@gmx.ch http://jump.to/fleury
|
||||
|
||||
@par API Usage Example
|
||||
The following code shows typical usage of this library, see example test_i2cmaster.c
|
||||
|
||||
@code
|
||||
|
||||
#include <i2cmaster.h>
|
||||
|
||||
|
||||
#define Dev24C02 0xA2 // device address of EEPROM 24C02, see datasheet
|
||||
|
||||
int main(void)
|
||||
{
|
||||
unsigned char ret;
|
||||
|
||||
i2c_init(); // initialize I2C library
|
||||
|
||||
// write 0x75 to EEPROM address 5 (Byte Write)
|
||||
i2c_start_wait(Dev24C02+I2C_WRITE); // set device address and write mode
|
||||
i2c_write(0x05); // write address = 5
|
||||
i2c_write(0x75); // write value 0x75 to EEPROM
|
||||
i2c_stop(); // set stop conditon = release bus
|
||||
|
||||
|
||||
// read previously written value back from EEPROM address 5
|
||||
i2c_start_wait(Dev24C02+I2C_WRITE); // set device address and write mode
|
||||
|
||||
i2c_write(0x05); // write address = 5
|
||||
i2c_rep_start(Dev24C02+I2C_READ); // set device address and read mode
|
||||
|
||||
ret = i2c_readNak(); // read one byte from EEPROM
|
||||
i2c_stop();
|
||||
|
||||
for(;;);
|
||||
}
|
||||
@endcode
|
||||
|
||||
*/
|
||||
#endif /* DOXYGEN */
|
||||
|
||||
/**@{*/
|
||||
|
||||
#if (__GNUC__ * 100 + __GNUC_MINOR__) < 304
|
||||
#error "This library requires AVR-GCC 3.4 or later, update to newer AVR-GCC compiler !"
|
||||
#endif
|
||||
|
||||
#include <avr/io.h>
|
||||
|
||||
/** defines the data direction (reading from I2C device) in i2c_start(),i2c_rep_start() */
|
||||
#define I2C_READ 1
|
||||
|
||||
/** defines the data direction (writing to I2C device) in i2c_start(),i2c_rep_start() */
|
||||
#define I2C_WRITE 0
|
||||
|
||||
|
||||
/**
|
||||
@brief initialize the I2C master interace. Need to be called only once
|
||||
@param void
|
||||
@return none
|
||||
*/
|
||||
extern void i2c_init(void);
|
||||
|
||||
|
||||
/**
|
||||
@brief Terminates the data transfer and releases the I2C bus
|
||||
@param void
|
||||
@return none
|
||||
*/
|
||||
extern void i2c_stop(void);
|
||||
|
||||
|
||||
/**
|
||||
@brief Issues a start condition and sends address and transfer direction
|
||||
|
||||
@param addr address and transfer direction of I2C device
|
||||
@retval 0 device accessible
|
||||
@retval 1 failed to access device
|
||||
*/
|
||||
extern unsigned char i2c_start(unsigned char addr);
|
||||
|
||||
|
||||
/**
|
||||
@brief Issues a repeated start condition and sends address and transfer direction
|
||||
|
||||
@param addr address and transfer direction of I2C device
|
||||
@retval 0 device accessible
|
||||
@retval 1 failed to access device
|
||||
*/
|
||||
extern unsigned char i2c_rep_start(unsigned char addr);
|
||||
|
||||
|
||||
/**
|
||||
@brief Issues a start condition and sends address and transfer direction
|
||||
|
||||
If device is busy, use ack polling to wait until device ready
|
||||
@param addr address and transfer direction of I2C device
|
||||
@return none
|
||||
*/
|
||||
extern void i2c_start_wait(unsigned char addr);
|
||||
|
||||
|
||||
/**
|
||||
@brief Send one byte to I2C device
|
||||
@param data byte to be transfered
|
||||
@retval 0 write successful
|
||||
@retval 1 write failed
|
||||
*/
|
||||
extern unsigned char i2c_write(unsigned char data);
|
||||
|
||||
|
||||
/**
|
||||
@brief read one byte from the I2C device, request more data from device
|
||||
@return byte read from I2C device
|
||||
*/
|
||||
extern unsigned char i2c_readAck(void);
|
||||
|
||||
/**
|
||||
@brief read one byte from the I2C device, read is followed by a stop condition
|
||||
@return byte read from I2C device
|
||||
*/
|
||||
extern unsigned char i2c_readNak(void);
|
||||
|
||||
/**
|
||||
@brief read one byte from the I2C device
|
||||
|
||||
Implemented as a macro, which calls either i2c_readAck or i2c_readNak
|
||||
|
||||
@param ack 1 send ack, request more data from device<br>
|
||||
0 send nak, read is followed by a stop condition
|
||||
@return byte read from I2C device
|
||||
*/
|
||||
extern unsigned char i2c_read(unsigned char ack);
|
||||
#define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak();
|
||||
|
||||
|
||||
/**@}*/
|
||||
#endif
|
@ -1,5 +1,4 @@
|
||||
#include QMK_KEYBOARD_H
|
||||
#include "mousekey.h"
|
||||
#include "keymap_bepo.h"
|
||||
|
||||
|
||||
@ -14,7 +13,7 @@
|
||||
#define KEY_DELAY 130
|
||||
|
||||
enum macros {
|
||||
M_LP, // left pedal
|
||||
M_LP = SAFE_RANGE, // left pedal
|
||||
M_RP, // right pedal
|
||||
M_SF, // shift
|
||||
M_SFS, // shift and space
|
||||
@ -63,19 +62,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
* |------+------| / |------| , | space|------|------|------ .. ------|------|------| L1/sp| LEFT |------| UP |------+------| *
|
||||
* | CTRL | win |------/ \-------------| L1 | alt | .. | CAPS | L1 |-------------/ \------| : | CTRL | *
|
||||
* `-------------/ \-------------/ .. \-------------/ \-------------/ *
|
||||
*M(M_LP)
|
||||
*/
|
||||
[_BASE] = LAYOUT(
|
||||
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, BP_DQOT, BP_LGIL, BP_RGIL, BP_LPRN, BP_RPRN, BP_DTRM, BP_DCRC, BP_AT, BP_PLUS, BP_MINS, BP_SLSH, BP_ASTR, KC_BSPC, \
|
||||
KC_TAB, BP_B, BP_ECUT, BP_O, BP_P, BP_EGRV, BP_UNDS, BP_EQL, BP_K, BP_V, BP_D, BP_L, BP_J, KC_ENT, \
|
||||
BP_GRV, BP_A, BP_U, BP_E, BP_I, BP_F, BP_SCLN, BP_EXLM, BP_C, BP_T, BP_S, BP_R, BP_N, BP_APOS, \
|
||||
M(M_SF), BP_Z, BP_AGRV, BP_Y, BP_X, KC_RBRACKET, M(M_SFS), BP_CBSP, M(L2INS), M(L2LOC), BP_CDEL, M(M_SFS),BP_M, BP_G, KC_UP, BP_H, BP_Q, M(M_SF), \
|
||||
KC_LCTL, KC_LGUI, KC_PSLS, BP_DOT, BP_COMM, KC_SPACE,M(M_L1E), KC_LALT, KC_CAPS, M(M_L1E),KC_SPACE,KC_LEFT, KC_DOWN, KC_RIGHT,BP_COLN, KC_RCTL, \
|
||||
M_SF, BP_Z, BP_AGRV, BP_Y, BP_X, KC_RBRC, M_SFS, BP_CBSP, L2INS, L2LOC, BP_CDEL, M_SFS, BP_M, BP_G, KC_UP, BP_H, BP_Q, M_SF, \
|
||||
KC_LCTL, KC_LGUI, KC_PSLS, BP_DOT, BP_COMM, KC_SPACE,M_L1E, KC_LALT, KC_CAPS, M_L1E, KC_SPACE, KC_LEFT, KC_DOWN, KC_RIGHT,BP_COLN, KC_RCTL, \
|
||||
//left pedals
|
||||
M(M_LP), M(M_RP), KC_TRNS, \
|
||||
M_LP, M_RP, KC_TRNS, \
|
||||
//right pedals
|
||||
M(M_LP), M(M_RP), KC_TRNS \
|
||||
M_LP, M_RP, KC_TRNS \
|
||||
),
|
||||
|
||||
/* Larer 1 for symbols.
|
||||
@ -102,7 +100,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
KC_TRNS, BP_DCUR, BP_PARG, BP_SECT, BP_DGRK, KC_TRNS, BP_TILD, BP_DCAR, BP_LEQL, BP_GEQL, BP_PSMS, BP_OBEL, BP_TIMS, KC_TRNS, \
|
||||
KC_TRNS, BP_BSLS, BP_ASTR, BP_LCBR, BP_RCBR, BP_GRV, KC_TRNS, BP_DIFF, BP_HASH, BP_LBRC, BP_RBRC, BP_PERC, BP_PMIL, KC_TRNS, \
|
||||
KC_TRNS, BP_EQL, BP_UGRV, BP_LPRN, BP_RPRN, BP_PLUS, BP_COLN, BP_QEST, BP_CCED, BP_LESS, BP_GRTR, BP_AMPR, BP_UNDS, KC_TRNS, \
|
||||
KC_TRNS, M(M_UN), M(M_CUT),M(M_CP), M(M_PS), M(M_SE), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BP_DLR, BP_EQL, KC_PGUP, BP_PIPE, BP_SLSH, KC_TRNS, \
|
||||
KC_TRNS, M_UN, M_CUT, M_CP, M_PS, M_SE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BP_DLR, BP_EQL, KC_PGUP, BP_PIPE, BP_SLSH, KC_TRNS, \
|
||||
KC_TRNS, KC_TRNS, BP_BSLS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_END, KC_TRNS, KC_TRNS, \
|
||||
//left pedals
|
||||
KC_TRNS, KC_BTN1, KC_TRNS, \
|
||||
@ -134,12 +132,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_MSTP, KC_MPRV, KC_MNXT, KC_MPLY, KC_MPLY, KC_MPRV, KC_MNXT, KC_MSTP, KC_TRNS, KC_PMNS, KC_TRNS, \
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_WH_U, KC_TRNS, KC_BTN4, KC_BTN5, KC_BTN4, KC_BTN5, KC_KP_7, KC_KP_8, KC_KP_9, KC_PPLS, KC_TRNS, \
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_WH_D, KC_BTN3, KC_BTN2, KC_BTN1, KC_BTN1, KC_BTN2, KC_KP_4, KC_KP_5, KC_KP_6, KC_PAST, KC_TRNS, \
|
||||
KC_TRNS, M(M_UN), M(M_CUT),M(M_CP), M(M_PS), KC_BTN3, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN3, KC_KP_1, KC_KP_2, KC_KP_3, KC_PSLS, KC_TRNS, \
|
||||
KC_TRNS, M_UN, M_CUT, M_CP, M_PS, KC_BTN3, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN3, KC_KP_1, KC_KP_2, KC_KP_3, KC_PSLS, 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_KP_0, KC_PDOT, BP_DOT, BP_COMM, KC_TRNS, \
|
||||
//left pedals
|
||||
KC_BTN3, M(M_RP), KC_TRNS, \
|
||||
KC_BTN3, M_RP, KC_TRNS, \
|
||||
//right pedals
|
||||
KC_BTN3, M(M_RP), KC_TRNS \
|
||||
KC_BTN3, M_RP, KC_TRNS \
|
||||
),
|
||||
|
||||
/* TRNS - skeleton for laters
|
||||
@ -169,9 +167,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
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, \
|
||||
//left pedals
|
||||
KC_BTN3, M(M_RP), KC_TRNS, \
|
||||
KC_BTN3, M_RP, KC_TRNS, \
|
||||
//right pedals
|
||||
KC_BTN3, M(M_RP), KC_TRNS \
|
||||
KC_BTN3, M_RP, KC_TRNS \
|
||||
),
|
||||
|
||||
};
|
||||
@ -191,28 +189,52 @@ void release_shift(void) {
|
||||
|
||||
void press_space(void) {
|
||||
if(shift_count > 0) unregister_code (KC_LSHIFT);
|
||||
register_code (KC_SPACE);
|
||||
unregister_code (KC_SPACE);
|
||||
tap_code(KC_SPACE);
|
||||
if(shift_count > 0) register_code (KC_LSHIFT);
|
||||
}
|
||||
|
||||
void press_enter(void) {
|
||||
if(shift_count > 0) unregister_code (KC_LSHIFT);
|
||||
register_code (KC_ENT);
|
||||
unregister_code (KC_ENT);
|
||||
tap_code (KC_ENT);
|
||||
if(shift_count > 0) register_code (KC_LSHIFT);
|
||||
}
|
||||
|
||||
void press_underscore(void) {
|
||||
if(shift_count > 0) unregister_code (KC_LSHIFT);
|
||||
register_code ((unsigned char) BP_UNDS);
|
||||
unregister_code ((unsigned char) BP_UNDS);
|
||||
tap_code ((unsigned char) BP_UNDS);
|
||||
if(shift_count > 0) register_code (KC_LSHIFT);
|
||||
}
|
||||
|
||||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||
{
|
||||
switch(id) {
|
||||
void matrix_init_user(void) {
|
||||
}
|
||||
|
||||
// Bleah globals need to be initialized.
|
||||
uint8_t old_layer=_BASE;
|
||||
|
||||
void matrix_scan_user(void) {
|
||||
uint8_t layer = biton32(layer_state);
|
||||
|
||||
frenchdev_led_1_off();
|
||||
frenchdev_led_2_off();
|
||||
switch (layer) {
|
||||
case _BASE:
|
||||
frenchdev_led_2_on();
|
||||
break;
|
||||
case _SYMBOLS:
|
||||
frenchdev_led_1_on();
|
||||
break;
|
||||
case _MEDIA:
|
||||
frenchdev_led_1_on();
|
||||
frenchdev_led_2_on();
|
||||
default:
|
||||
// none
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
switch(keycode) {
|
||||
case M_LP: //left pedal
|
||||
if (record->event.pressed) {
|
||||
layer_on(1);
|
||||
@ -220,25 +242,19 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||
key_timer_left_pedal = timer_read(); // if the key is being pressed, we start the timer.
|
||||
} else {
|
||||
if (timer_elapsed(key_timer_left_pedal) < KEY_DELAY) {
|
||||
mousekey_on (KC_BTN2);
|
||||
mousekey_send();
|
||||
mousekey_off (KC_BTN2);
|
||||
mousekey_send();
|
||||
tap_code (KC_BTN2);
|
||||
}
|
||||
unregister_code (KC_SLCK);
|
||||
layer_off(1);
|
||||
}
|
||||
break;
|
||||
break;
|
||||
case M_RP: //right pedal
|
||||
if (record->event.pressed) {
|
||||
layer_on(2);
|
||||
key_timer_right_pedal = timer_read(); // if the key is being pressed, we start the timer.
|
||||
} else {
|
||||
if (timer_elapsed(key_timer_right_pedal) < PEDAL_DELAY) {
|
||||
mousekey_on (KC_BTN1);
|
||||
mousekey_send();
|
||||
mousekey_off (KC_BTN1);
|
||||
mousekey_send();
|
||||
tap_code (KC_BTN1);
|
||||
}
|
||||
layer_off(2);
|
||||
}
|
||||
@ -289,13 +305,12 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||
key_timer_2 = timer_read(); // if the key is being pressed, we start the timer.
|
||||
} else {
|
||||
if (timer_elapsed(key_timer_2) < KEY_DELAY) {
|
||||
register_code (KC_INS);
|
||||
unregister_code (KC_INS);
|
||||
tap_code (KC_INS);
|
||||
}
|
||||
l2_locked = 0;
|
||||
layer_off(2);
|
||||
}
|
||||
break;
|
||||
break;
|
||||
case L2LOC: //lock L2
|
||||
if (record->event.pressed) {
|
||||
key_timer_2 = timer_read(); // if the key is being pressed, we start the timer.
|
||||
@ -309,80 +324,33 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||
layer_off(2);
|
||||
}
|
||||
}
|
||||
break;
|
||||
break;
|
||||
case M_UN: // undo
|
||||
if (record->event.pressed) {
|
||||
register_code(KC_LCTL);
|
||||
register_code(BP_Z);
|
||||
unregister_code(BP_Z);
|
||||
unregister_code(KC_LCTL);
|
||||
tap_code16(C(BP_Z));
|
||||
}
|
||||
break;
|
||||
break;
|
||||
case M_CUT: // cut
|
||||
if (record->event.pressed) {
|
||||
register_code(KC_LCTL);
|
||||
register_code(BP_X);
|
||||
unregister_code(BP_X);
|
||||
unregister_code(KC_LCTL);
|
||||
tap_code16(C(BP_X));
|
||||
}
|
||||
break;
|
||||
break;
|
||||
case M_CP: // copy
|
||||
if (record->event.pressed) {
|
||||
register_code(KC_LCTL);
|
||||
register_code(BP_C);
|
||||
unregister_code(BP_C);
|
||||
unregister_code(KC_LCTL);
|
||||
tap_code16(C(BP_C));
|
||||
}
|
||||
break;
|
||||
break;
|
||||
case M_PS: // paste
|
||||
if (record->event.pressed) {
|
||||
register_code(KC_LCTL);
|
||||
register_code(BP_V);
|
||||
unregister_code(BP_V);
|
||||
unregister_code(KC_LCTL);
|
||||
tap_code16(C(BP_V));
|
||||
}
|
||||
break;
|
||||
break;
|
||||
case M_SE: // search
|
||||
if (record->event.pressed) {
|
||||
register_code(KC_LCTL);
|
||||
register_code(BP_F);
|
||||
unregister_code(BP_F);
|
||||
unregister_code(KC_LCTL);
|
||||
tap_code16(C(BP_F));
|
||||
}
|
||||
break;
|
||||
break;
|
||||
}
|
||||
return MACRO_NONE;
|
||||
};
|
||||
|
||||
void matrix_init_user(void) {
|
||||
}
|
||||
|
||||
// Bleah globals need to be initialized.
|
||||
uint8_t old_layer=_BASE;
|
||||
|
||||
void matrix_scan_user(void) {
|
||||
uint8_t layer = biton32(layer_state);
|
||||
|
||||
frenchdev_led_1_off();
|
||||
frenchdev_led_2_off();
|
||||
switch (layer) {
|
||||
case _BASE:
|
||||
frenchdev_led_2_on();
|
||||
break;
|
||||
case _SYMBOLS:
|
||||
frenchdev_led_1_on();
|
||||
break;
|
||||
case _MEDIA:
|
||||
frenchdev_led_1_on();
|
||||
frenchdev_led_2_on();
|
||||
default:
|
||||
// none
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -40,7 +40,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#include "util.h"
|
||||
#include "matrix.h"
|
||||
#include "frenchdev.h"
|
||||
#include "i2cmaster.h"
|
||||
#ifdef DEBUG_MATRIX_SCAN_RATE
|
||||
#include "timer.h"
|
||||
#endif
|
||||
@ -280,11 +279,12 @@ static matrix_row_t read_cols(uint8_t row)
|
||||
return 0;
|
||||
} else {
|
||||
uint8_t data = 0;
|
||||
mcp23018_status = i2c_start(I2C_ADDR_WRITE); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_write(GPIOB); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_start(I2C_ADDR_READ); if (mcp23018_status) goto out;
|
||||
data = i2c_readNak();
|
||||
data = ~data;
|
||||
mcp23018_status = i2c_start(I2C_ADDR_WRITE, I2C_TIMEOUT); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_write(GPIOB, I2C_TIMEOUT); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_start(I2C_ADDR_READ, I2C_TIMEOUT); if (mcp23018_status) goto out;
|
||||
data = i2c_read_nack(I2C_TIMEOUT); if (mcp23018_status < 0) goto out;
|
||||
data = ~((uint8_t)mcp23018_status);
|
||||
mcp23018_status = I2C_STATUS_SUCCESS;
|
||||
out:
|
||||
i2c_stop();
|
||||
return data;
|
||||
@ -318,11 +318,9 @@ static void unselect_rows(void)
|
||||
// do nothing
|
||||
} else {
|
||||
// set all rows hi-Z : 1
|
||||
mcp23018_status = i2c_start(I2C_ADDR_WRITE); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_write(GPIOA); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_write( 0xFF
|
||||
& ~(0<<8)
|
||||
); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_start(I2C_ADDR_WRITE, I2C_TIMEOUT); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_write(GPIOA, I2C_TIMEOUT); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_write( 0xFF & ~(0<<8), I2C_TIMEOUT); if (mcp23018_status) goto out;
|
||||
out:
|
||||
i2c_stop();
|
||||
}
|
||||
@ -346,11 +344,9 @@ static void select_row(uint8_t row)
|
||||
} else {
|
||||
// set active row low : 0
|
||||
// set other rows hi-Z : 1
|
||||
mcp23018_status = i2c_start(I2C_ADDR_WRITE); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_write(GPIOA); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_write( 0xFF & ~(1<<row)
|
||||
& ~(0<<8)
|
||||
); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_start(I2C_ADDR_WRITE, I2C_TIMEOUT); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_write(GPIOA, I2C_TIMEOUT); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_write( 0xFF & ~(1<<row) & ~(0<<8), I2C_TIMEOUT); if (mcp23018_status) goto out;
|
||||
out:
|
||||
i2c_stop();
|
||||
}
|
||||
@ -393,4 +389,3 @@ static void select_row(uint8_t row)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
# # project specific files
|
||||
SRC = twimaster.c \
|
||||
SRC = i2c_master.c \
|
||||
matrix.c
|
||||
|
||||
# MCU name
|
||||
@ -64,8 +64,7 @@ OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=512
|
||||
|
||||
BOOTLOADER = halfKay
|
||||
|
||||
# Build Options
|
||||
# comment out to disable the options.
|
||||
@ -86,4 +85,3 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
AUDIO_ENABLE = no # Audio output on port C6
|
||||
RGBLIGHT_ENABLE = no
|
||||
API_SYSEX_ENABLE = no
|
||||
|
||||
|
@ -1,208 +0,0 @@
|
||||
/*************************************************************************
|
||||
* Title: I2C master library using hardware TWI interface
|
||||
* Author: Peter Fleury <pfleury@gmx.ch> http://jump.to/fleury
|
||||
* File: $Id: twimaster.c,v 1.3 2005/07/02 11:14:21 Peter Exp $
|
||||
* Software: AVR-GCC 3.4.3 / avr-libc 1.2.3
|
||||
* Target: any AVR device with hardware TWI
|
||||
* Usage: API compatible with I2C Software Library i2cmaster.h
|
||||
**************************************************************************/
|
||||
#include <inttypes.h>
|
||||
#include <compat/twi.h>
|
||||
|
||||
#include <i2cmaster.h>
|
||||
|
||||
|
||||
/* define CPU frequency in Mhz here if not defined in Makefile */
|
||||
#ifndef F_CPU
|
||||
#define F_CPU 16000000UL
|
||||
#endif
|
||||
|
||||
/* I2C clock in Hz */
|
||||
#define SCL_CLOCK 400000L
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
Initialization of the I2C bus interface. Need to be called only once
|
||||
*************************************************************************/
|
||||
void i2c_init(void)
|
||||
{
|
||||
/* initialize TWI clock
|
||||
* minimal values in Bit Rate Register (TWBR) and minimal Prescaler
|
||||
* bits in the TWI Status Register should give us maximal possible
|
||||
* I2C bus speed - about 444 kHz
|
||||
*
|
||||
* for more details, see 20.5.2 in ATmega16/32 secification
|
||||
*/
|
||||
|
||||
TWSR = 0; /* no prescaler */
|
||||
TWBR = 10; /* must be >= 10 for stable operation */
|
||||
|
||||
}/* i2c_init */
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
Issues a start condition and sends address and transfer direction.
|
||||
return 0 = device accessible, 1= failed to access device
|
||||
*************************************************************************/
|
||||
unsigned char i2c_start(unsigned char address)
|
||||
{
|
||||
uint8_t twst;
|
||||
|
||||
// send START condition
|
||||
TWCR = (1<<TWINT) | (1<<TWSTA) | (1<<TWEN);
|
||||
|
||||
// wait until transmission completed
|
||||
while(!(TWCR & (1<<TWINT)));
|
||||
|
||||
// check value of TWI Status Register. Mask prescaler bits.
|
||||
twst = TW_STATUS & 0xF8;
|
||||
if ( (twst != TW_START) && (twst != TW_REP_START)) return 1;
|
||||
|
||||
// send device address
|
||||
TWDR = address;
|
||||
TWCR = (1<<TWINT) | (1<<TWEN);
|
||||
|
||||
// wail until transmission completed and ACK/NACK has been received
|
||||
while(!(TWCR & (1<<TWINT)));
|
||||
|
||||
// check value of TWI Status Register. Mask prescaler bits.
|
||||
twst = TW_STATUS & 0xF8;
|
||||
if ( (twst != TW_MT_SLA_ACK) && (twst != TW_MR_SLA_ACK) ) return 1;
|
||||
|
||||
return 0;
|
||||
|
||||
}/* i2c_start */
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
Issues a start condition and sends address and transfer direction.
|
||||
If device is busy, use ack polling to wait until device is ready
|
||||
|
||||
Input: address and transfer direction of I2C device
|
||||
*************************************************************************/
|
||||
void i2c_start_wait(unsigned char address)
|
||||
{
|
||||
uint8_t twst;
|
||||
|
||||
|
||||
while ( 1 )
|
||||
{
|
||||
// send START condition
|
||||
TWCR = (1<<TWINT) | (1<<TWSTA) | (1<<TWEN);
|
||||
|
||||
// wait until transmission completed
|
||||
while(!(TWCR & (1<<TWINT)));
|
||||
|
||||
// check value of TWI Status Register. Mask prescaler bits.
|
||||
twst = TW_STATUS & 0xF8;
|
||||
if ( (twst != TW_START) && (twst != TW_REP_START)) continue;
|
||||
|
||||
// send device address
|
||||
TWDR = address;
|
||||
TWCR = (1<<TWINT) | (1<<TWEN);
|
||||
|
||||
// wail until transmission completed
|
||||
while(!(TWCR & (1<<TWINT)));
|
||||
|
||||
// check value of TWI Status Register. Mask prescaler bits.
|
||||
twst = TW_STATUS & 0xF8;
|
||||
if ( (twst == TW_MT_SLA_NACK )||(twst ==TW_MR_DATA_NACK) )
|
||||
{
|
||||
/* device busy, send stop condition to terminate write operation */
|
||||
TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWSTO);
|
||||
|
||||
// wait until stop condition is executed and bus released
|
||||
while(TWCR & (1<<TWSTO));
|
||||
|
||||
continue;
|
||||
}
|
||||
//if( twst != TW_MT_SLA_ACK) return 1;
|
||||
break;
|
||||
}
|
||||
|
||||
}/* i2c_start_wait */
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
Issues a repeated start condition and sends address and transfer direction
|
||||
|
||||
Input: address and transfer direction of I2C device
|
||||
|
||||
Return: 0 device accessible
|
||||
1 failed to access device
|
||||
*************************************************************************/
|
||||
unsigned char i2c_rep_start(unsigned char address)
|
||||
{
|
||||
return i2c_start( address );
|
||||
|
||||
}/* i2c_rep_start */
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
Terminates the data transfer and releases the I2C bus
|
||||
*************************************************************************/
|
||||
void i2c_stop(void)
|
||||
{
|
||||
/* send stop condition */
|
||||
TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWSTO);
|
||||
|
||||
// wait until stop condition is executed and bus released
|
||||
while(TWCR & (1<<TWSTO));
|
||||
|
||||
}/* i2c_stop */
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
Send one byte to I2C device
|
||||
|
||||
Input: byte to be transfered
|
||||
Return: 0 write successful
|
||||
1 write failed
|
||||
*************************************************************************/
|
||||
unsigned char i2c_write( unsigned char data )
|
||||
{
|
||||
uint8_t twst;
|
||||
|
||||
// send data to the previously addressed device
|
||||
TWDR = data;
|
||||
TWCR = (1<<TWINT) | (1<<TWEN);
|
||||
|
||||
// wait until transmission completed
|
||||
while(!(TWCR & (1<<TWINT)));
|
||||
|
||||
// check value of TWI Status Register. Mask prescaler bits
|
||||
twst = TW_STATUS & 0xF8;
|
||||
if( twst != TW_MT_DATA_ACK) return 1;
|
||||
return 0;
|
||||
|
||||
}/* i2c_write */
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
Read one byte from the I2C device, request more data from device
|
||||
|
||||
Return: byte read from I2C device
|
||||
*************************************************************************/
|
||||
unsigned char i2c_readAck(void)
|
||||
{
|
||||
TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWEA);
|
||||
while(!(TWCR & (1<<TWINT)));
|
||||
|
||||
return TWDR;
|
||||
|
||||
}/* i2c_readAck */
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
Read one byte from the I2C device, read is followed by a stop condition
|
||||
|
||||
Return: byte read from I2C device
|
||||
*************************************************************************/
|
||||
unsigned char i2c_readNak(void)
|
||||
{
|
||||
TWCR = (1<<TWINT) | (1<<TWEN);
|
||||
while(!(TWCR & (1<<TWINT)));
|
||||
|
||||
return TWDR;
|
||||
|
||||
}/* i2c_readNak */
|
@ -1,25 +0,0 @@
|
||||
Overview
|
||||
========
|
||||
|
||||
This is my personal Numpad (Woodpad) configuration, and my daily driver.
|
||||
|
||||
Most of the code resides in my userspace, rather than here, as I have multiple keyboards.
|
||||
|
||||
How to build
|
||||
------------
|
||||
make handwired/woodpad:drashna:avrdude
|
||||
|
||||
Layers
|
||||
------
|
||||
* NUMLOCK: Num pad, locked to NUM LOCK enabled.
|
||||
* NAV: Navigation codes without needing to enable numlock.
|
||||
* DIABLO: This contains a Diablo 3 layout, that requires much less reaching or shifting. If Tap Dance is enabled, then it has a "spam" feature. See Userspace for details.
|
||||
* MACROS: This layer contains a bunch of macros for spamming chat, with a toggle on what key to open up chat with.
|
||||
* MEDIA: Media and RGB commands
|
||||
|
||||
All layers have RGB specific indicators, so you can see what layer you're on by the underglow.
|
||||
|
||||
Woodpad Specific Code
|
||||
---------------------
|
||||
|
||||
Aside from my userspace code, this includes LED indications for numlock and macro mode. It also forces NUMLOCK to be enabled.
|
@ -1,95 +0,0 @@
|
||||
/* Copyright 2017 REPLACE_WITH_YOUR_NAME
|
||||
*
|
||||
* 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
|
||||
#include "drashna.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.
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[_NUMLOCK] = KEYMAP( /* Base */
|
||||
TG(_NAV), TG(_DIABLO), TG(_MACROS), KC_PSLS,\
|
||||
KC_P7, KC_P8, KC_P9, KC_PAST, \
|
||||
KC_P4, KC_P5, KC_P6, KC_PMNS, \
|
||||
KC_P1, KC_P2, KC_P3, KC_PPLS, \
|
||||
LT(_MEDIA,KC_P0), KC_PDOT, KC_COLN, KC_PENT \
|
||||
),
|
||||
[_NAV] = KEYMAP( /* Base */
|
||||
_______, _______, _______, _______,\
|
||||
KC_HOME, KC_UP, KC_PGUP, _______, \
|
||||
KC_LEFT, XXXXXXX, KC_RIGHT, _______, \
|
||||
KC_END, KC_DOWN, KC_PGDN, _______, \
|
||||
KC_INS, KC_DEL, _______, _______ \
|
||||
),
|
||||
[_DIABLO] = KEYMAP( /* Base */
|
||||
KC_ESC, _______, XXXXXXX, _______,\
|
||||
KC_S, KC_I, KC_F, KC_M, \
|
||||
KC_1, KC_2, KC_3, KC_4, \
|
||||
KC_D3_1, KC_D3_2, KC_D3_3, KC_D3_4, \
|
||||
XXXXXXX, KC_DIABLO_CLEAR, KC_Q, SFT_T(KC_SPACE) \
|
||||
),
|
||||
|
||||
[_MACROS] = KEYMAP( /* Base */
|
||||
KC_OVERWATCH, XXXXXXX, _______, XXXXXXX,\
|
||||
KC_JUSTGAME, XXXXXXX, XXXXXXX, KC_C9, \
|
||||
XXXXXXX, XXXXXXX, KC_AIM, KC_GGEZ, \
|
||||
KC_SYMM, KC_TORB, XXXXXXX, KC_GOODGAME, \
|
||||
KC_SALT, KC_MORESALT, KC_SALTHARD, KC_GLHF \
|
||||
),
|
||||
[_MEDIA] = KEYMAP( /* Base */
|
||||
KC_RESET, KC_MUTE, KC_VOLD, KC_VOLU,\
|
||||
KC_MAKE, _______, RGB_HUI, RGB_HUD, \
|
||||
KC_MPLY, KC_MSTP, KC_MPRV, KC_MNXT, \
|
||||
RGB_TOG, RGB_MOD, RGB_SAI, RGB_VAI, \
|
||||
_______, KC_RGB_T, RGB_SAD, RGB_VAD \
|
||||
),
|
||||
|
||||
};
|
||||
|
||||
|
||||
void numlock_led_on(void) {
|
||||
PORTF |= (1 << 7);
|
||||
}
|
||||
|
||||
void numlock_led_off(void) {
|
||||
PORTF &= ~(1 << 7);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void matrix_init_keymap(void) {
|
||||
// set Numlock LED to output and low
|
||||
DDRF |= (1 << 7);
|
||||
PORTF &= ~(1 << 7);
|
||||
}
|
||||
|
||||
void matrix_scan_keymap(void) {
|
||||
numlock_led_off();
|
||||
if ((is_overwatch && biton32(layer_state) == _MACROS) || (biton32(layer_state) == _NUMLOCK)) {
|
||||
numlock_led_on();
|
||||
}
|
||||
|
||||
// Run Diablo 3 macro checking code.
|
||||
}
|
||||
|
||||
void led_set_keymap(uint8_t usb_led) {
|
||||
if (!(usb_led & (1<<USB_LED_NUM_LOCK))) {
|
||||
register_code(KC_NUMLOCK);
|
||||
unregister_code(KC_NUMLOCK);
|
||||
}
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
TAP_DANCE_ENABLE = yes
|
||||
COMMAND_ENABLE = no # Commands for debug and configuration
|
||||
RGBLIGHT_ENABLE = yes
|
||||
MIDI_ENABLE = no
|
||||
CONSOLE_ENABLE = no
|
||||
NKRO_ENABLE = yes
|
||||
MOUSEKEY_ENABLE = no
|
||||
|
||||
EXTRAFLAGS = -flto
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "quantum.h"
|
||||
#include "command.h"
|
||||
#include "action_pseudo_lut.h"
|
||||
|
||||
static uint8_t send_key_shift_bit[SHIFT_BIT_SIZE];
|
||||
|
42
keyboards/keebio/bfo9000/keymaps/insertsnideremarks/config.h
Normal file
42
keyboards/keebio/bfo9000/keymaps/insertsnideremarks/config.h
Normal file
@ -0,0 +1,42 @@
|
||||
/*
|
||||
This is the c configuration file for the keymap
|
||||
|
||||
Copyright 2012 Jun Wako <wakojun@gmail.com>
|
||||
Copyright 2015 Jack Humbert
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
/* Use I2C or Serial, not both */
|
||||
|
||||
// #define USE_SERIAL
|
||||
#define USE_I2C
|
||||
|
||||
/* Select hand configuration */
|
||||
// #define MASTER_LEFT
|
||||
// #define MASTER_RIGHT
|
||||
#define EE_HANDS
|
||||
|
||||
#define IGNORE_MOD_TAP_INTERRUPT
|
||||
#define TAPPING_TERM 150
|
||||
#define TAPPING_TOGGLE 2
|
||||
|
||||
// #undef RGBLED_NUM
|
||||
// #define RGBLIGHT_ANIMATIONS
|
||||
// #define RGBLED_NUM 12
|
||||
// #define RGBLIGHT_HUE_STEP 8
|
||||
// #define RGBLIGHT_SAT_STEP 8
|
||||
// #define RGBLIGHT_VAL_STEP 8
|
381
keyboards/keebio/bfo9000/keymaps/insertsnideremarks/keymap.c
Normal file
381
keyboards/keebio/bfo9000/keymaps/insertsnideremarks/keymap.c
Normal file
@ -0,0 +1,381 @@
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
extern keymap_config_t keymap_config;
|
||||
|
||||
enum bfo9000_layers {
|
||||
_COLEMAK, // Colemak (default layer)
|
||||
_QWERTY, // Qwerty
|
||||
_COLEMAKGM, // Colemak gaming/vanilla (limited dual-role keys with layer access)
|
||||
_QWERTYGM, // QWERTY gaming/vanilla (limited dual-role keys with layer access)
|
||||
_NUMBERS, // Numbers & Symbols
|
||||
_NUMBERS2, // Numbers & Symbols 2 (identical as _NUMBERS; basically used for tri-layer access to _ADJUST)
|
||||
_FUNCTION, // Function
|
||||
_FUNCTION2, // Function 2 (identical as _FUNCTION; used to allow for easier use of space and backspace while using function layer arrows)
|
||||
_NUMPAD, // Numpad
|
||||
_ADJUST, // Adjust layer (accessed via tri-layer feature)
|
||||
_ADJUST2 // Second Adjust layer (accessed outside of tri-layer feature)
|
||||
};
|
||||
|
||||
enum bfo9000_keycodes {
|
||||
COLEMAK = SAFE_RANGE,
|
||||
QWERTY,
|
||||
COLEMAKGM,
|
||||
QWERTYGM,
|
||||
NUMPAD = TG(_NUMPAD),
|
||||
ADJUST = MO(_ADJUST2),
|
||||
SPCFN = LT(_FUNCTION, KC_SPC),
|
||||
BSPCFN = LT(_FUNCTION2, KC_BSPC),
|
||||
ENTNS = LT(_NUMBERS, KC_ENT),
|
||||
DELNS = LT(_NUMBERS2, KC_DEL),
|
||||
CTLESC = CTL_T(KC_ESC),
|
||||
ALTAPP = ALT_T(KC_APP),
|
||||
NKROTG = MAGIC_TOGGLE_NKRO
|
||||
};
|
||||
|
||||
//Tap Dance Declarations
|
||||
enum {
|
||||
ADJ = 0,
|
||||
LBCB,
|
||||
RBCB,
|
||||
EQPL,
|
||||
PLEQ,
|
||||
MNUN,
|
||||
SLAS,
|
||||
GVTL,
|
||||
PPLEQ,
|
||||
PMNUN,
|
||||
PSLPAS
|
||||
};
|
||||
|
||||
void dance_LAYER_finished(qk_tap_dance_state_t *state, void *user_data) {
|
||||
if (state->count == 2) {
|
||||
layer_on(_ADJUST2);
|
||||
set_oneshot_layer(_ADJUST2, ONESHOT_START);
|
||||
}
|
||||
}
|
||||
void dance_LAYER_reset(qk_tap_dance_state_t *state, void *user_data) {
|
||||
if (state->count == 2) {
|
||||
layer_off(_ADJUST2);
|
||||
clear_oneshot_layer_state(ONESHOT_PRESSED);
|
||||
}
|
||||
}
|
||||
|
||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
||||
[ADJ] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_LAYER_finished, dance_LAYER_reset), // Double-tap to activate Adjust layer via oneshot layer
|
||||
[LBCB] = ACTION_TAP_DANCE_DOUBLE(KC_LBRC, KC_LCBR), // Left bracket on a single-tap, left brace on a double-tap
|
||||
[RBCB] = ACTION_TAP_DANCE_DOUBLE(KC_RBRC, KC_RCBR), // Right bracket on a single-tap, right brace on a double-tap
|
||||
[EQPL] = ACTION_TAP_DANCE_DOUBLE(KC_EQL, KC_PLUS), // Plus sign on a single-tap, equal sign on a double-tap
|
||||
[PLEQ] = ACTION_TAP_DANCE_DOUBLE(KC_PLUS, KC_EQL), // Equal sign on a single-tap, plus sign on a double-tap
|
||||
[MNUN] = ACTION_TAP_DANCE_DOUBLE(KC_MINS, KC_UNDS), // Minus sign on a single-tap, underscore on a double-tap
|
||||
[SLAS] = ACTION_TAP_DANCE_DOUBLE(KC_SLSH, KC_ASTR), // Slash in a single-tap, asterisk in a double-tap
|
||||
[GVTL] = ACTION_TAP_DANCE_DOUBLE(KC_GRV, KC_TILD), // Grave on a single-tap, tilde on a double-tap
|
||||
[PPLEQ] = ACTION_TAP_DANCE_DOUBLE(KC_PPLS, KC_EQL), // Numpad plus sign on a single-tap, equal sign on a double-tap
|
||||
[PMNUN] = ACTION_TAP_DANCE_DOUBLE(KC_PMNS, KC_UNDS), // Numpad minus sign on a single-tap, underscore on a double-tap
|
||||
[PSLPAS] = ACTION_TAP_DANCE_DOUBLE(KC_PSLS, KC_PAST) // Numpad slash on a single-tap, numpad asterisk on a double-tap
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* Colemak
|
||||
(Default layer; keys separated by /: tap for first, hold for second; uses Space Cadet Shifts)
|
||||
,-----------------------------------------------------------------------. ,-----------------------------------------------------------------------.
|
||||
| ESC | F1 | F2 | F3 | F4 | F5 | | | | | Adjust| | F12 | F6 | F7 | F8 | F9 | F10 | F11 |
|
||||
|-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------|
|
||||
| = | 1 | 2 | 3 | 4 | 5 | | | | | Numpad| | | 6 | 7 | 8 | 9 | 0 | - |
|
||||
|-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------|
|
||||
| Tab | Q | W | F | P | G | | | Home | | Pause | | | J | L | U | Y | ; | \ |
|
||||
|-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------|
|
||||
|Esc/Ctl| A | R | S | T | D | | | PgUp | | ScrLck| | | H | N | E | I | O | ' |
|
||||
|-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------|
|
||||
|SCShift| Z | X | C | V | B |Esc/Ctl|App/Alt| PgDn | | PrtScr| RAlt | RCtl | K | M | , | . | / |SCShift|
|
||||
|-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------|
|
||||
| Ins | ` | [ | ] |App/Alt| Spc/Fn| Ent/NS| Bspc | End | | | Enter |Del/NS2|Bsp/Fn2| RGUI | Left | Down | Up | Right |
|
||||
`-----------------------------------------------------------------------' `-----------------------------------------------------------------------'
|
||||
*/
|
||||
[_COLEMAK] = LAYOUT( \
|
||||
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, _______, ADJUST, _______, KC_F12, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
|
||||
KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, _______, _______, _______, NUMPAD, _______, _______, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,
|
||||
KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, _______, _______, KC_HOME, KC_PAUS, _______, _______, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSLS,
|
||||
CTLESC, KC_A, KC_R, KC_S, KC_T, KC_D, _______, _______, KC_PGUP, KC_SLCK, _______, _______, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT,
|
||||
KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, CTLESC, ALTAPP, KC_PGDN, KC_PSCR, KC_RALT, KC_RCTL, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC,
|
||||
KC_INS, KC_GRV, KC_LBRC, KC_RBRC, ALTAPP, SPCFN, ENTNS, KC_BSPC, KC_END, _______, KC_ENT, DELNS, BSPCFN, KC_RGUI, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
|
||||
),
|
||||
|
||||
/* QWERTY
|
||||
(Keys separated by /: tap for first, hold for second; uses Space Cadet Shifts)
|
||||
,-----------------------------------------------------------------------. ,-----------------------------------------------------------------------.
|
||||
| ESC | F1 | F2 | F3 | F4 | F5 | | | | | Adjust| | F12 | F6 | F7 | F8 | F9 | F10 | F11 |
|
||||
|-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------|
|
||||
| = | 1 | 2 | 3 | 4 | 5 | | | | | Numpad| | | 6 | 7 | 8 | 9 | 0 | - |
|
||||
|-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------|
|
||||
| Tab | Q | W | E | R | T | | | Home | | Pause | | | Y | U | I | O | P | \ |
|
||||
|-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------|
|
||||
|Esc/Ctl| A | S | D | F | G | | | PgUp | | ScrLck| | | H | J | K | L | ; | ' |
|
||||
|-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------|
|
||||
|SCShift| Z | X | C | V | B |Esc/Ctl|App/Alt| PgDn | | PrtScr| RAlt | RCtl | N | M | , | . | / |SCShift|
|
||||
|-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------|
|
||||
| Ins | ` | [ | ] |App/Alt| Spc/Fn| Ent/NS| Bspc | End | | | Enter |Del/NS2|Bsp/Fn2| RGUI | Left | Down | Up | Right |
|
||||
`-----------------------------------------------------------------------' `-----------------------------------------------------------------------'
|
||||
*/
|
||||
[_QWERTY] = LAYOUT( \
|
||||
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, ADJUST, _______, KC_F12, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
|
||||
KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, NUMPAD, _______, _______, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_HOME, KC_PAUS, _______, _______, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS,
|
||||
CTLESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_PGUP, KC_SLCK, _______, _______, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
|
||||
KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, CTLESC, ALTAPP, KC_PGDN, KC_PSCR, KC_RALT, KC_RCTL, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC,
|
||||
KC_INS, KC_GRV, KC_LBRC, KC_RBRC, ALTAPP, SPCFN, ENTNS, KC_BSPC, KC_END, _______, KC_ENT, DELNS, BSPCFN, KC_RGUI, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
|
||||
),
|
||||
|
||||
/* Numbers/Symbols layer
|
||||
(Multiple characters: single-tap for first, double-tap for second)
|
||||
,-----------------------------------------------------------------------. ,-----------------------------------------------------------------------.
|
||||
| | | | | | | | | | | | | | | | | | | |
|
||||
|-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------|
|
||||
| F12 | F1 | F2 | F3 | F4 | F5 | | | | | | | | F6 | F7 | F8 | F9 | F10 | F12 |
|
||||
|-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------|
|
||||
| | 6 | 7 | 8 | 9 | 0 | | | | | | | | ^ | & | * | ( | ) | |
|
||||
|-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------|
|
||||
| | 1 | 2 | 3 | 4 | 5 | | | | | | | | ! | @ | # | $ | % | |
|
||||
|-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------|
|
||||
| | | . | / * | - _ | + = | | | | | | | | ` ~ | [ { | ] } | | | |
|
||||
|-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------|
|
||||
| ( | ) | [ { | ] } | | | | | | | | | | | | | | | |
|
||||
`-----------------------------------------------------------------------' `-----------------------------------------------------------------------'
|
||||
*/
|
||||
[_NUMBERS] = LAYOUT( \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
KC_F12, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, _______, _______, _______, _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
|
||||
_______, KC_6, KC_7, KC_8, KC_9, KC_0, _______, _______, _______, _______, _______, _______, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______,
|
||||
_______, KC_1, KC_2, KC_3, KC_4, KC_5, _______, _______, _______, _______, _______, _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______,
|
||||
_______, _______, KC_DOT, TD(SLAS), TD(MNUN), TD(PLEQ), _______, _______, _______, _______, _______, _______, TD(GVTL), TD(LBCB), TD(RBCB), _______, _______, _______,
|
||||
KC_LPRN, KC_RPRN, TD(LBCB), TD(RBCB), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
),
|
||||
|
||||
[_NUMBERS2] = LAYOUT( \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
KC_F12, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, _______, _______, _______, _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
|
||||
_______, KC_6, KC_7, KC_8, KC_9, KC_0, _______, _______, _______, _______, _______, _______, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______,
|
||||
_______, KC_1, KC_2, KC_3, KC_4, KC_5, _______, _______, _______, _______, _______, _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______,
|
||||
_______, _______, KC_DOT, TD(SLAS), TD(MNUN), TD(PLEQ), _______, _______, _______, _______, _______, _______, TD(GVTL), TD(LBCB), TD(RBCB), _______, _______, _______,
|
||||
KC_LPRN, KC_RPRN, TD(LBCB), TD(RBCB), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
),
|
||||
|
||||
/* Function layer
|
||||
,-----------------------------------------------------------------------. ,-----------------------------------------------------------------------.
|
||||
| | | | | | | | | | | | | | | | | | | |
|
||||
|-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------|
|
||||
| F12 | F1 | F2 | F3 | F4 | F5 | | | | | | | | F6 | F7 | F8 | F9 | F10 | F12 |
|
||||
|-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------|
|
||||
| | | | Up | | | | | | | | | | | | Up | Ctrl+Y| | |
|
||||
|-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------|
|
||||
| | Ctrl+A| Left | Down | Right | C+A+Tb| | | | | | | | PgUp | Right | Down | Left | Home | |
|
||||
|-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------|
|
||||
| | Ctrl+Z| Ctrl+X| Ctrl+C| Ctrl+V| Bspc | | | | | | | | PgDn | Mute | Vol- | Vol+ | End | |
|
||||
|-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------|
|
||||
| | | | | | | | | | | | | | | | Prev | Play | Next | Stop |
|
||||
`-----------------------------------------------------------------------' `-----------------------------------------------------------------------'
|
||||
*/
|
||||
[_FUNCTION] = LAYOUT(
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
KC_F12, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, _______, _______, _______, _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
|
||||
_______, _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_UP, LCTL(KC_Y), _______, _______,
|
||||
_______, LCTL(KC_A), KC_LEFT, KC_DOWN, KC_RGHT, LCA(KC_TAB), _______, _______, _______, _______, _______, _______, KC_PGUP, KC_LEFT, KC_DOWN, KC_RGHT, KC_HOME, _______,
|
||||
_______, LCTL(KC_Z), LCTL(KC_X), LCTL(KC_C), LCTL(KC_V), KC_BSPC, _______, _______, _______, _______, _______, _______, KC_PGDN, KC_MUTE, KC_VOLD, KC_VOLU, KC_END, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, KC_MSTP
|
||||
),
|
||||
|
||||
[_FUNCTION2] = LAYOUT(
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
KC_F12, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, _______, _______, _______, _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
|
||||
_______, _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_UP, LCTL(KC_Y), _______, _______,
|
||||
_______, LCTL(KC_A), KC_LEFT, KC_DOWN, KC_RGHT, LCA(KC_TAB), _______, _______, _______, _______, _______, _______, KC_PGUP, KC_LEFT, KC_DOWN, KC_RGHT, KC_HOME, _______,
|
||||
_______, LCTL(KC_Z), LCTL(KC_X), LCTL(KC_C), LCTL(KC_V), KC_BSPC, _______, _______, _______, _______, _______, _______, KC_PGDN, KC_MUTE, KC_VOLD, KC_VOLU, KC_END, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, KC_MSTP
|
||||
),
|
||||
|
||||
/* Numpad layer
|
||||
(Left side duplicates layout from the Numbers layer, just with numpad output; right side layout close to PC numpad layout)
|
||||
,-----------------------------------------------------------------------. ,-----------------------------------------------------------------------.
|
||||
| | | | | | | | | | | | | | | | | | | |
|
||||
|-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------|
|
||||
| | NumLk | | | | | | | | | | | Tab | NumLk | KP / | KP * | KP - | | |
|
||||
|-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------|
|
||||
| | KP 6 | KP 7 | KP 8 | KP 9 | KP 0 | | | | | | | | KP 7 | KP 8 | KP 9 | KP + | | |
|
||||
|-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------|
|
||||
| | KP 1 | KP 2 | KP 3 | KP 4 | KP 5 | | | | | | | | KP 4 | KP 5 | KP 6 | = | | |
|
||||
|-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------|
|
||||
| | | KP . |KP/ KP*| KP- _ | KP+ = | | | | | | | | KP 1 | KP 2 | KP 3 | KP Ent| | |
|
||||
|-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------|
|
||||
| ( | ) | [ { | ] } | | | | | | | | | | | KP 0 | KP . | KP Ent| | |
|
||||
`-----------------------------------------------------------------------' `-----------------------------------------------------------------------'
|
||||
*/
|
||||
[_NUMPAD] = LAYOUT( \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, KC_NLCK, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_TAB, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, _______,
|
||||
_______, KC_P6, KC_P7, KC_P8, KC_P9, KC_P0, _______, _______, _______, _______, _______, _______, _______, KC_P7, KC_P8, KC_P9, KC_PPLS, _______,
|
||||
_______, KC_P1, KC_P2, KC_P3, KC_P4, KC_P5, _______, _______, _______, _______, _______, _______, _______, KC_P4, KC_P5, KC_P6, KC_EQL, _______,
|
||||
_______, _______, KC_PDOT, TD(PSLPAS), TD(PMNUN), TD(PPLEQ), _______, _______, _______, _______, _______, _______, _______, KC_P1, KC_P2, KC_P3, KC_PENT, _______,
|
||||
KC_LPRN, KC_RPRN, TD(LBCB), TD(RBCB), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_P0, KC_PDOT, KC_PENT, _______
|
||||
),
|
||||
|
||||
/* Colemak gaming/vanilla
|
||||
(Limited access to Function or Numbers layers; mainly used for gaming; Ent/NS + Del/NS2 on right side to access Adjust layer)
|
||||
,-----------------------------------------------------------------------. ,-----------------------------------------------------------------------.
|
||||
| ESC | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | | Adjust| | F12 | F6 | F7 | F8 | F9 | F10 | F11 |
|
||||
|-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------|
|
||||
| = | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | | Numpad| | | 6 | 7 | 8 | 9 | 0 | - |
|
||||
|-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------|
|
||||
| Tab | Q | W | F | P | G | J | L | Home | | Pause | | | J | L | U | Y | ; | \ |
|
||||
|-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------|
|
||||
| LCtl | A | R | S | T | D | H | N | PgUp | | ScrLck| | | H | N | E | I | O | ' |
|
||||
|-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------|
|
||||
| Shift | Z | X | C | V | B | Esc | LAlt | PgDn | | PrtScr| RAlt | RCtl | K | M | , | . | / | Shift |
|
||||
|-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------|
|
||||
| Ins | ` | [ | ] | LAlt | Space | Enter | Bspc | End | | | Ent/NS|Del/NS2|Bsp/Fn2| RGUI | Left | Down | Up | Right |
|
||||
`-----------------------------------------------------------------------' `-----------------------------------------------------------------------'
|
||||
*/
|
||||
[_COLEMAKGM] = LAYOUT( \
|
||||
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, ADJUST, _______, KC_F12, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
|
||||
KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, NUMPAD, _______, _______, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,
|
||||
KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_HOME, KC_PAUS, _______, _______, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSLS,
|
||||
KC_LCTL, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_PGUP, KC_SLCK, _______, _______, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT,
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_ESC, KC_LALT, KC_PGDN, KC_PSCR, KC_RALT, KC_RCTL, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
|
||||
KC_INS, KC_GRV, KC_LBRC, KC_RBRC, KC_LALT, KC_SPC, KC_ENT, KC_BSPC, KC_END, _______, ENTNS, DELNS, BSPCFN, KC_RGUI, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
|
||||
),
|
||||
|
||||
/* QWERTY gaming/vanilla
|
||||
(Limited access to Function or Numbers layers; mainly used for gaming; Ent/NS + Del/NS2 on right side to access Adjust layer)
|
||||
,-----------------------------------------------------------------------. ,-----------------------------------------------------------------------.
|
||||
| ESC | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | | Adjust| | F12 | F6 | F7 | F8 | F9 | F10 | F11 |
|
||||
|-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------|
|
||||
| = | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | | Numpad| | | 6 | 7 | 8 | 9 | 0 | - |
|
||||
|-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------|
|
||||
| Tab | Q | W | E | T | Y | U | I | Home | | Pause | | | Y | U | I | O | P | \ |
|
||||
|-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------|
|
||||
| LCtl | A | S | D | F | G | H | J | PgUp | | ScrLck| | | H | J | K | L | ; | ' |
|
||||
|-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------|
|
||||
| Shift | Z | X | C | V | B | Esc | LAlt | PgDn | | PrtScr| RAlt | RCtl | N | M | , | . | / | Shift |
|
||||
|-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------|
|
||||
| Ins | ` | [ | ] | LAlt | Space | Enter | Bspc | End | | | Ent/NS|Del/NS2|Bsp/Fn2| RGUI | Left | Down | Up | Right |
|
||||
`-----------------------------------------------------------------------' `-----------------------------------------------------------------------'
|
||||
*/
|
||||
[_QWERTYGM] = LAYOUT( \
|
||||
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, ADJUST, _______, KC_F12, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
|
||||
KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, NUMPAD, _______, _______, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_HOME, KC_PAUS, _______, _______, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS,
|
||||
KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_PGUP, KC_SLCK, _______, _______, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_ESC, KC_LALT, KC_PGDN, KC_PSCR, KC_RALT, KC_RCTL, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
|
||||
KC_INS, KC_GRV, KC_LBRC, KC_RBRC, KC_LALT, KC_SPC, KC_ENT, KC_BSPC, KC_END, _______, ENTNS, DELNS, BSPCFN, KC_RGUI, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
|
||||
),
|
||||
|
||||
/* Adjust layer
|
||||
(Enter/Number + Delete/Number2 under non-gaming/vanilla layers or press & hold Adjust key on function row; Numpad is a toggle)
|
||||
,-----------------------------------------------------------------------. ,-----------------------------------------------------------------------.
|
||||
| | | | | | | | | | | | | | | | | | | |
|
||||
|-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------|
|
||||
| |Colemak| Qwerty| |ColmkGM| QWGM | | | | | | | | Numpad| | | | | RESET |
|
||||
|-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------|
|
||||
| | | | | | | | | | | | | | | | | | | |
|
||||
|-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------|
|
||||
| | | | | | | | | | | | | | | NKROTG| | | | |
|
||||
|-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------|
|
||||
| | | | | | | | | | | | | | | | | | | |
|
||||
|-------+-------+-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------+-------+-------|
|
||||
| | | | | | | | | | | | | | | | | | | |
|
||||
`-----------------------------------------------------------------------' `-----------------------------------------------------------------------'
|
||||
*/
|
||||
[_ADJUST] = LAYOUT(
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, COLEMAK, QWERTY, _______, COLEMAKGM, QWERTYGM, _______, _______, _______, _______, _______, _______, NUMPAD, _______, _______, _______, _______, RESET,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, NKROTG, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
),
|
||||
|
||||
[_ADJUST2] = LAYOUT(
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, COLEMAK, QWERTY, _______, COLEMAKGM, QWERTYGM, _______, _______, _______, _______, _______, _______, NUMPAD, _______, _______, _______, _______, RESET,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, NKROTG, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
)
|
||||
|
||||
};
|
||||
|
||||
|
||||
uint32_t layer_state_set_user(uint32_t state) {
|
||||
return update_tri_layer_state(state, _NUMBERS, _NUMBERS2, _ADJUST);
|
||||
}
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
switch (keycode) {
|
||||
case COLEMAK:
|
||||
if (record->event.pressed) {
|
||||
default_layer_set(1UL << _COLEMAK);
|
||||
// persistent_default_layer_set(1UL << _COLEMAK);
|
||||
layer_off ( _QWERTY);
|
||||
layer_off ( _NUMBERS);
|
||||
layer_off ( _NUMBERS2);
|
||||
layer_off ( _FUNCTION);
|
||||
layer_off ( _FUNCTION2);
|
||||
layer_off ( _NUMPAD);
|
||||
layer_off ( _COLEMAKGM);
|
||||
layer_off ( _QWERTYGM);
|
||||
layer_off ( _ADJUST);
|
||||
layer_off ( _ADJUST2);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case QWERTY:
|
||||
if (record->event.pressed) {
|
||||
default_layer_set(1UL << _QWERTY);
|
||||
// persistent_default_layer_set(1UL << _QWERTY);
|
||||
layer_off ( _COLEMAK);
|
||||
layer_off ( _NUMBERS);
|
||||
layer_off ( _NUMBERS2);
|
||||
layer_off ( _FUNCTION);
|
||||
layer_off ( _FUNCTION2);
|
||||
layer_off ( _NUMPAD);
|
||||
layer_off ( _COLEMAKGM);
|
||||
layer_off ( _QWERTYGM);
|
||||
layer_off ( _ADJUST);
|
||||
layer_off ( _ADJUST2);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case COLEMAKGM:
|
||||
if (record->event.pressed) {
|
||||
default_layer_set(1UL << _COLEMAKGM);
|
||||
layer_off ( _QWERTY);
|
||||
layer_off ( _COLEMAK);
|
||||
layer_off ( _NUMBERS);
|
||||
layer_off ( _NUMBERS2);
|
||||
layer_off ( _FUNCTION);
|
||||
layer_off ( _FUNCTION2);
|
||||
layer_off ( _NUMPAD);
|
||||
layer_off ( _QWERTYGM);
|
||||
layer_off ( _ADJUST);
|
||||
layer_off ( _ADJUST2);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case QWERTYGM:
|
||||
if (record->event.pressed) {
|
||||
default_layer_set(1UL << _QWERTYGM);
|
||||
layer_off ( _QWERTY);
|
||||
layer_off ( _COLEMAK);
|
||||
layer_off ( _NUMBERS);
|
||||
layer_off ( _NUMBERS2);
|
||||
layer_off ( _FUNCTION);
|
||||
layer_off ( _FUNCTION2);
|
||||
layer_off ( _NUMPAD);
|
||||
layer_off ( _COLEMAKGM);
|
||||
layer_off ( _ADJUST);
|
||||
layer_off ( _ADJUST2);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
19
keyboards/keebio/bfo9000/keymaps/insertsnideremarks/rules.mk
Normal file
19
keyboards/keebio/bfo9000/keymaps/insertsnideremarks/rules.mk
Normal file
@ -0,0 +1,19 @@
|
||||
# Build Options
|
||||
# change to "no" to disable the options, or define them in the Makefile in
|
||||
# the appropriate keymap folder that will get included automatically
|
||||
#
|
||||
|
||||
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE = yes # Console for debug(+400)
|
||||
COMMAND_ENABLE = no # Commands for debug and configuration
|
||||
NKRO_ENABLE = yes # 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
|
||||
MIDI_ENABLE = no # MIDI controls
|
||||
AUDIO_ENABLE = no # Audio output on port C6
|
||||
UNICODE_ENABLE = yes # Unicode
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
|
||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||
TAP_DANCE_ENABLE = yes # Enable Tap Dancing function
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user