Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
90f9fb4eee | ||
|
|
77ed9e3a73 | ||
|
|
faef966a4d | ||
|
|
a054b5a06c | ||
|
|
952a30ef34 | ||
|
|
bada74e2a1 | ||
|
|
ecd21b44a8 | ||
|
|
edb6c98fd2 | ||
|
|
b7b20cd9df | ||
|
|
b91dfa04e3 | ||
|
|
fe68599a34 | ||
|
|
4ebd27002a | ||
|
|
f3ffd6ad50 | ||
|
|
0031e46191 | ||
|
|
97ab3211e2 | ||
|
|
8bc19c8dcf | ||
|
|
6266c172b9 | ||
|
|
ccd4da941c | ||
|
|
834b555eca | ||
|
|
d7ab738ca6 | ||
|
|
f0db40ff11 | ||
|
|
3363743bf7 | ||
|
|
7bc7c34d4f | ||
|
|
ee8627e078 | ||
|
|
3dd6d53942 | ||
|
|
2943d19ecd | ||
|
|
48262bdce0 | ||
|
|
b7dd415c97 | ||
|
|
87f06e7297 | ||
|
|
2f34252278 | ||
|
|
8837b9d99e | ||
|
|
1485098443 | ||
|
|
303fa4ec33 | ||
|
|
93c0362552 | ||
|
|
ad91454574 | ||
|
|
385de70e4d | ||
|
|
26156e84e8 | ||
|
|
f03fd95000 | ||
|
|
9e0f68a652 | ||
|
|
e0690096f8 | ||
|
|
4d66df5091 | ||
|
|
223b3d2be7 | ||
|
|
bdd41715af | ||
|
|
504bf11769 | ||
|
|
de173e344e | ||
|
|
31298be2b1 | ||
|
|
9ee2991c3d | ||
|
|
667e0962eb | ||
|
|
d9453a93f3 | ||
|
|
774bee6426 | ||
|
|
defcfb4953 | ||
|
|
b49f37dce9 | ||
|
|
09813793be | ||
|
|
39bd760faf | ||
|
|
46cf8cc9b3 | ||
|
|
daf08f40f2 | ||
|
|
d8f090e559 | ||
|
|
a034602651 |
No files matched your search
@@ -39,6 +39,7 @@
|
|||||||
* [Glossary](reference_glossary.md)
|
* [Glossary](reference_glossary.md)
|
||||||
* [Unit Testing](unit_testing.md)
|
* [Unit Testing](unit_testing.md)
|
||||||
* [Useful Functions](ref_functions.md)
|
* [Useful Functions](ref_functions.md)
|
||||||
|
* [Configurator Support](reference_configurator_support.md)
|
||||||
|
|
||||||
* [Features](features.md)
|
* [Features](features.md)
|
||||||
* [Basic Keycodes](keycodes_basic.md)
|
* [Basic Keycodes](keycodes_basic.md)
|
||||||
|
|||||||
@@ -39,6 +39,7 @@
|
|||||||
* [Glossary](reference_glossary.md)
|
* [Glossary](reference_glossary.md)
|
||||||
* [Unit Testing](unit_testing.md)
|
* [Unit Testing](unit_testing.md)
|
||||||
* [Useful Functions](ref_functions.md)
|
* [Useful Functions](ref_functions.md)
|
||||||
|
* [Configurator Support](reference_configurator_support.md)
|
||||||
|
|
||||||
* [Features](features.md)
|
* [Features](features.md)
|
||||||
* [Basic Keycodes](keycodes_basic.md)
|
* [Basic Keycodes](keycodes_basic.md)
|
||||||
|
|||||||
@@ -261,3 +261,32 @@ Use these to enable or disable building certain features. The more you have enab
|
|||||||
* Forces the keyboard to wait for a USB connection to be established before it starts up
|
* Forces the keyboard to wait for a USB connection to be established before it starts up
|
||||||
* `NO_USB_STARTUP_CHECK`
|
* `NO_USB_STARTUP_CHECK`
|
||||||
* Disables usb suspend check after keyboard startup. Usually the keyboard waits for the host to wake it up before any tasks are performed. This is useful for split keyboards as one half will not get a wakeup call but must send commands to the master.
|
* Disables usb suspend check after keyboard startup. Usually the keyboard waits for the host to wake it up before any tasks are performed. This is useful for split keyboards as one half will not get a wakeup call but must send commands to the master.
|
||||||
|
|
||||||
|
## USB Endpoint Limitations
|
||||||
|
|
||||||
|
In order to provide services over USB, QMK has to use USB endpoints.
|
||||||
|
These are a finite resource: each microcontroller has only a certain number.
|
||||||
|
This limits what features can be enabled together.
|
||||||
|
If the available endpoints are exceeded, a build error is thrown.
|
||||||
|
|
||||||
|
The following features can require separate endpoints:
|
||||||
|
|
||||||
|
* `MOUSEKEY_ENABLE`
|
||||||
|
* `EXTRAKEY_ENABLE`
|
||||||
|
* `CONSOLE_ENABLE`
|
||||||
|
* `NKRO_ENABLE`
|
||||||
|
* `MIDI_ENABLE`
|
||||||
|
* `RAW_ENABLE`
|
||||||
|
* `VIRTSER_ENABLE`
|
||||||
|
|
||||||
|
In order to improve utilisation of the endpoints, the HID features can be combined to use a single endpoint.
|
||||||
|
By default, `MOUSEKEY`, `EXTRAKEY`, and `NKRO` are combined into a single endpoint.
|
||||||
|
|
||||||
|
The base keyboard functionality can also be combined into the endpoint,
|
||||||
|
by setting `KEYBOARD_SHARED_EP = yes`.
|
||||||
|
This frees up one more endpoint,
|
||||||
|
but it can prevent the keyboard working in some BIOSes,
|
||||||
|
as they do not implement Boot Keyboard protocol switching.
|
||||||
|
|
||||||
|
Combining the mouse also breaks Boot Mouse compatibility.
|
||||||
|
The mouse can be uncombined by setting `MOUSE_SHARED_EP = no` if this functionality is required.
|
||||||
+2
-2
@@ -11,8 +11,8 @@ Keycodes are actually defined in [common/keycode.h](https://github.com/qmk/qmk_f
|
|||||||
|
|
||||||
There are 3 standard keyboard layouts in use around the world- ANSI, ISO, and JIS. North America primarily uses ANSI, Europe and Africa primarily use ISO, and Japan uses JIS. Regions not mentioned typically use either ANSI or ISO. The keycodes corresponding to these layouts are shown here:
|
There are 3 standard keyboard layouts in use around the world- ANSI, ISO, and JIS. North America primarily uses ANSI, Europe and Africa primarily use ISO, and Japan uses JIS. Regions not mentioned typically use either ANSI or ISO. The keycodes corresponding to these layouts are shown here:
|
||||||
|
|
||||||
<!-- Source for this image: http://www.keyboard-layout-editor.com/#/gists/070a530eedaed36a2d77f3f6fd455677 -->
|
<!-- Source for this image: http://www.keyboard-layout-editor.com/#/gists/bf431647d1001cff5eff20ae55621e9a -->
|
||||||

|

|
||||||
|
|
||||||
## Some Of My Keys Are Swapped Or Not Working
|
## Some Of My Keys Are Swapped Or Not Working
|
||||||
|
|
||||||
|
|||||||
@@ -150,6 +150,30 @@ These are the effects that are currently available:
|
|||||||
#endif
|
#endif
|
||||||
RGB_MATRIX_EFFECT_MAX
|
RGB_MATRIX_EFFECT_MAX
|
||||||
};
|
};
|
||||||
|
|
||||||
|
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_DUAL_BEACON` |Disables `RGB_MATRIX_DUAL_BEACON` |
|
||||||
|
|`#define DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN` |Disables `RGB_MATRIX_GRADIENT_UP_DOWN` |
|
||||||
|
|`#define DISABLE_RGB_MATRIX_RAINDROPS` |Disables `RGB_MATRIX_RAINDROPS` |
|
||||||
|
|`#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_BEACON` |Disables `RGB_MATRIX_RAINBOW_BEACON` |
|
||||||
|
|`#define DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS` |Disables `RGB_MATRIX_RAINBOW_PINWHEELS` |
|
||||||
|
|`#define DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON`|Disables `RGB_MATRIX_RAINBOW_MOVING_CHEVRON`|
|
||||||
|
|`#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_SPLASH` |Disables `RGB_MATRIX_SPLASH` |
|
||||||
|
|`#define DISABLE_RGB_MATRIX_MULTISPLASH` |Disables `RGB_MATRIX_MULTISPLASH` |
|
||||||
|
|`#define DISABLE_RGB_MATRIX_SOLID_SPLASH` |Disables `RGB_MATRIX_SOLID_SPLASH` |
|
||||||
|
|`#define DISABLE_RGB_MATRIX_SOLID_MULTISPLASH` |Disables `RGB_MATRIX_SOLID_MULTISPLASH` |
|
||||||
|
|
||||||
|
|
||||||
## Custom layer effects
|
## Custom layer effects
|
||||||
|
|
||||||
|
|||||||
+13
-12
@@ -206,18 +206,19 @@ This is a reference only. Each group of keys links to the page documenting their
|
|||||||
|
|
||||||
## [Quantum Keycodes](quantum_keycodes.md#qmk-keycodes)
|
## [Quantum Keycodes](quantum_keycodes.md#qmk-keycodes)
|
||||||
|
|
||||||
|Key |Aliases |Description |
|
|Key |Aliases |Description |
|
||||||
|-------------|-----------|---------------------------------------------------------------------|
|
|---------------|-----------|---------------------------------------------------------------------|
|
||||||
|`RESET` | |Put the keyboard into DFU mode for flashing |
|
|`RESET` | |Put the keyboard into DFU mode for flashing |
|
||||||
|`DEBUG` | |Toggle debug mode |
|
|`DEBUG` | |Toggle debug mode |
|
||||||
|`KC_GESC` |`GRAVE_ESC`|Escape when tapped, <code>`</code> when pressed with Shift or GUI|
|
|`EEPROM_RESET` |`EEP_RST` |Resets EEPROM state by reinitializing it |
|
||||||
|`KC_LSPO` | |Left Shift when held, `(` when tapped |
|
|`KC_GESC` |`GRAVE_ESC`|Escape when tapped, <code>`</code> when pressed with Shift or GUI|
|
||||||
|`KC_RSPC` | |Right Shift when held, `)` when tapped |
|
|`KC_LSPO` | |Left Shift when held, `(` when tapped |
|
||||||
|`KC_LEAD` | |The [Leader key](feature_leader_key.md) |
|
|`KC_RSPC` | |Right Shift when held, `)` when tapped |
|
||||||
|`KC_LOCK` | |The [Lock key](feature_key_lock.md) |
|
|`KC_LEAD` | |The [Leader key](feature_leader_key.md) |
|
||||||
|`FUNC(n)` |`F(n)` |Call `fn_action(n)` (deprecated) |
|
|`KC_LOCK` | |The [Lock key](feature_key_lock.md) |
|
||||||
|`M(n)` | |Call macro `n` |
|
|`FUNC(n)` |`F(n)` |Call `fn_action(n)` (deprecated) |
|
||||||
|`MACROTAP(n)`| |Macro-tap `n` idk FIXME |
|
|`M(n)` | |Call macro `n` |
|
||||||
|
|`MACROTAP(n)` | |Macro-tap `n` idk FIXME |
|
||||||
|
|
||||||
## [Audio Keys](feature_audio.md)
|
## [Audio Keys](feature_audio.md)
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,6 @@ Sometimes it's useful to print debug messages from within your [custom code](cus
|
|||||||
After that you can use a few different print functions:
|
After that you can use a few different print functions:
|
||||||
|
|
||||||
* `print("string")`: Print a simple string.
|
* `print("string")`: Print a simple string.
|
||||||
* `sprintf("%s string", var)`: Print a formatted string
|
* `uprintf("%s string", var)`: Print a formatted string
|
||||||
* `dprint("string")` Print a simple string, but only when debug mode is enabled
|
* `dprint("string")` Print a simple string, but only when debug mode is enabled
|
||||||
* `dprintf("%s string", var)`: Print a formatted string, but only when debug mode is enabled
|
* `dprintf("%s string", var)`: Print a formatted string, but only when debug mode is enabled
|
||||||
@@ -0,0 +1,195 @@
|
|||||||
|
# Supporting Your Keyboard in QMK Configurator
|
||||||
|
|
||||||
|
This page covers how to properly support keyboards in the [QMK Configurator](https://config.qmk.fm/).
|
||||||
|
|
||||||
|
|
||||||
|
## How the Configurator Understands Keyboards
|
||||||
|
|
||||||
|
To understand how the Configurator understands keyboards, first one must understand layout macros. For this exercise, we're going to imagine a 17-key numpad PCB, which we're going to call `numpad`.
|
||||||
|
|
||||||
|
```
|
||||||
|
┌───┬───┬───┬───┐
|
||||||
|
│NLk│ / │ * │ - │
|
||||||
|
├───┼───┼───┼───┤
|
||||||
|
│7 │8 │9 │ + │
|
||||||
|
├───┼───┼───┤ │
|
||||||
|
│4 │5 │6 │ │
|
||||||
|
├───┼───┼───┼───┤
|
||||||
|
│1 │2 │3 │Ent│
|
||||||
|
├───┴───┼───┤ │
|
||||||
|
│0 │ . │ │
|
||||||
|
└───────┴───┴───┘
|
||||||
|
```
|
||||||
|
|
||||||
|
?> For more on layout macros, see [Understanding QMK: Matrix Scanning](understanding_qmk.md?id=matrix-scanning) and [Understanding QMK: Matrix to Physical Layout Map](understanding_qmk.md?id=matrix-to-physical-layout-map).
|
||||||
|
|
||||||
|
The Configurator's API reads the keyboard's `.h` file from `qmk_firmware/keyboards/<keyboard>/<keyboard>.h`. For our numpad, this file would be `qmk_firmware/keyboards/numpad/numpad.h`:
|
||||||
|
|
||||||
|
```c
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#define LAYOUT( \
|
||||||
|
k00, k01, k02, k03, \
|
||||||
|
k10, k11, k12, k13, \
|
||||||
|
k20, k21, k22, \
|
||||||
|
k30, k31, k32, k33, \
|
||||||
|
k40, k42 \
|
||||||
|
) { \
|
||||||
|
{ k00, k01, k02, k03 }, \
|
||||||
|
{ k10, k11, k12, k13 }, \
|
||||||
|
{ k20, k21, k22, KC_NO }, \
|
||||||
|
{ k30, k31, k32, k33 }, \
|
||||||
|
{ k40, KC_NO, k42, KC_NO } \
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
QMK uses `KC_NO` to designate places in the switch matrix where there is no switch. Sometimes, `XXX`, `___` or `____` are used as shorthand to make this section easier to read if it needs to be debugged. This is usually defined near the beginning of the `.h` file:
|
||||||
|
|
||||||
|
```c
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#define XXX KC_NO
|
||||||
|
|
||||||
|
#define LAYOUT( \
|
||||||
|
k00, k01, k02, k03, \
|
||||||
|
k10, k11, k12, k13, \
|
||||||
|
k20, k21, k22, \
|
||||||
|
k30, k31, k32, k33, \
|
||||||
|
k40, k42 \
|
||||||
|
) { \
|
||||||
|
{ k00, k01, k02, k03 }, \
|
||||||
|
{ k10, k11, k12, k13 }, \
|
||||||
|
{ k20, k21, k22, XXX }, \
|
||||||
|
{ k30, k31, k32, k33 }, \
|
||||||
|
{ k40, XXX, k42, XXX } \
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
!> This usage differs from that of keymap macros, which almost always use `XXXXXXX` (seven capital X's) for `KC_NO` and `_______` (seven underscores) for `KC_TRNS`.
|
||||||
|
|
||||||
|
!> To prevent user confusion, using `KC_NO` is preferred.
|
||||||
|
|
||||||
|
The layout macro tells the Configurator that our keyboard has 17 keys, arranged in five rows of four columns each. Our switch positions are named `k<row><column>`, counting from 0. The names themselves actually don't matter, as long as they match between the top section, which receives the keycodes from the keymap, and the bottom half which designates where each key is in the matrix.
|
||||||
|
|
||||||
|
To display our keyboard in a way that resembles the physical keyboard, we need to build a JSON file that tells the Configurator how to tie the physical locations and sizes of our keys to our switch matrix.
|
||||||
|
|
||||||
|
## Building the JSON file
|
||||||
|
|
||||||
|
To build the JSON file, the easiest way is to build the layout in [Keyboard Layout Editor](http://www.keyboard-layout-editor.com/) ("KLE"), from which we'll feed the Raw Data into a QMK tool that converts this data into a JSON the Configurator will read and use. Since KLE opens by default with a numpad layout, we're just going to remove the Getting Started instructions, and use what's left.
|
||||||
|
|
||||||
|
Once the layout is as desired, move to the Raw Data tab in KLE, and copy the contents:
|
||||||
|
|
||||||
|
```
|
||||||
|
["Num Lock","/","*","-"],
|
||||||
|
["7\nHome","8\n↑","9\nPgUp",{h:2},"+"],
|
||||||
|
["4\n←","5","6\n→"],
|
||||||
|
["1\nEnd","2\n↓","3\nPgDn",{h:2},"Enter"],
|
||||||
|
[{w:2},"0\nIns",".\nDel"]
|
||||||
|
```
|
||||||
|
|
||||||
|
To convert this data into our JSON, go to the [QMK KLE-JSON Converter](https://qmk.fm/converter/), paste the Raw Data into the Input field, and click the Convert button. After a moment, our JSON data will appear in the Output field. Copy the contents to a new text document, and name the document `info.json`, saving it in the same folder that contains `numpad.h`.
|
||||||
|
|
||||||
|
Use the `keyboard_name` object to set the name of the keyboard. The `bootloader` object is deprecated, so it can be deleted. For instruction purposes, we will put each key's object on its own line. This is only to make the file more human-readable, and does not affect the Configurator's functionality.
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"keyboard_name": "Numpad",
|
||||||
|
"url": "",
|
||||||
|
"maintainer": "qmk",
|
||||||
|
"tags": {
|
||||||
|
"form_factor": "numpad"
|
||||||
|
},
|
||||||
|
"width": 4,
|
||||||
|
"height": 5,
|
||||||
|
"layouts": {
|
||||||
|
"LAYOUT": {
|
||||||
|
"layout": [
|
||||||
|
{"label":"Num Lock", "x":0, "y":0},
|
||||||
|
{"label":"/", "x":1, "y":0},
|
||||||
|
{"label":"*", "x":2, "y":0},
|
||||||
|
{"label":"-", "x":3, "y":0},
|
||||||
|
{"label":"7", "x":0, "y":1},
|
||||||
|
{"label":"8", "x":1, "y":1},
|
||||||
|
{"label":"9", "x":2, "y":1},
|
||||||
|
{"label":"+", "x":3, "y":1, "h":2},
|
||||||
|
{"label":"4", "x":0, "y":2},
|
||||||
|
{"label":"5", "x":1, "y":2},
|
||||||
|
{"label":"6", "x":2, "y":2},
|
||||||
|
{"label":"1", "x":0, "y":3},
|
||||||
|
{"label":"2", "x":1, "y":3},
|
||||||
|
{"label":"3", "x":2, "y":3},
|
||||||
|
{"label":"Enter", "x":3, "y":3, "h":2},
|
||||||
|
{"label":"0", "x":0, "y":4, "w":2},
|
||||||
|
{"label":".", "x":2, "y":4}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
The `layouts` object contains the data that represents the physical layout of the keyboard. It has an object `LAYOUT`, which needs to match the name of our layout macro from `numpad.h`. The `LAYOUT` object itself has an object named `layout`, which contains one JSON object for each physical key on our keyboard, formatted as follows:
|
||||||
|
|
||||||
|
```
|
||||||
|
┌ The name of the key. Not displayed in the Configurator.
|
||||||
|
│ ┌ The key's X-axis location, in key units from the
|
||||||
|
│ │ keyboard's left edge.
|
||||||
|
│ │ ┌ The key's Y-axis location, in key units from
|
||||||
|
│ │ │ the keyboard's top (rear-facing) edge.
|
||||||
|
↓ ↓ ↓
|
||||||
|
{"label":"Num Lock", "x":0, "y":0},
|
||||||
|
```
|
||||||
|
|
||||||
|
Some objects will also have `"w"` and `"h"` keys, which represent a key's width and height, respectively.
|
||||||
|
|
||||||
|
?> For more on the `info.json` files, see [QMK Keyboard Guidelines: Keyboard Metadata](hardware_keyboard_guidelines.md?id=keyboard-metadata)
|
||||||
|
|
||||||
|
|
||||||
|
## How the Configurator Programs Keys
|
||||||
|
|
||||||
|
The Configurator's API uses the layout macro and the JSON file we've given it to create a visual representation of the keyboard that has each visual object tied to a specific key, in sequence:
|
||||||
|
|
||||||
|
key in layout macro | JSON object used
|
||||||
|
:---: | :----
|
||||||
|
k00 | {"label":"Num Lock", "x":0, "y":0}
|
||||||
|
k01 | {"label":"/", "x":1, "y":0}
|
||||||
|
k02 | {"label":"*", "x":2, "y":0}
|
||||||
|
k03 | {"label":"-", "x":3, "y":0}
|
||||||
|
k10 | {"label":"7", "x":0, "y":1}
|
||||||
|
k11 | {"label":"8", "x":1, "y":1}
|
||||||
|
k12 | {"label":"9", "x":2, "y":1}
|
||||||
|
k13 | {"label":"+", "x":3, "y":1, "h":2}
|
||||||
|
k20 | {"label":"4", "x":0, "y":2}
|
||||||
|
k21 | {"label":"5", "x":1, "y":2}
|
||||||
|
k22 | {"label":"6", "x":2, "y":2}
|
||||||
|
k30 | {"label":"1", "x":0, "y":3}
|
||||||
|
k31 | {"label":"2", "x":1, "y":3}
|
||||||
|
k32 | {"label":"3", "x":2, "y":3}
|
||||||
|
k33 | {"label":"Enter", "x":3, "y":3, "h":2}
|
||||||
|
k40 | {"label":"0", "x":0, "y":4, "w":2}
|
||||||
|
k42 | {"label":".", "x":2, "y":4}
|
||||||
|
|
||||||
|
When a user selects the top-left key in the Configurator, and assigns Num Lock to it, the Configurator builds a keymap file with `KC_NLCK` as the first key, and so on as the keymap is built. The `label` keys are not used; they are only for the user's reference in identifying specific keys when debugging the `info.json` file.
|
||||||
|
|
||||||
|
|
||||||
|
## Issues and Hazards
|
||||||
|
|
||||||
|
Currently, the Configurator does not support key rotation or non-rectangular key shapes like ISO Enter. Additionally, keys that are vertically-offset from their "row" — the arrow keys on 1800-layouts like the [TKC1800](https://github.com/qmk/qmk_firmware/tree/4ac48a61a66206beaf2fdd5f2939d8bbedd0004c/keyboards/tkc1800/) being a prominent example — confuse the KLE-to-JSON Converter, if not adjusted for by the contributor of the `info.json` file.
|
||||||
|
|
||||||
|
### Workarounds
|
||||||
|
|
||||||
|
#### Non-rectangular keys
|
||||||
|
|
||||||
|
For ISO Enter keys, QMK custom is to display it as a rectangular key, 1.25u wide and 2u high, aligned so its right edge is aligned with the right edge of the alphanumeric key block.
|
||||||
|
|
||||||
|

|
||||||
|
*A 60% keyboard in standard ISO layout, as rendered by QMK Configurator.*
|
||||||
|
|
||||||
|
#### Vertically-offset keys
|
||||||
|
|
||||||
|
For vertically-offset keys, place them in KLE as if they were not offset, then edit the Y-values as needed in the converted JSON file
|
||||||
|
|
||||||
|

|
||||||
|
*An 1800-layout keyboard as rendered in Keyboard Layout Editor, without the vertical offset applied to the arrow keys.*
|
||||||
|
|
||||||
|

|
||||||
|
*A Unix diff file, showing the changes needed to vertically-offset the arrow keys in our keyboard's JSON file.*
|
||||||
@@ -56,3 +56,16 @@
|
|||||||
{ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, K2c, K2d, K2e, K2f }, \
|
{ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, K2c, K2d, K2e, K2f }, \
|
||||||
{ K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3a, K3b, K3c, K3d, K3e, K3f } \
|
{ K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3a, K3b, K3c, K3d, K3e, K3f } \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define LAYOUT_kc_ortho_4x12( \
|
||||||
|
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, \
|
||||||
|
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, \
|
||||||
|
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, \
|
||||||
|
K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3a, K3b \
|
||||||
|
) \
|
||||||
|
{ \
|
||||||
|
{ KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, KC_##K09, KC_##K0a, KC_##K0b, ___, ___, ___, ___}, \
|
||||||
|
{ KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K1a, KC_##K1b, ___, ___, ___, ___}, \
|
||||||
|
{ KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, KC_##K29, KC_##K2a, KC_##K2b, ___, ___, ___, ___}, \
|
||||||
|
{ KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, KC_##K38, KC_##K39, KC_##K3a, KC_##K3b, ___, ___, ___, ___} \
|
||||||
|
}
|
||||||
@@ -76,5 +76,4 @@ AUDIO_ENABLE = no # Audio output on port C6
|
|||||||
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
|
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
|
||||||
HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400)
|
HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400)
|
||||||
|
|
||||||
#FIXME: Community keymap build are currently failing due to missing functionality
|
LAYOUTS = ortho_4x4 ortho_4x8 ortho_4x12 ortho_4x16
|
||||||
#LAYOUTS = ortho_4x4 ortho_4x8 ortho_4x12 ortho_4x16
|
|
||||||
@@ -77,5 +77,4 @@ AUDIO_ENABLE = no # Audio output on port C6
|
|||||||
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
|
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
|
||||||
HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400)
|
HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400)
|
||||||
|
|
||||||
#FIXME: Community keymap build are currently failing due to missing functionality
|
LAYOUTS = ortho_5x5 ortho_5x10 ortho_5x15
|
||||||
#LAYOUTS = ortho_5x5 ortho_5x10 ortho_5x15
|
|
||||||
@@ -17,3 +17,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
// place overrides here
|
// place overrides here
|
||||||
|
|
||||||
|
#define PERMISSIVE_HOLD
|
||||||
@@ -15,19 +15,62 @@
|
|||||||
*/
|
*/
|
||||||
#include QMK_KEYBOARD_H
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
#define FN1_Q LT(1, KC_Q)
|
enum foobar_layers {
|
||||||
|
QWERTY,
|
||||||
|
FN1,
|
||||||
|
FN2,
|
||||||
|
FN3,
|
||||||
|
FN4,
|
||||||
|
FN5
|
||||||
|
};
|
||||||
|
|
||||||
|
#define FN1_SPC LT(FN1, KC_SPC)
|
||||||
|
#define FN2_BSC LT(FN2, KC_BSPC)
|
||||||
|
#define FN3_C LT(FN3, KC_C)
|
||||||
|
#define FN4_V LT(FN4, KC_V)
|
||||||
|
#define FN5_B LT(FN5, KC_B)
|
||||||
|
#define RALT_N RALT_T(KC_N)
|
||||||
|
#define LALT_X LALT_T(KC_X)
|
||||||
|
#define LCTL_Z LCTL_T(KC_Z)
|
||||||
|
#define RCTL_M RCTL_T(KC_M)
|
||||||
|
#define LSFT_ENT LSFT_T(KC_ENT)
|
||||||
|
#define RGUI_ESC RGUI_T(KC_ESC)
|
||||||
|
|
||||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
[0] = LAYOUT_split(
|
[QWERTY] = LAYOUT_split(
|
||||||
FN1_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P,
|
KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P,
|
||||||
KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ESC,
|
KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, RGUI_ESC,
|
||||||
KC_Z, KC_X, KC_C, KC_V, KC_BSPC, KC_SPC, KC_B, KC_N, KC_M, KC_ENT
|
LCTL_Z, LALT_X, FN3_C, FN4_V, FN2_BSC, FN1_SPC, FN5_B, RALT_N, RCTL_M, LSFT_ENT
|
||||||
),
|
),
|
||||||
|
|
||||||
[1] = LAYOUT_split(
|
[FN1] = LAYOUT_split(
|
||||||
|
KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0,
|
||||||
|
KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10,
|
||||||
|
_______, _______, _______, _______, KC_DEL, _______, _______, _______, _______, _______
|
||||||
|
),
|
||||||
|
|
||||||
|
[FN2] = LAYOUT_split(
|
||||||
|
KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN,
|
||||||
|
KC_F11, KC_F12, _______, _______, _______, _______, _______, _______, _______, KC_GRV,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||||
|
),
|
||||||
|
|
||||||
|
[FN3] = LAYOUT_split(
|
||||||
|
_______, _______, _______, _______, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS,
|
||||||
|
KC_TAB, _______, _______, _______, _______, KC_COMM, KC_DOT, KC_SLSH, KC_SCLN, KC_QUOT,
|
||||||
|
_______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
|
||||||
|
),
|
||||||
|
|
||||||
|
[FN4] = LAYOUT_split(
|
||||||
|
_______, _______, _______, _______, _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE,
|
||||||
|
KC_TAB, _______, _______, _______, _______, KC_LABK, KC_RABK, KC_QUES, KC_COLN, KC_DQUO,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||||
|
),
|
||||||
|
|
||||||
|
[FN5] = LAYOUT_split(
|
||||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||||
_______, _______, _______, _______, _______, _______, RESET, _______, _______, _______
|
_______, _______, _______, _______, _______, RESET, _______, _______, _______, _______
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"keyboard_name": "foobar",
|
||||||
|
"url": "",
|
||||||
|
"maintainer": "qmk",
|
||||||
|
"width": 15,
|
||||||
|
"height": 5,
|
||||||
|
"layouts": {
|
||||||
|
"LAYOUT_60_ansi": {
|
||||||
|
"layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
/* USB Device descriptor parameter */
|
||||||
|
#undef VENDOR_ID
|
||||||
|
#undef PRODUCT_ID
|
||||||
|
#undef DEVICE_VER
|
||||||
|
#undef MANUFACTURER
|
||||||
|
#undef PRODUCT
|
||||||
|
#undef DESCRIPTION
|
||||||
|
#define VENDOR_ID 0xFEED
|
||||||
|
#define PRODUCT_ID 0x0A0C
|
||||||
|
#define DEVICE_VER 0x0068
|
||||||
|
#define MANUFACTURER 68Keys.io
|
||||||
|
#define PRODUCT The 68Keys.io Keyboard
|
||||||
|
#define DESCRIPTION A 68 keys mechanical keyboard
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
[0] = LAYOUT_68_ansi(
|
||||||
|
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_ESC, KC_PGUP,
|
||||||
|
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_PGDN,
|
||||||
|
KC_CAPSLOCK, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
|
||||||
|
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP,
|
||||||
|
KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
|
||||||
|
)
|
||||||
|
};
|
||||||
@@ -2,22 +2,22 @@
|
|||||||
|
|
||||||
Custom [68Keys.io](https://68keys.io) DIY keyboard.
|
Custom [68Keys.io](https://68keys.io) DIY keyboard.
|
||||||
|
|
||||||
Keyboard Maintainer: [sbstjn](https://sbstjn.com)
|
Keymap Maintainer: [sbstjn](https://sbstjn.com)
|
||||||
Hardware Supported: Pro Micro
|
Hardware Supported: mf68
|
||||||
Hardware Availability: [DIY Guide](https://68keys.io)
|
Hardware Availability: [DIY Guide](https://68keys.io)
|
||||||
|
|
||||||
Make example for this keyboard (after setting up your build environment):
|
Make example for this keyboard (after setting up your build environment):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ > cd qmk_firmware/
|
$ > cd qmk_firmware/
|
||||||
$ > make 68keys:default
|
$ > make 40percentclub/mf68:68keys
|
||||||
```
|
```
|
||||||
|
|
||||||
Example of flashing this keyboard:
|
Example of flashing this keyboard:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ > cd qmk_firmware/
|
$ > cd qmk_firmware/
|
||||||
$ > make 68keys:default:avrdude
|
$ > make 40percentclub/mf68:68keys:avrdude
|
||||||
```
|
```
|
||||||
|
|
||||||
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).
|
See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
BOOTLOADER = atmel-dfu
|
||||||
|
|
||||||
|
EXTRAKEY_ENABLE = yes
|
||||||
|
CONSOLE_ENABLE = no
|
||||||
|
BACKLIGHT_ENABLE = no
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
#include "68keys.h"
|
|
||||||
|
|
||||||
void matrix_init_kb(void)
|
|
||||||
{
|
|
||||||
matrix_init_user();
|
|
||||||
}
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
#include "quantum.h"
|
|
||||||
|
|
||||||
#define LAYOUT_68_ansi( \
|
|
||||||
K00, K01, K02, K03, K04, K05, K06, K07, K08, K10, K11, K12, K13, K14, K15, K16, \
|
|
||||||
K17, K18, K20, K21, K22, K23, K24, K25, K26, K27, K28, K30, K31, K32, K33, K34, \
|
|
||||||
K35, K36, K37, K38, K40, K41, K42, K43, K44, K45, K46, K47, K48, \
|
|
||||||
K50, K51, K52, K53, K54, K55, K56, K57, K58, K60, K61, K62, K63, \
|
|
||||||
K64, K65, K66, K67, K68, K70, K71, K72, K73, K74) \
|
|
||||||
{ \
|
|
||||||
{K00, K01, K02, K03, K04, K05, K06, K07, K08}, \
|
|
||||||
{K10, K11, K12, K13, K14, K15, K16, K17, K18}, \
|
|
||||||
{K20, K21, K22, K23, K24, K25, K26, K27, K28}, \
|
|
||||||
{K30, K31, K32, K33, K34, K35, K36, K37, K38}, \
|
|
||||||
{K40, K41, K42, K43, K44, K45, K46, K47, K48}, \
|
|
||||||
{K50, K51, K52, K53, K54, K55, K56, K57, K58}, \
|
|
||||||
{K60, K61, K62, K63, K64, K65, K66, K67, K68}, \
|
|
||||||
{ \
|
|
||||||
K70, K71, K72, K73, K74 \
|
|
||||||
} \
|
|
||||||
}
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include "config_common.h"
|
|
||||||
|
|
||||||
/* USB Device descriptor parameter */
|
|
||||||
#define VENDOR_ID 0xFEED
|
|
||||||
#define PRODUCT_ID 0x0A0C
|
|
||||||
#define DEVICE_VER 0x0068
|
|
||||||
#define MANUFACTURER 68Keys.io
|
|
||||||
#define PRODUCT The 68Keys.io Keyboard
|
|
||||||
#define DESCRIPTION A 68 keys mechanical keyboard
|
|
||||||
|
|
||||||
/* key matrix size */
|
|
||||||
#define MATRIX_ROWS 8
|
|
||||||
#define MATRIX_COLS 9
|
|
||||||
|
|
||||||
#define MATRIX_ROW_PINS \
|
|
||||||
{ \
|
|
||||||
B6, B2, B3, B1, F7, F6, F5, F4 \
|
|
||||||
}
|
|
||||||
#define MATRIX_COL_PINS \
|
|
||||||
{ \
|
|
||||||
D3, D2, D1, D0, D4, C6, D7, E6, B4 \
|
|
||||||
}
|
|
||||||
#define UNUSED_PINS
|
|
||||||
|
|
||||||
#define DIODE_DIRECTION COL2ROW
|
|
||||||
|
|
||||||
#define BACKLIGHT_PIN B5
|
|
||||||
#define BACKLIGHT_BREATHING
|
|
||||||
#define BACKLIGHT_LEVELS 3
|
|
||||||
|
|
||||||
#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
|
|
||||||
|
|
||||||
/* key combination for magic key command */
|
|
||||||
#define IS_COMMAND() ( \
|
|
||||||
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)))
|
|
||||||
@@ -1,81 +0,0 @@
|
|||||||
{
|
|
||||||
"keyboard_name": "68Keys.io",
|
|
||||||
"url": "https://68keys.io",
|
|
||||||
"maintainer": "qmk",
|
|
||||||
"width": 17.25,
|
|
||||||
"height": 5,
|
|
||||||
"layouts": {
|
|
||||||
"LAYOUT_68_ansi": {
|
|
||||||
"layout": [
|
|
||||||
{ "label": "~", "x": 0, "y": 0 },
|
|
||||||
{ "label": "!", "x": 1, "y": 0 },
|
|
||||||
{ "label": "@", "x": 2, "y": 0 },
|
|
||||||
{ "label": "#", "x": 3, "y": 0 },
|
|
||||||
{ "label": "$", "x": 4, "y": 0 },
|
|
||||||
{ "label": "%", "x": 5, "y": 0 },
|
|
||||||
{ "label": "^", "x": 6, "y": 0 },
|
|
||||||
{ "label": "&", "x": 7, "y": 0 },
|
|
||||||
{ "label": "*", "x": 8, "y": 0 },
|
|
||||||
{ "label": "(", "x": 9, "y": 0 },
|
|
||||||
{ "label": ")", "x": 10, "y": 0 },
|
|
||||||
{ "label": "_", "x": 11, "y": 0 },
|
|
||||||
{ "label": "+", "x": 12, "y": 0 },
|
|
||||||
{ "label": "Backspace", "x": 13, "y": 0, "w": 2 },
|
|
||||||
{ "label": "ESC", "x": 15.25, "y": 0 },
|
|
||||||
{ "label": "PGUP", "x": 16.25, "y": 0 },
|
|
||||||
{ "label": "Tab", "x": 0, "y": 1, "w": 1.5 },
|
|
||||||
{ "label": "Q", "x": 1.5, "y": 1 },
|
|
||||||
{ "label": "W", "x": 2.5, "y": 1 },
|
|
||||||
{ "label": "E", "x": 3.5, "y": 1 },
|
|
||||||
{ "label": "R", "x": 4.5, "y": 1 },
|
|
||||||
{ "label": "T", "x": 5.5, "y": 1 },
|
|
||||||
{ "label": "Y", "x": 6.5, "y": 1 },
|
|
||||||
{ "label": "U", "x": 7.5, "y": 1 },
|
|
||||||
{ "label": "I", "x": 8.5, "y": 1 },
|
|
||||||
{ "label": "O", "x": 9.5, "y": 1 },
|
|
||||||
{ "label": "P", "x": 10.5, "y": 1 },
|
|
||||||
{ "label": "{", "x": 11.5, "y": 1 },
|
|
||||||
{ "label": "}", "x": 12.5, "y": 1 },
|
|
||||||
{ "label": "|", "x": 13.5, "y": 1, "w": 1.5 },
|
|
||||||
{ "label": "DEL", "x": 15.25, "y": 1 },
|
|
||||||
{ "label": "PGDN", "x": 16.25, "y": 1 },
|
|
||||||
{ "label": "Caps Lock", "x": 0, "y": 2, "w": 1.75 },
|
|
||||||
{ "label": "A", "x": 1.75, "y": 2 },
|
|
||||||
{ "label": "S", "x": 2.75, "y": 2 },
|
|
||||||
{ "label": "D", "x": 3.75, "y": 2 },
|
|
||||||
{ "label": "F", "x": 4.75, "y": 2 },
|
|
||||||
{ "label": "G", "x": 5.75, "y": 2 },
|
|
||||||
{ "label": "H", "x": 6.75, "y": 2 },
|
|
||||||
{ "label": "J", "x": 7.75, "y": 2 },
|
|
||||||
{ "label": "K", "x": 8.75, "y": 2 },
|
|
||||||
{ "label": "L", "x": 9.75, "y": 2 },
|
|
||||||
{ "label": ":", "x": 10.75, "y": 2 },
|
|
||||||
{ "label": "\"", "x": 11.75, "y": 2 },
|
|
||||||
{ "label": "Enter", "x": 12.75, "y": 2, "w": 2.25 },
|
|
||||||
{ "label": "Shift", "x": 0, "y": 3, "w": 2.25 },
|
|
||||||
{ "label": "Z", "x": 2.25, "y": 3 },
|
|
||||||
{ "label": "X", "x": 3.25, "y": 3 },
|
|
||||||
{ "label": "C", "x": 4.25, "y": 3 },
|
|
||||||
{ "label": "V", "x": 5.25, "y": 3 },
|
|
||||||
{ "label": "B", "x": 6.25, "y": 3 },
|
|
||||||
{ "label": "N", "x": 7.25, "y": 3 },
|
|
||||||
{ "label": "M", "x": 8.25, "y": 3 },
|
|
||||||
{ "label": "<", "x": 9.25, "y": 3 },
|
|
||||||
{ "label": ">", "x": 10.25, "y": 3 },
|
|
||||||
{ "label": "?", "x": 11.25, "y": 3 },
|
|
||||||
{ "label": "Shift", "x": 12.25, "y": 3, "w": 2.75 },
|
|
||||||
{ "x": 15.25, "y": 3 },
|
|
||||||
{ "label": "CTRL", "x": 0, "y": 4, "w": 1.25 },
|
|
||||||
{ "label": "ALT", "x": 1.25, "y": 4, "w": 1.25 },
|
|
||||||
{ "label": "GUI", "x": 2.5, "y": 4, "w": 1.25 },
|
|
||||||
{ "x": 3.75, "y": 4, "w": 6.25 },
|
|
||||||
{ "label": "GUI", "x": 10, "y": 4, "w": 1.25 },
|
|
||||||
{ "label": "ALT", "x": 11.25, "y": 4, "w": 1.25 },
|
|
||||||
{ "label": "CTRL", "x": 12.5, "y": 4, "w": 1.25 },
|
|
||||||
{ "x": 14.25, "y": 4 },
|
|
||||||
{ "x": 15.25, "y": 4 },
|
|
||||||
{ "x": 16.25, "y": 4 }
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
#include QMK_KEYBOARD_H
|
|
||||||
#include "68keys.h"
|
|
||||||
|
|
||||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|
||||||
[0] = LAYOUT_68_ansi(
|
|
||||||
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_ESC, KC_PGUP,
|
|
||||||
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_PGDN,
|
|
||||||
KC_CAPSLOCK, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
|
|
||||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP,
|
|
||||||
KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT)};
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
LAYOUTS = 68_ansi
|
|
||||||
|
|
||||||
MCU = atmega32u4
|
|
||||||
F_CPU = 16000000
|
|
||||||
ARCH = AVR8
|
|
||||||
F_USB = $(F_CPU)
|
|
||||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
|
||||||
BOOTLOADER = atmel-dfu
|
|
||||||
|
|
||||||
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
|
|
||||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
|
||||||
NKRO_ENABLE = no # USB Nkey Rollover
|
|
||||||
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default
|
|
||||||
MIDI_ENABLE = no # MIDI controls
|
|
||||||
UNICODE_ENABLE = no # Unicode
|
|
||||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
|
||||||
AUDIO_ENABLE = no # Audio output on port C6
|
|
||||||
|
|
||||||
@@ -17,6 +17,9 @@ void matrix_scan_kb(void) {
|
|||||||
void led_init_ports(void) {
|
void led_init_ports(void) {
|
||||||
// * Set our LED pins as output
|
// * Set our LED pins as output
|
||||||
DDRB &= ~(1<<5);
|
DDRB &= ~(1<<5);
|
||||||
|
|
||||||
|
//Set output high, so the capslock led is off
|
||||||
|
PORTB |= (1 << 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
void led_set_kb(uint8_t usb_led) {
|
void led_set_kb(uint8_t usb_led) {
|
||||||
|
|||||||
@@ -17,6 +17,9 @@ void matrix_scan_kb(void) {
|
|||||||
void led_init_ports(void) {
|
void led_init_ports(void) {
|
||||||
// * Set our LED pins as output
|
// * Set our LED pins as output
|
||||||
DDRE |= (1 << 6);
|
DDRE |= (1 << 6);
|
||||||
|
|
||||||
|
//Set output high, so the capslock led is off
|
||||||
|
PORTE |= (1 << 6);
|
||||||
}
|
}
|
||||||
|
|
||||||
void led_set_kb(uint8_t usb_led) {
|
void led_set_kb(uint8_t usb_led) {
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
SRC += ws2812.c
|
|
||||||
|
|
||||||
# MCU name
|
# MCU name
|
||||||
#MCU = at90usb1286
|
#MCU = at90usb1286
|
||||||
MCU = atmega32u4
|
MCU = atmega32u4
|
||||||
@@ -54,7 +52,7 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
|||||||
# change yes to no to disable
|
# change yes to no to disable
|
||||||
#
|
#
|
||||||
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
|
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
|
||||||
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
|
MOUSEKEY_ENABLE = no # Mouse keys(+4700)
|
||||||
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
|
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
|
||||||
CONSOLE_ENABLE = yes # Console for debug(+400)
|
CONSOLE_ENABLE = yes # Console for debug(+400)
|
||||||
COMMAND_ENABLE = yes # Commands for debug and configuration
|
COMMAND_ENABLE = yes # Commands for debug and configuration
|
||||||
|
|||||||
@@ -0,0 +1,54 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2016 Daniel Svensson <[email protected]>
|
||||||
|
2018 Charlie McMackin <[email protected]>
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
#define KM_JIS 0
|
||||||
|
#define KM_MEDIA 1
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] =
|
||||||
|
{
|
||||||
|
/* Layer 0: Standard JIS layer */
|
||||||
|
[KM_JIS] = LAYOUT_tkl_jis(KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR,KC_SLCK,KC_PAUS, \
|
||||||
|
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,KC_EQL, KC_JYEN, KC_BSPC, KC_INS, KC_HOME,KC_PGUP, \
|
||||||
|
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_DEL, KC_END, KC_PGDN, \
|
||||||
|
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT,KC_BSLS,KC_ENT, \
|
||||||
|
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,KC_RO, KC_RSFT, KC_UP, \
|
||||||
|
KC_LCTL, KC_LGUI,KC_LALT,KC_MHEN, KC_SPC, KC_HENK,KC_KANA,KC_RALT,MO(1), KC_RCTL, KC_LEFT,KC_DOWN,KC_RGHT),
|
||||||
|
/* Layer 1: Function layer */
|
||||||
|
[KM_MEDIA] = LAYOUT_tkl_jis(_______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, KC_WAKE,KC_PWR, KC_SLEP, \
|
||||||
|
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,KC_VOLU, \
|
||||||
|
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,KC_VOLD, \
|
||||||
|
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, \
|
||||||
|
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, KC_MPLY, \
|
||||||
|
_______,_______,_______,_______, _______, _______,_______,_______,_______,RESET , KC_MPRV,KC_MSTP,KC_MNXT)
|
||||||
|
};
|
||||||
|
|
||||||
|
void led_set_user(uint8_t usb_led) {
|
||||||
|
if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
|
||||||
|
ph_caps_led_on();
|
||||||
|
} else {
|
||||||
|
ph_caps_led_off();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (usb_led & (1 << USB_LED_SCROLL_LOCK)) {
|
||||||
|
ph_sclk_led_on();
|
||||||
|
} else {
|
||||||
|
ph_sclk_led_off();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
# 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 = 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
|
||||||
|
CUSTOM_MATRIX = yes # Custom matrix file for the Pegasus Hoof due to the 2x74HC42
|
||||||
|
NKRO_ENABLE = no # 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 = no # Enable WS2812 RGB underlight.
|
||||||
@@ -41,6 +41,24 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
/* 7 */ { ___ , ___ , ___ , ___ , ___ , KF7 , KG7 , KH7 , KI7 , KJ7 , KK7 , KL7 , KM7 , KN7 , ___ , KP7 , ___ , ___ }, \
|
/* 7 */ { ___ , ___ , ___ , ___ , ___ , KF7 , KG7 , KH7 , KI7 , KJ7 , KK7 , KL7 , KM7 , KN7 , ___ , KP7 , ___ , ___ }, \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define LAYOUT_tkl_jis( \
|
||||||
|
KG6, KH4, KI4, KI2, KI6, KP5, KL6, KM2, KM4, KO4, KO5, KO6, KO0, KN5, KN7, KP7, \
|
||||||
|
KG4, KG5, KH5, KI5, KJ5, KJ4, KK4, KK5, KL5, KM5, KF5, KF4, KL4, KO7, KO2, KR4, KC4, KE4, \
|
||||||
|
KG2, KG7, KH7, KI7, KJ7, KJ2, KK2, KK7, KL7, KM7, KF7, KF2, KL2, KQ4, KC5, KE5, \
|
||||||
|
KH2, KG3, KH3, KI3, KJ3, KJ6, KK6, KK3, KL3, KM3, KF3, KF6, KO3, KO1, \
|
||||||
|
KB2, KG1, KH1, KI1, KJ1, KJ0, KK0, KK1, KL1, KM1, KF0, KL0, KB3, KC6, \
|
||||||
|
KP4, KD2, KN6, KG0, KQ6, KH0, KI0, KN0, KM0, KP1, KC0, KQ0, KR0 \
|
||||||
|
) { /* 00-A 01-B 02-C 03-D 04-E 05-F 06-G 07-H 08-I 09-J 10-K 11-L 12-M 13-N 14-O 15-P 16-Q 17-R */ \
|
||||||
|
/* 0 */ { ___ , ___ , KC0 , ___ , ___ , KF0 , KG0 , KH0 , KI0 , KJ0 , KK0 , KL0 , KM0 , KN0 , KO0 , ___ , KQ0 , KR0 }, \
|
||||||
|
/* 1 */ { ___ , ___ , ___ , ___ , ___ , ___ , KG1 , KH1 , KI1 , KJ1 , KK1 , KL1 , KM1 , ___ , KO1 , KP1 , ___ , ___ }, \
|
||||||
|
/* 2 */ { ___ , KB2 , ___ , KD2 , ___ , KF2 , KG2 , KH2 , KI2 , KJ2 , KK2 , KL2 , KM2 , ___ , KO2 , ___ , ___ , ___ }, \
|
||||||
|
/* 3 */ { ___ , KB3 , ___ , ___ , ___ , KF3 , KG3 , KH3 , KI3 , KJ3 , KK3 , KL3 , KM3 , ___ , KO3 , ___ , ___ , ___ }, \
|
||||||
|
/* 4 */ { ___ , ___ , KC4 , ___ , KE4 , KF4 , KG4 , KH4 , KI4 , KJ4 , KK4 , KL4 , KM4 , ___ , KO4 , KP4 , KQ4 , KR4 }, \
|
||||||
|
/* 5 */ { ___ , ___ , KC5 , ___ , KE5 , KF5 , KG5 , KH5 , KI5 , KJ5 , KK5 , KL5 , KM5 , KN5 , KO5 , KP5 , ___ , ___ }, \
|
||||||
|
/* 6 */ { ___ , ___ , KC6 , ___ , ___ , KF6 , KG6 , ___ , KI6 , KJ6 , KK6 , KL6 , ___ , KN6 , KO6 , ___ , KQ6 , ___ }, \
|
||||||
|
/* 7 */ { ___ , ___ , ___ , ___ , ___ , KF7 , KG7 , KH7 , KI7 , KJ7 , KK7 , KL7 , KM7 , KN7 , KO7 , KP7 , ___ , ___ }, \
|
||||||
|
}
|
||||||
|
|
||||||
inline void ph_caps_led_on(void) { DDRC |= (1<<6); PORTC &= ~(1<<6); }
|
inline void ph_caps_led_on(void) { DDRC |= (1<<6); PORTC &= ~(1<<6); }
|
||||||
inline void ph_caps_led_off(void) { DDRC &= ~(1<<6); PORTC &= ~(1<<6); }
|
inline void ph_caps_led_off(void) { DDRC &= ~(1<<6); PORTC &= ~(1<<6); }
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,42 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2018 listofoptions <[email protected]>
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "config_common.h"
|
||||||
|
|
||||||
|
#define VENDOR_ID 0xFEED
|
||||||
|
#define PRODUCT_ID 0x6060
|
||||||
|
#define DEVICE_VER 1
|
||||||
|
#define MANUFACTURER QMK
|
||||||
|
#define PRODUCT 5291 keyboard converter
|
||||||
|
#define DESCRIPTION 5291 keyboard converter
|
||||||
|
|
||||||
|
#define MATRIX_ROWS 24
|
||||||
|
#define MATRIX_COLS 4
|
||||||
|
|
||||||
|
#define MATRIX_ROW_PINS {B2, B3, B4, B5, B6}
|
||||||
|
#define MATRIX_COL_PINS {B0, B1}
|
||||||
|
#define MATRIX_DATA_PIN D0
|
||||||
|
#define MATRIX_STROBE_PIN D1
|
||||||
|
#define LED_PIN D6
|
||||||
|
|
||||||
|
|
||||||
|
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
|
||||||
|
#define DEBOUNCING_DELAY 0
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
#include "ibm_5291.h"
|
||||||
|
#include <avr/io.h>
|
||||||
|
#include "quantum.h"
|
||||||
@@ -0,0 +1,69 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2018 listofoptions <[email protected]>
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "quantum.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* ,-------. ,--------------------------------------------------------------------------.
|
||||||
|
* | F1| F2| |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| BS |NumLck |ScrLck |
|
||||||
|
* |-------| |--------------------------------------------------------------------------|
|
||||||
|
* | F3| F4| | Tab | Q| W| E| R| T| Y| U| I| O| P| [| ] | | 7| 8| 9| -|
|
||||||
|
* |-------| |------------------------------------------------------|Ent|---------------|
|
||||||
|
* | F5| F6| | Ctrl | A| S| D| F| G| H| J| K| L| ;| '| `| | 4| 5| 6| |
|
||||||
|
* |-------| |----------------------------------------------------------------------| |
|
||||||
|
* | F7| F8| |Shif| \| Z| X| C| V| B| N| M| ,| .| /|Shift|PrS| 1| 2| 3| +|
|
||||||
|
* |-------| |----------------------------------------------------------------------| |
|
||||||
|
* | F9|F10| | Alt | Space |CapsLck| 0 | . | |
|
||||||
|
* `-------' `--------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define LAYOUT_5291( \
|
||||||
|
KEY_F1,KEY_F2, KEY_ESC, KEY_1, KEY_2,KEY_3,KEY_4,KEY_5,KEY_6,KEY_7,KEY_8,KEY_9, KEY_0, KEY_MIN, KEY_EQU, KEY_BACK, KEY_NLOCK, KEY_SLOCK, \
|
||||||
|
KEY_F3,KEY_F4, KEY_TAB, KEY_Q, KEY_W,KEY_E,KEY_R,KEY_T,KEY_Y,KEY_U,KEY_I,KEY_O, KEY_P, KEY_LBRC,KEY_RBRC, KEY_PAD7,KEY_PAD8, KEY_PAD9,KEY_PMIN, \
|
||||||
|
KEY_F5,KEY_F6, KEY_LCTR,KEY_A, KEY_S,KEY_D,KEY_F,KEY_G,KEY_H,KEY_J,KEY_K,KEY_L, KEY_SEMI,KEY_QUOT,KEY_TICK, KEY_ENTR,KEY_PAD4,KEY_PAD5, KEY_PAD6, \
|
||||||
|
KEY_F7,KEY_F8, KEY_LSFS,KEY_BSLS,KEY_Z,KEY_X,KEY_C,KEY_V,KEY_B,KEY_N,KEY_M,KEY_COMM,KEY_DOT, KEY_SLS,KEY_RSFS, KEY_PAST,KEY_PAD1,KEY_PAD2, KEY_PAD3,KEY_PPLS, \
|
||||||
|
KEY_F9,KEY_F10, KEY_LALT, KEY_SPACE, KEY_CLOCK, KEY_PAD0, KEY_PDOT \
|
||||||
|
) \
|
||||||
|
{ {KEY_Z, KEY_S, KEY_W, KEY_3 }\
|
||||||
|
, {KEY_X, KEY_D, KEY_E, KEY_4 }\
|
||||||
|
, {KEY_C, KEY_F, KEY_R, KEY_5 }\
|
||||||
|
, {KEY_V, KEY_G, KEY_T, KEY_6 }\
|
||||||
|
, {KEY_B, KEY_H, KEY_Y, KEY_7 }\
|
||||||
|
, {KEY_N, KEY_J, KEY_U, KEY_8 }\
|
||||||
|
, {KEY_PAD2, KEY_PAD5,KEY_PAD8,KEY_NLOCK }\
|
||||||
|
, {KEY_M, KEY_K, KEY_I, KEY_9 }\
|
||||||
|
, {KEY_COMM, KEY_L, KEY_O, KEY_0 }\
|
||||||
|
, {KEY_DOT, KEY_SEMI,KEY_P, KEY_MIN }\
|
||||||
|
, {KEY_SLS, KEY_QUOT,KEY_LBRC,KEY_EQU }\
|
||||||
|
, {KEY_SPACE, KEY_RSFS,KEY_TICK,KEY_RBRC }\
|
||||||
|
, {KEY_CLOCK, KEY_PAST,KEY_ENTR,KEY_BACK }\
|
||||||
|
, {KEY_PAD0, KEY_PAD1,KEY_PAD4,KEY_PAD7 }\
|
||||||
|
, {KEY_PPLS, KC_NO, KEY_PMIN,KEY_SLOCK }\
|
||||||
|
, {KEY_PDOT, KEY_PAD3,KEY_PAD6,KEY_PAD9 }\
|
||||||
|
, {KEY_BSLS, KEY_A, KEY_Q, KEY_2 }\
|
||||||
|
, {KEY_LALT, KC_NO, KC_NO, KEY_1 }\
|
||||||
|
, {KEY_F7, KEY_F5, KEY_F3, KEY_F1 }\
|
||||||
|
, {KEY_F8, KEY_F6, KEY_F4, KEY_F2 }\
|
||||||
|
, {KC_F10, KC_NO, KC_NO, KC_NO }\
|
||||||
|
, {KC_F9, KC_NO, KC_NO, KC_NO }\
|
||||||
|
, {KEY_LSFS, KEY_LCTR,KEY_TAB, KEY_ESC }\
|
||||||
|
, {KC_NO, KC_NO, KC_NO, KC_NO }\
|
||||||
|
}
|
||||||
|
|
||||||
|
#define LAYOUT LAYOUT_5291
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"keyboard_name": "IBM 5291",
|
||||||
|
"keyboard_folder": "converter/5291",
|
||||||
|
"url": "https://deskthority.net/wiki/IBM_Model_F#IBM_5291_Keyboard",
|
||||||
|
"maintainer": "listofoptions",
|
||||||
|
}
|
||||||
@@ -0,0 +1,233 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2018 listofoptions <[email protected]>
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
/*
|
||||||
|
enum xt_keycodes
|
||||||
|
{ XT_PAST = SAFE_RANGE // XT pad asterisk / print screen
|
||||||
|
, XT_SLCK // XT scroll lock / break
|
||||||
|
, XT_F6 // F6 / app key
|
||||||
|
, XT_F5 // F5 / gui
|
||||||
|
, XT_F9 // F9 / F11
|
||||||
|
, XT_F10 // F10 / F12
|
||||||
|
} ;
|
||||||
|
|
||||||
|
static bool shift_pressed = false ,
|
||||||
|
alt_pressed = false ,
|
||||||
|
ctrl_pressed = false ,
|
||||||
|
xt_pscr_pressed = false ,
|
||||||
|
xt_brk_pressed = false ,
|
||||||
|
xt_app_pressed = false ,
|
||||||
|
xt_gui_pressed = false ,
|
||||||
|
xt_lout_pressed = false ,
|
||||||
|
xt_f11_pressed = false ,
|
||||||
|
xt_f12_pressed = false ;
|
||||||
|
|
||||||
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
switch (keycode) {
|
||||||
|
case KC_LSFT:
|
||||||
|
case KC_RSFT:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
shift_pressed = true ;
|
||||||
|
} else {
|
||||||
|
shift_pressed = false ;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case KC_LALT:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
alt_pressed = true ;
|
||||||
|
} else {
|
||||||
|
alt_pressed = false ;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case KC_LCTL:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
ctrl_pressed = true ;
|
||||||
|
} else {
|
||||||
|
ctrl_pressed = false ;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case XT_PAST:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
if (shift_pressed) {
|
||||||
|
xt_pscr_pressed = true ;
|
||||||
|
register_code(KC_PSCR);
|
||||||
|
} else {
|
||||||
|
register_code(KC_PAST);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (xt_pscr_pressed) {
|
||||||
|
xt_pscr_pressed = false ;
|
||||||
|
unregister_code(KC_PSCR);
|
||||||
|
} else {
|
||||||
|
unregister_code(KC_PAST);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case XT_SLCK:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
if (ctrl_pressed) {
|
||||||
|
xt_brk_pressed = true ;
|
||||||
|
register_code(KC_BRK);
|
||||||
|
} else {
|
||||||
|
register_code(KC_SLCK);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (xt_brk_pressed) {
|
||||||
|
xt_brk_pressed = false ;
|
||||||
|
unregister_code(KC_BRK);
|
||||||
|
} else {
|
||||||
|
unregister_code(KC_SLCK);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case XT_F6:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
if (shift_pressed) {
|
||||||
|
xt_app_pressed = true ;
|
||||||
|
register_code(KC_APP);
|
||||||
|
} else {
|
||||||
|
register_code(KC_F6);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (xt_app_pressed) {
|
||||||
|
xt_app_pressed = false ;
|
||||||
|
unregister_code(KC_APP);
|
||||||
|
} else {
|
||||||
|
unregister_code(KC_F6);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case XT_F5:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
if (shift_pressed) {
|
||||||
|
xt_gui_pressed = true ;
|
||||||
|
register_code(KC_LGUI);
|
||||||
|
} else if (ctrl_pressed) {
|
||||||
|
xt_lout_pressed = true ;
|
||||||
|
register_code (KC_LGUI) ;
|
||||||
|
register_code (KC_L) ;
|
||||||
|
} else {
|
||||||
|
register_code(KC_F5);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (xt_gui_pressed) {
|
||||||
|
xt_gui_pressed = false ;
|
||||||
|
unregister_code(KC_LGUI);
|
||||||
|
} else if (xt_lout_pressed) {
|
||||||
|
xt_lout_pressed = false ;
|
||||||
|
unregister_code (KC_LGUI) ;
|
||||||
|
unregister_code (KC_L) ;
|
||||||
|
} else {
|
||||||
|
unregister_code(KC_F5);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case XT_F9:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
if (shift_pressed) {
|
||||||
|
xt_f11_pressed = true ;
|
||||||
|
register_code(KC_F11);
|
||||||
|
} else {
|
||||||
|
register_code(KC_F9);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (xt_f11_pressed) {
|
||||||
|
xt_f11_pressed = false ;
|
||||||
|
unregister_code(KC_F11);
|
||||||
|
} else {
|
||||||
|
unregister_code(KC_F9);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case XT_F10:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
if (shift_pressed) {
|
||||||
|
xt_f12_pressed = true ;
|
||||||
|
register_code(KC_F12);
|
||||||
|
} else {
|
||||||
|
register_code(KC_F10);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (xt_f12_pressed) {
|
||||||
|
xt_f12_pressed = false ;
|
||||||
|
unregister_code(KC_F12);
|
||||||
|
} else {
|
||||||
|
unregister_code(KC_F10);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
// default layout is the standard XT layout
|
||||||
|
/*
|
||||||
|
* ,-------. ,--------------------------------------------------------------------------.
|
||||||
|
* | F1| F2| |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| BS |NumLck |ScrLck |
|
||||||
|
* |-------| |--------------------------------------------------------------------------|
|
||||||
|
* | F3| F4| | Tab | Q| W| E| R| T| Y| U| I| O| P| [| ] | | 7| 8| 9| -|
|
||||||
|
* |-------| |------------------------------------------------------|Ent|---------------|
|
||||||
|
* | F5| F6| | Ctrl | A| S| D| F| G| H| J| K| L| ;| '| `| | 4| 5| 6| |
|
||||||
|
* |-------| |----------------------------------------------------------------------| |
|
||||||
|
* | F7| F8| |Shif| \| Z| X| C| V| B| N| M| ,| .| /|Shift| *| 1| 2| 3| +|
|
||||||
|
* |-------| |----------------------------------------------------------------------| |
|
||||||
|
* | F9|F10| | Alt | Space |CapsLck| 0 | . | |
|
||||||
|
* `-------' `--------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
[0] = LAYOUT (
|
||||||
|
KC_F1,KC_F2, KC_ESC, KC_1, KC_2,KC_3,KC_4,KC_5,KC_6,KC_7,KC_8,KC_9, KC_0, KC_MINS,KC_EQL, KC_BSPC, KC_NLCK, XT_SLCK,
|
||||||
|
KC_F3,KC_F4, 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_P7,KC_P8, KC_P9, KC_PMNS,
|
||||||
|
XT_F5,XT_F6, KC_LCTL,KC_A, KC_S,KC_D,KC_F,KC_G,KC_H,KC_J,KC_K,KC_L, KC_SCLN,KC_QUOT,KC_GRV, KC_ENT, KC_P4,KC_P5, KC_P6,
|
||||||
|
KC_F7,KC_F8, KC_LSFT,KC_BSLS,KC_Z,KC_X,KC_C,KC_V,KC_B,KC_N,KC_M,KC_COMM,KC_DOT, KC_SLSH,KC_RSFT,XT_PAST,KC_P1,KC_P2, KC_P3, KC_PPLS,
|
||||||
|
XT_F9,XT_F10,KC_LALT, KC_SPACE, KC_CAPS, KC_P0, KC_PDOT
|
||||||
|
)
|
||||||
|
*/
|
||||||
|
[0] = LAYOUT (
|
||||||
|
KC_F1,KC_F2, KC_ESC, KC_1, KC_2,KC_3,KC_4,KC_5,KC_6,KC_7,KC_8,KC_9, KC_0, KC_MINS,KC_EQL, KC_BSPC, KC_NLCK, KC_SLCK,
|
||||||
|
KC_F3,KC_F4, 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_P7,KC_P8, KC_P9, KC_PMNS,
|
||||||
|
KC_F5,KC_F6, KC_LCTL,KC_A, KC_S,KC_D,KC_F,KC_G,KC_H,KC_J,KC_K,KC_L, KC_SCLN,KC_QUOT,KC_GRV, KC_ENT, KC_P4,KC_P5, KC_P6,
|
||||||
|
KC_F7,KC_F8, KC_LSFT,KC_BSLS,KC_Z,KC_X,KC_C,KC_V,KC_B,KC_N,KC_M,KC_COMM,KC_DOT, KC_SLSH,KC_RSFT,KC_PAST,KC_P1,KC_P2, KC_P3, KC_PPLS,
|
||||||
|
KC_F9,KC_F10,KC_LALT, KC_SPACE, KC_CAPS, KC_P0, KC_PDOT
|
||||||
|
)
|
||||||
|
} ;
|
||||||
|
|
||||||
Binary file not shown.
@@ -0,0 +1,284 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2018 listofoptions <[email protected]>
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include <string.h>
|
||||||
|
#if defined(__AVR__)
|
||||||
|
#include <avr/io.h>
|
||||||
|
#endif
|
||||||
|
#include <util/delay.h>
|
||||||
|
|
||||||
|
#include "wait.h"
|
||||||
|
#include "print.h"
|
||||||
|
#include "debug.h"
|
||||||
|
#include "util.h"
|
||||||
|
#include "matrix.h"
|
||||||
|
#include "timer.h"
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef DEBOUNCING_DELAY
|
||||||
|
# define DEBOUNCING_DELAY 5
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define print_matrix_header() print("\nr/c 01234567\n")
|
||||||
|
#define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row))
|
||||||
|
#define matrix_bitpop(i) bitpop(matrix[i])
|
||||||
|
#define ROW_SHIFTER ((uint8_t)1)
|
||||||
|
#define check_bit(var,pos) ((var) & (1<<(pos)))
|
||||||
|
|
||||||
|
#define NUM_ROW_PINS 5
|
||||||
|
#define NUM_COL_PINS 2
|
||||||
|
|
||||||
|
static const uint8_t row_pins [NUM_ROW_PINS] = MATRIX_ROW_PINS ;
|
||||||
|
static const uint8_t col_pins [NUM_ROW_PINS] = MATRIX_COL_PINS ;
|
||||||
|
|
||||||
|
#if ( DEBOUNCING_DELAY > 0 )
|
||||||
|
static uint16_t debouncing_time ;
|
||||||
|
static bool debouncing = false ;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static uint8_t matrix [MATRIX_ROWS] = {0};
|
||||||
|
|
||||||
|
#if ( DEBOUNCING_DELAY > 0 )
|
||||||
|
static uint8_t matrix_debounce [MATRIX_ROWS] = {0};
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static
|
||||||
|
inline
|
||||||
|
void toggle_led(void) {
|
||||||
|
uint8_t pin = LED_PIN ;
|
||||||
|
_SFR_IO8((pin >> 4) + 2) ^= _BV(pin & 0xF);
|
||||||
|
}
|
||||||
|
|
||||||
|
static
|
||||||
|
inline
|
||||||
|
void init_led(void) {
|
||||||
|
uint8_t pin = LED_PIN ;
|
||||||
|
_SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT
|
||||||
|
_SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW
|
||||||
|
}
|
||||||
|
|
||||||
|
static
|
||||||
|
inline
|
||||||
|
void init_data(void) {
|
||||||
|
uint8_t pin = MATRIX_DATA_PIN ;
|
||||||
|
_SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
|
||||||
|
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // LO
|
||||||
|
}
|
||||||
|
|
||||||
|
static
|
||||||
|
inline
|
||||||
|
void init_strobe(void) {
|
||||||
|
uint8_t pin = MATRIX_STROBE_PIN ;
|
||||||
|
_SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT
|
||||||
|
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
|
||||||
|
}
|
||||||
|
|
||||||
|
static
|
||||||
|
inline
|
||||||
|
void init_rows(void) {
|
||||||
|
for ( uint8_t i = 0 ; i < NUM_ROW_PINS; ++i ) {
|
||||||
|
uint8_t pin = row_pins[i];
|
||||||
|
_SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT
|
||||||
|
_SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static
|
||||||
|
inline
|
||||||
|
void init_cols(void) {
|
||||||
|
for ( uint8_t i = 0 ; i < NUM_COL_PINS; ++i ) {
|
||||||
|
uint8_t pin = col_pins[i];
|
||||||
|
_SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT
|
||||||
|
_SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static
|
||||||
|
inline
|
||||||
|
void select_row(uint8_t current_row) {
|
||||||
|
for ( uint8_t i = 0 ; i < NUM_ROW_PINS; ++i ) {
|
||||||
|
uint8_t pin = row_pins[i] ;
|
||||||
|
if ( check_bit( current_row, i ) ) {
|
||||||
|
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
|
||||||
|
} else {
|
||||||
|
_SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW
|
||||||
|
}
|
||||||
|
}
|
||||||
|
wait_us(30) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
static
|
||||||
|
inline
|
||||||
|
void select_col(uint8_t current_col) {
|
||||||
|
for ( uint8_t i = 0 ; i < NUM_COL_PINS; ++i ) {
|
||||||
|
uint8_t pin = col_pins[i] ;
|
||||||
|
if ( check_bit( current_col, i ) ) {
|
||||||
|
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
|
||||||
|
} else {
|
||||||
|
_SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW
|
||||||
|
}
|
||||||
|
}
|
||||||
|
wait_us(30) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
static
|
||||||
|
inline
|
||||||
|
uint8_t matrix_strobe(uint8_t col_index) {
|
||||||
|
uint8_t strobe_pin = MATRIX_STROBE_PIN ;
|
||||||
|
uint8_t data_pin = MATRIX_DATA_PIN ;
|
||||||
|
|
||||||
|
// set strobe pin low
|
||||||
|
_SFR_IO8((strobe_pin >> 4) + 2) &= ~_BV(strobe_pin & 0xF);
|
||||||
|
|
||||||
|
wait_us(30) ;
|
||||||
|
|
||||||
|
// read data
|
||||||
|
uint8_t data = (_SFR_IO8(data_pin >> 4) & _BV(data_pin & 0xF)) ;
|
||||||
|
|
||||||
|
// set strobe pin hi
|
||||||
|
_SFR_IO8((strobe_pin >> 4) + 2) |= _BV(strobe_pin & 0xF);
|
||||||
|
|
||||||
|
uint8_t out = data ? (1 << col_index) : 0 ;
|
||||||
|
return out ;
|
||||||
|
}
|
||||||
|
|
||||||
|
static
|
||||||
|
bool matrix_read(uint8_t current_matrix[], uint8_t current_row) {
|
||||||
|
// Store last value of row prior to reading
|
||||||
|
uint8_t last_row_value = current_matrix[current_row];
|
||||||
|
|
||||||
|
// Clear data in matrix row
|
||||||
|
current_matrix[current_row] = 0;
|
||||||
|
|
||||||
|
select_row(current_row);
|
||||||
|
|
||||||
|
// For each col...
|
||||||
|
for(uint8_t col_index = 0; col_index < MATRIX_COLS; ++col_index) {
|
||||||
|
|
||||||
|
select_col(col_index) ;
|
||||||
|
|
||||||
|
// strobe the matrix
|
||||||
|
// Populate the matrix row with the state of the data pin
|
||||||
|
current_matrix[current_row] |= matrix_strobe(col_index) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool test = last_row_value != current_matrix[current_row] ;
|
||||||
|
return test ;
|
||||||
|
}
|
||||||
|
|
||||||
|
__attribute__ ((weak))
|
||||||
|
void matrix_init_quantum(void) {
|
||||||
|
matrix_init_kb();
|
||||||
|
}
|
||||||
|
|
||||||
|
__attribute__ ((weak))
|
||||||
|
void matrix_scan_quantum(void) {
|
||||||
|
matrix_scan_kb();
|
||||||
|
}
|
||||||
|
|
||||||
|
__attribute__ ((weak))
|
||||||
|
void matrix_init_kb(void) {
|
||||||
|
matrix_init_user();
|
||||||
|
}
|
||||||
|
|
||||||
|
__attribute__ ((weak))
|
||||||
|
void matrix_scan_kb(void) {
|
||||||
|
matrix_scan_user();
|
||||||
|
}
|
||||||
|
|
||||||
|
__attribute__ ((weak))
|
||||||
|
void matrix_init_user(void) {
|
||||||
|
}
|
||||||
|
|
||||||
|
__attribute__ ((weak))
|
||||||
|
void matrix_scan_user(void) {
|
||||||
|
}
|
||||||
|
|
||||||
|
inline
|
||||||
|
uint8_t matrix_rows(void) {
|
||||||
|
return MATRIX_ROWS;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline
|
||||||
|
uint8_t matrix_cols(void) {
|
||||||
|
return MATRIX_COLS;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline
|
||||||
|
uint8_t matrix_get_row(uint8_t row) {
|
||||||
|
return matrix[row];
|
||||||
|
}
|
||||||
|
|
||||||
|
void matrix_init(void) {
|
||||||
|
init_led() ;
|
||||||
|
init_rows() ;
|
||||||
|
init_cols() ;
|
||||||
|
init_data() ;
|
||||||
|
init_strobe() ;
|
||||||
|
|
||||||
|
// initialize matrix state: all keys off
|
||||||
|
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
|
||||||
|
matrix[i] = 0;
|
||||||
|
# if (DEBOUNCING_DELAY > 0)
|
||||||
|
matrix_debounce [i] = 0;
|
||||||
|
# endif
|
||||||
|
}
|
||||||
|
|
||||||
|
matrix_init_quantum() ;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t matrix_scan(void) {
|
||||||
|
for ( uint8_t current_row = 0; current_row < MATRIX_ROWS; ++current_row ) {
|
||||||
|
# if (DEBOUNCING_DELAY > 0)
|
||||||
|
bool matrix_changed = matrix_read(matrix_debounce, current_row);
|
||||||
|
|
||||||
|
if (matrix_changed) {
|
||||||
|
debouncing = true ;
|
||||||
|
debouncing_time = timer_read();
|
||||||
|
}
|
||||||
|
|
||||||
|
# else
|
||||||
|
matrix_read(matrix, current_row);
|
||||||
|
# endif
|
||||||
|
}
|
||||||
|
|
||||||
|
# if (DEBOUNCING_DELAY > 0)
|
||||||
|
if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) {
|
||||||
|
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
|
||||||
|
matrix[i] = matrix_debounce[i];
|
||||||
|
}
|
||||||
|
debouncing = false;
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
|
||||||
|
matrix_scan_quantum();
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
void matrix_print(void) {
|
||||||
|
print_matrix_header();
|
||||||
|
|
||||||
|
for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
|
||||||
|
phex(row); print(": ");
|
||||||
|
print_matrix_row(row);
|
||||||
|
print("\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,96 @@
|
|||||||
|
0,Z
|
||||||
|
1,S
|
||||||
|
2,W
|
||||||
|
3,3
|
||||||
|
4,X
|
||||||
|
5,D
|
||||||
|
6,E
|
||||||
|
7,4
|
||||||
|
8,C
|
||||||
|
9,F
|
||||||
|
10,R
|
||||||
|
11,5
|
||||||
|
12,V
|
||||||
|
13,G
|
||||||
|
14,T
|
||||||
|
15,6
|
||||||
|
16,B
|
||||||
|
17,H
|
||||||
|
18,Y
|
||||||
|
19,7
|
||||||
|
20,N
|
||||||
|
21,J
|
||||||
|
22,U
|
||||||
|
23,8
|
||||||
|
24,PAD_2
|
||||||
|
25,PAD_5
|
||||||
|
26,PAD_8
|
||||||
|
27,NUM_LOCK
|
||||||
|
28,M
|
||||||
|
29,K
|
||||||
|
30,I
|
||||||
|
31,9
|
||||||
|
32,COMMA
|
||||||
|
33,L
|
||||||
|
34,O
|
||||||
|
35,0
|
||||||
|
36,PERIOD
|
||||||
|
37,SEMICOLON
|
||||||
|
38,P
|
||||||
|
39,MINUS
|
||||||
|
40,SLASH
|
||||||
|
41,QUOTE
|
||||||
|
42,LEFT_BRACE
|
||||||
|
43,EQUAL
|
||||||
|
44,SPACE
|
||||||
|
45,RSHIFT
|
||||||
|
46,BACK_QUOTE
|
||||||
|
47,RIGHT_BRACE
|
||||||
|
48,CAPS_LOCK
|
||||||
|
49,PAD_ASTERIX
|
||||||
|
50,ENTER
|
||||||
|
51,BACKSPACE
|
||||||
|
52,PAD_0
|
||||||
|
53,PAD_1
|
||||||
|
54,PAD_4
|
||||||
|
55,PAD_7
|
||||||
|
56,PAD_PLUS
|
||||||
|
57,UNASSIGNED
|
||||||
|
58,PAD_MINUS
|
||||||
|
59,SCROLL_LOCK
|
||||||
|
60,PAD_PERIOD
|
||||||
|
61,PAD_3
|
||||||
|
62,PAD_6
|
||||||
|
63,PAD_9
|
||||||
|
64,BACKSLASH
|
||||||
|
65,A
|
||||||
|
66,Q
|
||||||
|
67,2
|
||||||
|
68,LALT
|
||||||
|
69,UNASSIGNED
|
||||||
|
70,UNASSIGNED
|
||||||
|
71,1
|
||||||
|
72,F7
|
||||||
|
73,F5
|
||||||
|
74,F3
|
||||||
|
75,F1
|
||||||
|
76,F8
|
||||||
|
77,F6
|
||||||
|
78,F4
|
||||||
|
79,F2
|
||||||
|
80,F10
|
||||||
|
81,UNASSIGNED
|
||||||
|
82,UNASSIGNED
|
||||||
|
83,UNASSIGNED
|
||||||
|
84,F9
|
||||||
|
85,UNASSIGNED
|
||||||
|
86,UNASSIGNED
|
||||||
|
87,UNASSIGNED
|
||||||
|
88,LSHIFT
|
||||||
|
89,LCTRL
|
||||||
|
90,TAB
|
||||||
|
91,ESC
|
||||||
|
92,UNASSIGNED
|
||||||
|
93,UNASSIGNED
|
||||||
|
94,UNASSIGNED
|
||||||
|
95,UNASSIGNED
|
||||||
|
@@ -0,0 +1,70 @@
|
|||||||
|
# IBM 5291 keyboard converter
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
A converter for the eponymous keyboard.
|
||||||
|
|
||||||
|
Keyboard Maintainer: [Listofoptions](https://github.com/listofoptions)
|
||||||
|
Hardware Supported: IBM 5291, Teensy 2.0
|
||||||
|
|
||||||
|
Make example for this keyboard (after setting up your build environment):
|
||||||
|
|
||||||
|
make converter/ibm_5291: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).
|
||||||
|
|
||||||
|
|
||||||
|
the pinout is as follows:
|
||||||
|
|
||||||
|
IBM−5291−Cable to Pinhead−14
|
||||||
|
|
||||||
|
| pin | description
|
||||||
|
----|------------------------
|
||||||
|
1 | GND
|
||||||
|
2 | NC
|
||||||
|
3 | GND
|
||||||
|
4 | GN)
|
||||||
|
5 | +5V
|
||||||
|
6 | D0
|
||||||
|
7 | D1
|
||||||
|
8 | D2
|
||||||
|
9 | D3
|
||||||
|
10| D4
|
||||||
|
11| D5
|
||||||
|
12| D6
|
||||||
|
13| Strobe
|
||||||
|
14| Out
|
||||||
|
|
||||||
|
the pins on this connector are organized 
|
||||||
|
|
||||||
|
IBM−5291−2 Cable with DB15M connector
|
||||||
|
|
||||||
|
| pin | description
|
||||||
|
----|-------------
|
||||||
|
|1,2,3 | GND
|
||||||
|
|4 | +5V
|
||||||
|
|5 | D0
|
||||||
|
|6 | D1
|
||||||
|
|7 | D2
|
||||||
|
|8 | D3
|
||||||
|
|9 | D4
|
||||||
|
|10 | D5
|
||||||
|
|11 | D6
|
||||||
|
|12 | Strobe
|
||||||
|
|13 | Out
|
||||||
|
|14 | PE
|
||||||
|
|15 | NC
|
||||||
|
|
||||||
|
the above connector is actually numbered so it should be easier to determine
|
||||||
|
where the needed connections are.
|
||||||
|
|
||||||
|
to connect to the teensy, the following are pins are needed (if you should choose not set your own):
|
||||||
|
* PB0 -> PB6 are connected to D0 -> D6
|
||||||
|
* +5V is connected to the corresponding teensy pin
|
||||||
|
* gnd is as well, only one of the gnd pins needs to be connected though.
|
||||||
|
* strobe is connected to pin PD1
|
||||||
|
* data is connected to PD0
|
||||||
|
* PE does not need to be connected to anything, but it could also be connected to gnd
|
||||||
|
|
||||||
|
sources:
|
||||||
|
http://www.retrocomputing.eu/documents/5291_MaintenanceLibrary.pdf
|
||||||
@@ -0,0 +1,72 @@
|
|||||||
|
# MCU name
|
||||||
|
#MCU = at90usb1287
|
||||||
|
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
|
||||||
|
# This definition is optional, and if your keyboard supports multiple bootloaders of
|
||||||
|
# different sizes, comment this out, and the correct address will be loaded
|
||||||
|
# automatically (+60). See bootloader.mk for all options.
|
||||||
|
BOOTLOADER = halfkay
|
||||||
|
|
||||||
|
# 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 = no # Mouse keys(+4700)
|
||||||
|
EXTRAKEY_ENABLE = no # 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 = no # Enable WS2812 RGB underlight.
|
||||||
|
API_SYSEX_ENABLE = no
|
||||||
|
SPLIT_KEYBOARD = no
|
||||||
|
WAIT_FOR_USB = 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
|
||||||
|
|
||||||
|
LAYOUTS_HAS_RGB = NO
|
||||||
|
|
||||||
|
CUSTOM_MATRIX = yes
|
||||||
|
SRC = matrix.c
|
||||||
@@ -41,5 +41,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#define RGBLIGHT_HUE_STEP 8
|
#define RGBLIGHT_HUE_STEP 8
|
||||||
#define RGBLIGHT_SAT_STEP 8
|
#define RGBLIGHT_SAT_STEP 8
|
||||||
#define RGBLIGHT_VAL_STEP 8
|
#define RGBLIGHT_VAL_STEP 8
|
||||||
#define RGBLIGHT_LIMIT_VAL 120
|
#define RGBLIGHT_LIMIT_VAL 100
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef AUDIO_ENABLE
|
||||||
|
#define B6_AUDIO
|
||||||
|
// #define NO_MUSIC_MODE
|
||||||
#endif
|
#endif
|
||||||
@@ -26,10 +26,10 @@ enum crkbd_keycodes {
|
|||||||
K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \
|
K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \
|
||||||
) \
|
) \
|
||||||
LAYOUT_wrapper( \
|
LAYOUT_wrapper( \
|
||||||
KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_BSPC, \
|
KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_MINS, \
|
||||||
KC_TAB, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_QUOT, \
|
KC_TAB, ALT_T(K11), K12, K13, K14, K15, K16, K17, K18, K19, K1A, RGUI_T(KC_QUOT), \
|
||||||
OS_LSFT, CTL_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, CTL_T(K2A), OS_RSFT, \
|
OS_LSFT, CTL_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, CTL_T(K2A), OS_RSFT, \
|
||||||
LT(_LOWER,KC_GRV), KC_SPC, LALT_T(KC_BSPC), KC_DEL, KC_ENT, RAISE \
|
LT(_LOWER,KC_GRV), KC_SPC, KC_BSPC, KC_DEL, KC_ENT, RAISE \
|
||||||
)
|
)
|
||||||
#define LAYOUT_crkbd_base_wrapper(...) LAYOUT_crkbd_base(__VA_ARGS__)
|
#define LAYOUT_crkbd_base_wrapper(...) LAYOUT_crkbd_base(__VA_ARGS__)
|
||||||
|
|
||||||
@@ -66,14 +66,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||||||
),
|
),
|
||||||
|
|
||||||
[_LOWER] = LAYOUT_wrapper(
|
[_LOWER] = LAYOUT_wrapper(
|
||||||
KC_TILD, _________________LOWER_L1__________________, _________________LOWER_R1__________________, KC_BSPC,
|
KC_F11, _________________LOWER_L1__________________, _________________LOWER_R1__________________, KC_F11,
|
||||||
KC_F11, _________________LOWER_L2__________________, _________________LOWER_R2__________________, KC_PIPE,
|
KC_F12, _________________LOWER_L2__________________, _________________LOWER_R2__________________, KC_PIPE,
|
||||||
KC_F12, _________________LOWER_L3__________________, _________________LOWER_R3__________________, _______,
|
_______, _________________LOWER_L3__________________, _________________LOWER_R3__________________, _______,
|
||||||
_______, _______, _______, _______, _______, _______
|
_______, _______, _______, _______, _______, _______
|
||||||
),
|
),
|
||||||
|
|
||||||
[_RAISE] = LAYOUT_wrapper( \
|
[_RAISE] = LAYOUT_wrapper( \
|
||||||
KC_GRV, _________________RAISE_L1__________________, _________________RAISE_R1__________________, KC_BSPC,
|
_______, _________________RAISE_L1__________________, _________________RAISE_R1__________________, _______,
|
||||||
_______, _________________RAISE_L2__________________, _________________RAISE_R2__________________, KC_BSLS,
|
_______, _________________RAISE_L2__________________, _________________RAISE_R2__________________, KC_BSLS,
|
||||||
_______, _________________RAISE_L3__________________, _________________RAISE_R3__________________, _______,
|
_______, _________________RAISE_L3__________________, _________________RAISE_R3__________________, _______,
|
||||||
_______, _______, _______, _______, _______, _______
|
_______, _______, _______, _______, _______, _______
|
||||||
@@ -81,18 +81,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||||||
|
|
||||||
[_ADJUST] = LAYOUT_wrapper( \
|
[_ADJUST] = LAYOUT_wrapper( \
|
||||||
KC_MAKE, _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, KC_RESET,
|
KC_MAKE, _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, KC_RESET,
|
||||||
VRSN, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, EPRM,
|
VRSN, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, EEP_RST,
|
||||||
TG_MODS, _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, KC_MPLY,
|
_______, _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, KC_MPLY,
|
||||||
_______, _______, _______, _______, _______, _______
|
_______, _______, _______, KC_NUKE, TG_MODS, _______
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
|
||||||
int RGB_current_mode;
|
|
||||||
|
|
||||||
void matrix_init_keymap(void) {
|
void matrix_init_keymap(void) {
|
||||||
#ifdef RGBLIGHT_ENABLE
|
|
||||||
RGB_current_mode = rgblight_config.mode;
|
|
||||||
#endif
|
|
||||||
//SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h
|
//SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h
|
||||||
#ifdef SSD1306OLED
|
#ifdef SSD1306OLED
|
||||||
iota_gfx_init(!has_usb()); // turns on the display
|
iota_gfx_init(!has_usb()); // turns on the display
|
||||||
@@ -102,53 +97,118 @@ void matrix_init_keymap(void) {
|
|||||||
PORTD &= ~(1<<5);
|
PORTD &= ~(1<<5);
|
||||||
|
|
||||||
DDRB &= ~(1<<0);
|
DDRB &= ~(1<<0);
|
||||||
PORTB &= ~(1<<0);}
|
PORTB &= ~(1<<0);
|
||||||
|
}
|
||||||
|
|
||||||
//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h
|
//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h
|
||||||
#ifdef SSD1306OLED
|
#ifdef SSD1306OLED
|
||||||
|
|
||||||
// When add source files to SRC in rules.mk, you can use functions.
|
// When add source files to SRC in rules.mk, you can use functions.
|
||||||
const char *read_layer_state(void);
|
|
||||||
const char *read_logo(void);
|
const char *read_logo(void);
|
||||||
void set_keylog(uint16_t keycode, keyrecord_t *record);
|
|
||||||
const char *read_keylog(void);
|
|
||||||
const char *read_keylogs(void);
|
|
||||||
char layer_state_str[24];
|
char layer_state_str[24];
|
||||||
|
char modifier_state_str[24];
|
||||||
|
char host_led_state_str[24];
|
||||||
|
char keylog_str[24] = {};
|
||||||
|
char keylogs_str[21] = {};
|
||||||
|
int keylogs_str_idx = 0;
|
||||||
|
|
||||||
// const char *read_mode_icon(bool swap);
|
// const char *read_mode_icon(bool swap);
|
||||||
const char *read_host_led_state(void);
|
|
||||||
// void set_timelog(void);
|
// void set_timelog(void);
|
||||||
// const char *read_timelog(void);
|
// const char *read_timelog(void);
|
||||||
|
|
||||||
|
const char code_to_name[60] = {
|
||||||
|
' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f',
|
||||||
|
'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p',
|
||||||
|
'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
|
||||||
|
'1', '2', '3', '4', '5', '6', '7', '8', '9', '0',
|
||||||
|
'R', 'E', 'B', 'T', '_', '-', '=', '[', ']', '\\',
|
||||||
|
'#', ';', '\'', '`', ',', '.', '/', ' ', ' ', ' '};
|
||||||
|
|
||||||
|
void set_keylog(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
char name = ' ';
|
||||||
|
if (keycode < 60) {
|
||||||
|
name = code_to_name[keycode];
|
||||||
|
}
|
||||||
|
|
||||||
|
// update keylog
|
||||||
|
snprintf(keylog_str, sizeof(keylog_str), "%dx%d, k%2d : %c",
|
||||||
|
record->event.key.row, record->event.key.col,
|
||||||
|
keycode, name);
|
||||||
|
|
||||||
|
// update keylogs
|
||||||
|
if (keylogs_str_idx == sizeof(keylogs_str) - 1) {
|
||||||
|
keylogs_str_idx = 0;
|
||||||
|
for (int i = 0; i < sizeof(keylogs_str) - 1; i++) {
|
||||||
|
keylogs_str[i] = ' ';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
keylogs_str[keylogs_str_idx] = name;
|
||||||
|
keylogs_str_idx++;
|
||||||
|
}
|
||||||
|
|
||||||
|
const char *read_keylog(void) {
|
||||||
|
return keylog_str;
|
||||||
|
}
|
||||||
|
|
||||||
|
const char *read_keylogs(void) {
|
||||||
|
return keylogs_str;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const char* read_modifier_state(void) {
|
||||||
|
uint8_t modifiers = get_mods();
|
||||||
|
uint8_t one_shot = get_oneshot_mods();
|
||||||
|
|
||||||
|
snprintf(modifier_state_str, sizeof(modifier_state_str), "Mods:%s %s %s %s",
|
||||||
|
(modifiers & MODS_CTRL_MASK || one_shot & MODS_CTRL_MASK) ? "CTL" : " ",
|
||||||
|
(modifiers & MODS_GUI_MASK || one_shot & MODS_GUI_MASK) ? "GUI" : " ",
|
||||||
|
(modifiers & MODS_ALT_MASK || one_shot & MODS_ALT_MASK) ? "ALT" : " ",
|
||||||
|
(modifiers & MODS_SHIFT_MASK || one_shot & MODS_SHIFT_MASK) ? "SFT" : " "
|
||||||
|
);
|
||||||
|
|
||||||
|
return modifier_state_str;
|
||||||
|
}
|
||||||
|
|
||||||
|
const char *read_host_led_state(void) {
|
||||||
|
uint8_t leds = host_keyboard_leds();
|
||||||
|
|
||||||
|
snprintf(host_led_state_str, sizeof(host_led_state_str), "NL:%s CL:%s SL:%s",
|
||||||
|
(leds & (1 << USB_LED_NUM_LOCK)) ? "on" : "- ",
|
||||||
|
(leds & (1 << USB_LED_CAPS_LOCK)) ? "on" : "- ",
|
||||||
|
(leds & (1 << USB_LED_SCROLL_LOCK)) ? "on" : "- "
|
||||||
|
);
|
||||||
|
|
||||||
|
return host_led_state_str;
|
||||||
|
}
|
||||||
|
|
||||||
const char* read_layer_state(void) {
|
const char* read_layer_state(void) {
|
||||||
switch (layer_state) {
|
switch (biton32(layer_state)) {
|
||||||
case _QWERTY:
|
case _RAISE:
|
||||||
switch (default_layer_state) {
|
snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Raise ");
|
||||||
|
break;
|
||||||
|
case _LOWER:
|
||||||
|
snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Lower ");
|
||||||
|
break;
|
||||||
|
case _ADJUST:
|
||||||
|
snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Adjust ");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
switch (biton32(default_layer_state)) {
|
||||||
case _QWERTY:
|
case _QWERTY:
|
||||||
snprintf(layer_state_str, sizeof(layer_state_str), "Layer: QWERTY");
|
snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Qwerty ");
|
||||||
break;
|
break;
|
||||||
case _COLEMAK:
|
case _COLEMAK:
|
||||||
snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Colemak");
|
snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Colemak");
|
||||||
break;
|
break;
|
||||||
case _DVORAK:
|
case _DVORAK:
|
||||||
snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Dvorak");
|
snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Dvorak ");
|
||||||
break;
|
break;
|
||||||
case _WORKMAN:
|
case _WORKMAN:
|
||||||
snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Workman");
|
snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Workman");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case _RAISE:
|
|
||||||
snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Raise");
|
|
||||||
break;
|
|
||||||
case _LOWER:
|
|
||||||
snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Lower");
|
|
||||||
break;
|
|
||||||
case _ADJUST:
|
|
||||||
snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Adjust");
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Undef-%ld", layer_state);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return layer_state_str;
|
return layer_state_str;
|
||||||
@@ -160,12 +220,13 @@ void matrix_scan_keymap(void) {
|
|||||||
|
|
||||||
void matrix_render_user(struct CharacterMatrix *matrix) {
|
void matrix_render_user(struct CharacterMatrix *matrix) {
|
||||||
if (is_master) {
|
if (is_master) {
|
||||||
// If you want to change the display of OLED, you need to change here
|
//If you want to change the display of OLED, you need to change here
|
||||||
matrix_write_ln(matrix, read_layer_state());
|
matrix_write_ln(matrix, read_layer_state());
|
||||||
matrix_write_ln(matrix, read_keylog());
|
matrix_write_ln(matrix, read_modifier_state());
|
||||||
|
// matrix_write_ln(matrix, read_keylog());
|
||||||
matrix_write_ln(matrix, read_keylogs());
|
matrix_write_ln(matrix, read_keylogs());
|
||||||
//matrix_write_ln(matrix, read_mode_icon(keymap_config.swap_lalt_lgui));
|
// matrix_write_ln(matrix, read_mode_icon(keymap_config.swap_lalt_lgui));
|
||||||
matrix_write_ln(matrix, read_host_led_state());
|
matrix_write(matrix, read_host_led_state());
|
||||||
//matrix_write_ln(matrix, read_timelog());
|
//matrix_write_ln(matrix, read_timelog());
|
||||||
} else {
|
} else {
|
||||||
matrix_write(matrix, read_logo());
|
matrix_write(matrix, read_logo());
|
||||||
@@ -187,8 +248,14 @@ void iota_gfx_task_user(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
|
bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
|
||||||
if (record->event.pressed) {
|
switch (keycode) {
|
||||||
set_keylog(keycode, record);
|
case KC_A ... KC_SLASH:
|
||||||
|
case KC_F1 ... KC_F12:
|
||||||
|
case KC_INSERT ... KC_UP:
|
||||||
|
case KC_KP_SLASH ... KC_KP_DOT:
|
||||||
|
case KC_F13 ... KC_F24:
|
||||||
|
if (record->event.pressed) { set_keylog(keycode, record); }
|
||||||
|
break;
|
||||||
// set_timelog();
|
// set_timelog();
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -20,12 +20,14 @@ SWAP_HANDS_ENABLE = no # Enable one-hand typing
|
|||||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||||
|
|
||||||
|
BOOTLOADER = qmk-dfu
|
||||||
|
|
||||||
# If you want to change the display of OLED, you need to change here
|
# If you want to change the display of OLED, you need to change here
|
||||||
SRC += ./lib/glcdfont.c \
|
SRC += ./lib/glcdfont.c \
|
||||||
./lib/rgb_state_reader.c \
|
./lib/rgb_state_reader.c \
|
||||||
./lib/logo_reader.c \
|
./lib/logo_reader.c \
|
||||||
./lib/keylogger.c \
|
# ./lib/keylogger.c \
|
||||||
./lib/host_led_state_reader.c \
|
# ./lib/host_led_state_reader.c \
|
||||||
# ./lib/layer_state_reader.c \
|
|
||||||
# ./lib/mode_icon_reader.c \
|
# ./lib/mode_icon_reader.c \
|
||||||
|
# ./lib/layer_state_reader.c \
|
||||||
# ./lib/timelogger.c \
|
# ./lib/timelogger.c \
|
||||||
@@ -1,12 +1,16 @@
|
|||||||
{
|
{
|
||||||
"keyboard_name": "Octagon V2",
|
"keyboard_name": "Octagon V2",
|
||||||
"url": "",
|
"url": "",
|
||||||
"maintainer": "qmk",
|
"maintainer": "qmk",
|
||||||
"width": 16,
|
"width": 16,
|
||||||
"height": 6,
|
"height": 6,
|
||||||
"layouts": {
|
"layouts": {
|
||||||
"LAYOUT": {
|
"LAYOUT": {
|
||||||
"layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":1, "y":0}, {"label":"F2", "x":2, "y":0}, {"label":"F3", "x":3, "y":0}, {"label":"F4", "x":4, "y":0}, {"label":"F5", "x":5, "y":0}, {"label":"F6", "x":6, "y":0}, {"label":"F7", "x":7, "y":0}, {"label":"F8", "x":8, "y":0}, {"label":"F9", "x":9, "y":0}, {"label":"F10", "x":10, "y":0}, {"label":"F11", "x":11, "y":0}, {"label":"F12", "x":12, "y":0}, {"label":"PrtSc", "x":13, "y":0}, {"label":"Pause", "x":14, "y":0}, {"label":"Delete", "x":15, "y":0}, {"label":"~", "x":0, "y":1}, {"label":"!", "x":1, "y":1}, {"label":"@", "x":2, "y":1}, {"label":"#", "x":3, "y":1}, {"label":"$", "x":4, "y":1}, {"label":"%", "x":5, "y":1}, {"label":"^", "x":6, "y":1}, {"label":"&", "x":7, "y":1}, {"label":"*", "x":8, "y":1}, {"label":"(", "x":9, "y":1}, {"label":")", "x":10, "y":1}, {"label":"_", "x":11, "y":1}, {"label":"+", "x":12, "y":1}, {"label":"Backspace", "x":13, "y":1, "w":2}, {"label":"Home", "x":15, "y":1}, {"label":"Tab", "x":0, "y":2, "w":1.5}, {"label":"Q", "x":1.5, "y":2}, {"label":"W", "x":2.5, "y":2}, {"label":"E", "x":3.5, "y":2}, {"label":"R", "x":4.5, "y":2}, {"label":"T", "x":5.5, "y":2}, {"label":"Y", "x":6.5, "y":2}, {"label":"U", "x":7.5, "y":2}, {"label":"I", "x":8.5, "y":2}, {"label":"O", "x":9.5, "y":2}, {"label":"P", "x":10.5, "y":2}, {"label":"{", "x":11.5, "y":2}, {"label":"}", "x":12.5, "y":2}, {"label":"|", "x":13.5, "y":2, "w":1.5}, {"label":"Page Up", "x":15, "y":2}, {"label":"Caps Lock", "x":0, "y":3, "w":1.75}, {"label":"A", "x":1.75, "y":3}, {"label":"S", "x":2.75, "y":3}, {"label":"D", "x":3.75, "y":3}, {"label":"F", "x":4.75, "y":3}, {"label":"G", "x":5.75, "y":3}, {"label":"H", "x":6.75, "y":3}, {"label":"J", "x":7.75, "y":3}, {"label":"K", "x":8.75, "y":3}, {"label":"L", "x":9.75, "y":3}, {"label":":", "x":10.75, "y":3}, {"label":"\"", "x":11.75, "y":3}, {"x":12.75, "y":3}, {"label":"Enter", "x":13.75, "y":3, "w":1.25}, {"label":"Page Down", "x":15, "y":3}, {"label":"Shift", "x":0, "y":4, "w":1.25}, {"x":1.25, "y":4}, {"label":"Z", "x":2.25, "y":4}, {"label":"X", "x":3.25, "y":4}, {"label":"C", "x":4.25, "y":4}, {"label":"V", "x":5.25, "y":4}, {"label":"B", "x":6.25, "y":4}, {"label":"N", "x":7.25, "y":4}, {"label":"M", "x":8.25, "y":4}, {"label":"<", "x":9.25, "y":4}, {"label":">", "x":10.25, "y":4}, {"label":"?", "x":11.25, "y":4}, {"label":"Shift", "x":12.25, "y":4, "w":1.75}, {"label":"\u2191", "x":14, "y":4}, {"label":"End", "x":15, "y":4}, {"label":"Ctrl", "x":0, "y":5, "w":1.25}, {"label":"Win", "x":1.25, "y":5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5, "w":1.25}, {"x":3.75, "y":5, "w":6.25}, {"label":"Alt", "x":10, "y":5}, {"label":"Fn", "x":11, "y":5}, {"label":"Ctrl", "x":12, "y":5}, {"label":"\u2190", "x":13, "y":5}, {"label":"\u2193", "x":14, "y":5}, {"label":"\u2192", "x":15, "y":5}]
|
"layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":1, "y":0}, {"label":"F2", "x":2, "y":0}, {"label":"F3", "x":3, "y":0}, {"label":"F4", "x":4, "y":0}, {"label":"F5", "x":5, "y":0}, {"label":"F6", "x":6, "y":0}, {"label":"F7", "x":7, "y":0}, {"label":"F8", "x":8, "y":0}, {"label":"F9", "x":9, "y":0}, {"label":"F10", "x":10, "y":0}, {"label":"F11", "x":11, "y":0}, {"label":"F12", "x":12, "y":0}, {"label":"PrtSc", "x":13, "y":0}, {"label":"Pause", "x":14, "y":0}, {"label":"Delete", "x":15, "y":0}, {"label":"~", "x":0, "y":1}, {"label":"!", "x":1, "y":1}, {"label":"@", "x":2, "y":1}, {"label":"#", "x":3, "y":1}, {"label":"$", "x":4, "y":1}, {"label":"%", "x":5, "y":1}, {"label":"^", "x":6, "y":1}, {"label":"&", "x":7, "y":1}, {"label":"*", "x":8, "y":1}, {"label":"(", "x":9, "y":1}, {"label":")", "x":10, "y":1}, {"label":"_", "x":11, "y":1}, {"label":"+", "x":12, "y":1}, {"label":"Backspace", "x":13, "y":1, "w":2}, {"label":"Home", "x":15, "y":1}, {"label":"Tab", "x":0, "y":2, "w":1.5}, {"label":"Q", "x":1.5, "y":2}, {"label":"W", "x":2.5, "y":2}, {"label":"E", "x":3.5, "y":2}, {"label":"R", "x":4.5, "y":2}, {"label":"T", "x":5.5, "y":2}, {"label":"Y", "x":6.5, "y":2}, {"label":"U", "x":7.5, "y":2}, {"label":"I", "x":8.5, "y":2}, {"label":"O", "x":9.5, "y":2}, {"label":"P", "x":10.5, "y":2}, {"label":"{", "x":11.5, "y":2}, {"label":"}", "x":12.5, "y":2}, {"label":"|", "x":13.5, "y":2, "w":1.5}, {"label":"Page Up", "x":15, "y":2}, {"label":"Caps Lock", "x":0, "y":3, "w":1.75}, {"label":"A", "x":1.75, "y":3}, {"label":"S", "x":2.75, "y":3}, {"label":"D", "x":3.75, "y":3}, {"label":"F", "x":4.75, "y":3}, {"label":"G", "x":5.75, "y":3}, {"label":"H", "x":6.75, "y":3}, {"label":"J", "x":7.75, "y":3}, {"label":"K", "x":8.75, "y":3}, {"label":"L", "x":9.75, "y":3}, {"label":":", "x":10.75, "y":3}, {"label":"\"", "x":11.75, "y":3}, {"x":12.75, "y":3}, {"label":"Enter", "x":13.75, "y":3, "w":1.25}, {"label":"Page Down", "x":15, "y":3}, {"label":"Shift", "x":0, "y":4, "w":1.25}, {"x":1.25, "y":4}, {"label":"Z", "x":2.25, "y":4}, {"label":"X", "x":3.25, "y":4}, {"label":"C", "x":4.25, "y":4}, {"label":"V", "x":5.25, "y":4}, {"label":"B", "x":6.25, "y":4}, {"label":"N", "x":7.25, "y":4}, {"label":"M", "x":8.25, "y":4}, {"label":"<", "x":9.25, "y":4}, {"label":">", "x":10.25, "y":4}, {"label":"?", "x":11.25, "y":4}, {"label":"Shift", "x":12.25, "y":4, "w":1.75}, {"label":"\u2191", "x":14, "y":4}, {"label":"End", "x":15, "y":4}, {"label":"Ctrl", "x":0, "y":5, "w":1.25}, {"label":"Win", "x":1.25, "y":5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5, "w":1.25}, {"x":3.75, "y":5, "w":6.25}, {"label":"Alt", "x":10, "y":5}, {"label":"Fn", "x":11, "y":5}, {"label":"Ctrl", "x":12, "y":5}, {"label":"\u2190", "x":13, "y":5}, {"label":"\u2193", "x":14, "y":5}, {"label":"\u2192", "x":15, "y":5}]
|
||||||
|
},
|
||||||
|
|
||||||
|
"LAYOUT_75_ansi": {
|
||||||
|
"layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":15, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":6, "y":1}, {"x":7, "y":1}, {"x":8, "y":1}, {"x":9, "y":1}, {"x":10, "y":1}, {"x":11, "y":1}, {"x":12, "y":1}, {"x":13, "y":1, "w":2}, {"x":15, "y":1}, {"x":0, "y":2, "w":1.5}, {"x":1.5, "y":2}, {"x":2.5, "y":2}, {"x":3.5, "y":2}, {"x":4.5, "y":2}, {"x":5.5, "y":2}, {"x":6.5, "y":2}, {"x":7.5, "y":2}, {"x":8.5, "y":2}, {"x":9.5, "y":2}, {"x":10.5, "y":2}, {"x":11.5, "y":2}, {"x":12.5, "y":2}, {"x":13.5, "y":2, "w":1.5}, {"x":15, "y":2}, {"x":0, "y":3, "w":1.75}, {"x":1.75, "y":3}, {"x":2.75, "y":3}, {"x":3.75, "y":3}, {"x":4.75, "y":3}, {"x":5.75, "y":3}, {"x":6.75, "y":3}, {"x":7.75, "y":3}, {"x":8.75, "y":3}, {"x":9.75, "y":3}, {"x":10.75, "y":3}, {"x":11.75, "y":3}, {"x":12.75, "y":3, "w":2.25}, {"x":15, "y":3}, {"x":0, "y":4, "w":2.25}, {"x":2.25, "y":4}, {"x":3.25, "y":4}, {"x":4.25, "y":4}, {"x":5.25, "y":4}, {"x":6.25, "y":4}, {"x":7.25, "y":4}, {"x":8.25, "y":4}, {"x":9.25, "y":4}, {"x":10.25, "y":4}, {"x":11.25, "y":4}, {"x":12.25, "y":4, "w":1.75}, {"x":14, "y":4}, {"x":15, "y":4}, {"x":0, "y":5, "w":1.25}, {"x":1.25, "y":5, "w":1.25}, {"x":2.5, "y":5, "w":1.25}, {"x":3.75, "y":5, "w":6.25}, {"x":10, "y":5}, {"x":11, "y":5}, {"x":12, "y":5}, {"x":13, "y":5}, {"x":14, "y":5}, {"x":15, "y":5}]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -170,6 +170,33 @@
|
|||||||
{ k40, k41, KC_NO, k43, KC_NO, KC_NO, k46, KC_NO, KC_NO, KC_NO, k4a, k4b, KC_NO, k4d, k4e } \
|
{ k40, k41, KC_NO, k43, KC_NO, KC_NO, k46, KC_NO, KC_NO, KC_NO, k4a, k4b, KC_NO, k4d, k4e } \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* LAYOUT_60_ansi_split
|
||||||
|
* ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐
|
||||||
|
* │00 │01 │02 │03 │04 │05 │06 │07 │08 │09 │0a │0b │0c │0e │
|
||||||
|
* ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤
|
||||||
|
* │10 │12 │13 │14 │15 │16 │17 │18 │19 │1a │1b │1c │1d │1e │
|
||||||
|
* ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤
|
||||||
|
* │20 │22 │23 │24 │25 │26 │27 │28 │29 │2a │2b │2c │2d │
|
||||||
|
* ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤
|
||||||
|
* │30 │32 │33 │34 │35 │36 │37 │38 │39 │3a │3b │3d │
|
||||||
|
* ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤
|
||||||
|
* │40 │41 │43 │44 │46 │48 │4a │4b │4d │4e │
|
||||||
|
* └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘
|
||||||
|
*/
|
||||||
|
#define LAYOUT_60_ansi_split( \
|
||||||
|
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0e, \
|
||||||
|
k10, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e, \
|
||||||
|
k20, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, \
|
||||||
|
k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3d, \
|
||||||
|
k40, k41, k43, k44, k46, k48, k4a, k4b, k4d, k4e \
|
||||||
|
) { \
|
||||||
|
{ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, KC_NO, k0e }, \
|
||||||
|
{ k10, KC_NO, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e }, \
|
||||||
|
{ k20, KC_NO, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, KC_NO }, \
|
||||||
|
{ k30, KC_NO, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, KC_NO, k3d, KC_NO }, \
|
||||||
|
{ k40, k41, KC_NO, k43, k44, KC_NO, k46, KC_NO, k48, KC_NO, k4a, k4b, KC_NO, k4d, k4e } \
|
||||||
|
}
|
||||||
|
|
||||||
/* LAYOUT_60_iso
|
/* LAYOUT_60_iso
|
||||||
* ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐
|
* ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐
|
||||||
* │00 │01 │02 │03 │04 │05 │06 │07 │08 │09 │0a │0b │0c │0e │
|
* │00 │01 │02 │03 │04 │05 │06 │07 │08 │09 │0a │0b │0c │0e │
|
||||||
|
|||||||
@@ -25,6 +25,10 @@
|
|||||||
"key_count": 61,
|
"key_count": 61,
|
||||||
"layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"CapsLock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}]
|
"layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"CapsLock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}]
|
||||||
},
|
},
|
||||||
|
"LAYOUT_60_ansi_split": {
|
||||||
|
"key_count": 61,
|
||||||
|
"layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"CapsLock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":2.25}, {"label":"FN", "x":6.00, "y":4, "w":1.25}, {"x":7.25, "y":4, "w":2.75}, {"label":"AltGr", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}]
|
||||||
|
},
|
||||||
"LAYOUT_60_iso": {
|
"LAYOUT_60_iso": {
|
||||||
"key_count": 62,
|
"key_count": 62,
|
||||||
"layout": [{"label":"¬", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"\"", "x":2, "y":0}, {"label":"£", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"CapsLock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"@", "x":11.75, "y":2}, {"label":"~", "x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"|", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"AltGr", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}]
|
"layout": [{"label":"¬", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"\"", "x":2, "y":0}, {"label":"£", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"CapsLock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"@", "x":11.75, "y":2}, {"label":"~", "x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"|", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"AltGr", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}]
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Each layer gets a name for readability.
|
||||||
|
* 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, and you can also skip them entirely
|
||||||
|
* and just use numbers.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#define BL 0 // Base Layer
|
||||||
|
#define FL 1 // Function Layer
|
||||||
|
#define ML 2 // Macro Layer
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
|
||||||
|
[BL] = LAYOUT_60_ansi_split(
|
||||||
|
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_BSLS,
|
||||||
|
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
|
||||||
|
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
|
||||||
|
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(FL), KC_SPC, KC_RALT, KC_RGUI, MO(ML), KC_RCTL),
|
||||||
|
|
||||||
|
[FL] = LAYOUT_60_ansi_split(
|
||||||
|
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_DEL,
|
||||||
|
_______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, KC_PSCR, KC_SLCK, KC_PAUS, RESET,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, KC_HOME, KC_PGUP, _______,
|
||||||
|
_______, _______, _______, BL_DEC, BL_TOGG, BL_INC, BL_STEP, _______, KC_DEL, KC_END, KC_PGDN, _______,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______),
|
||||||
|
|
||||||
|
|
||||||
|
[ML] = LAYOUT_60_ansi_split(
|
||||||
|
_______, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, _______,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______),
|
||||||
|
|
||||||
|
};
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include "ep40.h"
|
#include "40.h"
|
||||||
|
|
||||||
void matrix_init_kb(void) {
|
void matrix_init_kb(void) {
|
||||||
// put your keyboard start-up code here
|
// put your keyboard start-up code here
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -4,12 +4,12 @@
|
|||||||
|
|
||||||
A simple 40% keyboard
|
A simple 40% keyboard
|
||||||
|
|
||||||
Keyboard Maintainer: [Elliot Powell](https://reddit.com/u/e11i0t23, https://github.com/e11i0t23)
|
Keyboard Maintainer: [Elliot Powell](https://github.com/e11i0t23), [/u/e11i0t23 on reddit](https://reddit.com/u/e11i0t23)
|
||||||
Hardware Supported: EP40 PCB
|
Hardware Supported: EP40 PCB
|
||||||
Hardware Availability: None at the moment
|
Hardware Availability: None at the moment
|
||||||
|
|
||||||
Make example for this keyboard (after setting up your build environment):
|
Make example for this keyboard (after setting up your build environment):
|
||||||
|
|
||||||
make ep40:default
|
make ep/40: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).
|
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).
|
||||||
File renamed without changes.
@@ -0,0 +1,43 @@
|
|||||||
|
/* Copyright 2018 Elliot Powell
|
||||||
|
*
|
||||||
|
* 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 "96.h"
|
||||||
|
|
||||||
|
void matrix_init_kb(void) {
|
||||||
|
// put your keyboard start-up code here
|
||||||
|
// runs once when the firmware starts up
|
||||||
|
|
||||||
|
matrix_init_user();
|
||||||
|
}
|
||||||
|
|
||||||
|
void matrix_scan_kb(void) {
|
||||||
|
// 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
|
||||||
|
|
||||||
|
led_set_user(usb_led);
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
/* Copyright 2018 Elliot Powell
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#ifndef EP96_H
|
||||||
|
#define EP96_H
|
||||||
|
|
||||||
|
#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 xxxx KC_NO
|
||||||
|
|
||||||
|
#define LAYOUT( \
|
||||||
|
K000, K001, K002, k003, k004, k005, k006, k007, k008, k009, k010, k011, k012, k013, k014, k015, k016, k017, k018, \
|
||||||
|
K100, K101, K102, k103, k104, k105, k106, k107, k108, k109, k110, k111, k112, k114, k115, k116, k117, k118, \
|
||||||
|
K200, K202, k203, k204, k205, k206, k207, k208, k209, k210, k211, k212, k213, k215, k216, k217, \
|
||||||
|
K300, K302, k303, k304, k305, k306, k307, k308, k309, k310, k311, k312, k313, k314, k315, k316, k317, k318, \
|
||||||
|
K400, K401, K402, k403, k404, k405, k406, k407, k408, k409, k410, k411, k413, k414, k415, k416, k417, \
|
||||||
|
K500, K501, K502, k506, k511, k512, k513, k514, k515, k516, k517, k518) \
|
||||||
|
{ \
|
||||||
|
{K000, K001, K002, k003, k004, k005, k006, k007, k008, k009, k010, k011, k012, k013, k014, k015, k016, k017, k018}, \
|
||||||
|
{K100, K101, K102, k103, k104, k105, k106, k107, k108, k109, k110, k111, k112, xxxx, k114, k115, k116, k117, k118}, \
|
||||||
|
{K200, xxxx, K202, k203, k204, k205, k206, k207, k208, k209, k210, k211, k212, k213, xxxx, k215, k216, k217, xxxx}, \
|
||||||
|
{K300, xxxx, K302, k303, k304, k305, k306, k307, k308, k309, k310, k311, k312, k313, k314, k315, k316, k317, k318}, \
|
||||||
|
{K400, K401, K402, k403, k404, k405, k406, k407, k408, k409, k410, k411, xxxx, k413, k414, k415, k416, k417, xxxx}, \
|
||||||
|
{K500, K501, K502, xxxx, xxxx, xxxx, k506, xxxx, xxxx, xxxx, xxxx, k511, k512, k513, k514, k515, k516, k517, k518} \
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,212 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2018 Elliot Powell
|
||||||
|
|
||||||
|
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 0x9696
|
||||||
|
#define DEVICE_VER 0x0001
|
||||||
|
#define MANUFACTURER Elliot Powell
|
||||||
|
#define PRODUCT ep96
|
||||||
|
#define DESCRIPTION A simple 96 key keyboard
|
||||||
|
|
||||||
|
/* key matrix size */
|
||||||
|
#define MATRIX_ROWS 6
|
||||||
|
#define MATRIX_COLS 19
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 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 { B0, B1, B3, B2, B7, C6 }
|
||||||
|
#define MATRIX_COL_PINS { D0, D1, D2, D3, D5, D4, D6, D7, B4, B5, B6, C7, F7, F6, F5, F4, F1, F0, E6 }
|
||||||
|
#define UNUSED_PINS
|
||||||
|
|
||||||
|
/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */
|
||||||
|
#define DIODE_DIRECTION COL2ROW
|
||||||
|
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
/* 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
|
||||||
|
|
||||||
|
/* If defined, GRAVE_ESC will always act as ESC when CTRL is held.
|
||||||
|
* This is userful for the Windows task manager shortcut (ctrl+shift+esc).
|
||||||
|
*/
|
||||||
|
// #define GRAVE_ESC_CTRL_OVERRIDE
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 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
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Magic Key Options
|
||||||
|
*
|
||||||
|
* Magic keys are hotkey commands that allow control over firmware functions of
|
||||||
|
* the keyboard. They are best used in combination with the HID Listen program,
|
||||||
|
* found here: https://www.pjrc.com/teensy/hid_listen.html
|
||||||
|
*
|
||||||
|
* The options below allow the magic key functionality to be changed. This is
|
||||||
|
* useful if your keyboard/keypad is missing keys and you want magic key support.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* key combination for magic key command */
|
||||||
|
#define IS_COMMAND() ( \
|
||||||
|
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
|
||||||
|
)
|
||||||
|
|
||||||
|
/* control how magic key switches layers */
|
||||||
|
//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true
|
||||||
|
//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true
|
||||||
|
//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false
|
||||||
|
|
||||||
|
/* override magic key keymap */
|
||||||
|
//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS
|
||||||
|
//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS
|
||||||
|
//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM
|
||||||
|
//#define MAGIC_KEY_HELP1 H
|
||||||
|
//#define MAGIC_KEY_HELP2 SLASH
|
||||||
|
//#define MAGIC_KEY_DEBUG D
|
||||||
|
//#define MAGIC_KEY_DEBUG_MATRIX X
|
||||||
|
//#define MAGIC_KEY_DEBUG_KBD K
|
||||||
|
//#define MAGIC_KEY_DEBUG_MOUSE M
|
||||||
|
//#define MAGIC_KEY_VERSION V
|
||||||
|
//#define MAGIC_KEY_STATUS S
|
||||||
|
//#define MAGIC_KEY_CONSOLE C
|
||||||
|
//#define MAGIC_KEY_LAYER0_ALT1 ESC
|
||||||
|
//#define MAGIC_KEY_LAYER0_ALT2 GRAVE
|
||||||
|
//#define MAGIC_KEY_LAYER0 0
|
||||||
|
//#define MAGIC_KEY_LAYER1 1
|
||||||
|
//#define MAGIC_KEY_LAYER2 2
|
||||||
|
//#define MAGIC_KEY_LAYER3 3
|
||||||
|
//#define MAGIC_KEY_LAYER4 4
|
||||||
|
//#define MAGIC_KEY_LAYER5 5
|
||||||
|
//#define MAGIC_KEY_LAYER6 6
|
||||||
|
//#define MAGIC_KEY_LAYER7 7
|
||||||
|
//#define MAGIC_KEY_LAYER8 8
|
||||||
|
//#define MAGIC_KEY_LAYER9 9
|
||||||
|
//#define MAGIC_KEY_BOOTLOADER PAUSE
|
||||||
|
//#define MAGIC_KEY_LOCK CAPS
|
||||||
|
//#define MAGIC_KEY_EEPROM E
|
||||||
|
//#define MAGIC_KEY_NKRO N
|
||||||
|
//#define MAGIC_KEY_SLEEP_LED Z
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 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 1
|
||||||
|
|
||||||
|
/*
|
||||||
|
* HD44780 LCD Display Configuration
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
#define LCD_LINES 2 //< number of visible lines of the display
|
||||||
|
#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display
|
||||||
|
|
||||||
|
#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode
|
||||||
|
|
||||||
|
#if LCD_IO_MODE
|
||||||
|
#define LCD_PORT PORTB //< port for the LCD lines
|
||||||
|
#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0
|
||||||
|
#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1
|
||||||
|
#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2
|
||||||
|
#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3
|
||||||
|
#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0
|
||||||
|
#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1
|
||||||
|
#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2
|
||||||
|
#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3
|
||||||
|
#define LCD_RS_PORT LCD_PORT //< port for RS line
|
||||||
|
#define LCD_RS_PIN 3 //< pin for RS line
|
||||||
|
#define LCD_RW_PORT LCD_PORT //< port for RW line
|
||||||
|
#define LCD_RW_PIN 2 //< pin for RW line
|
||||||
|
#define LCD_E_PORT LCD_PORT //< port for Enable line
|
||||||
|
#define LCD_E_PIN 1 //< pin for Enable line
|
||||||
|
#endif
|
||||||
|
*/
|
||||||
|
|
||||||
@@ -0,0 +1,426 @@
|
|||||||
|
{
|
||||||
|
"keyboard_name": "ep96",
|
||||||
|
"maintainer": "e11i0t23",
|
||||||
|
"width": 19,
|
||||||
|
"height": 6,
|
||||||
|
"layouts": {
|
||||||
|
"LAYOUT": {
|
||||||
|
"key_count": 100,
|
||||||
|
"layout": [{
|
||||||
|
"label": "Esc",
|
||||||
|
"x": 0,
|
||||||
|
"y": 0
|
||||||
|
}, {
|
||||||
|
"label": "F1",
|
||||||
|
"x": 1,
|
||||||
|
"y": 0
|
||||||
|
}, {
|
||||||
|
"label": "F2",
|
||||||
|
"x": 2,
|
||||||
|
"y": 0
|
||||||
|
}, {
|
||||||
|
"label": "F3",
|
||||||
|
"x": 3,
|
||||||
|
"y": 0
|
||||||
|
}, {
|
||||||
|
"label": "F4",
|
||||||
|
"x": 4,
|
||||||
|
"y": 0
|
||||||
|
}, {
|
||||||
|
"label": "F5",
|
||||||
|
"x": 5,
|
||||||
|
"y": 0
|
||||||
|
}, {
|
||||||
|
"label": "F6",
|
||||||
|
"x": 6,
|
||||||
|
"y": 0
|
||||||
|
}, {
|
||||||
|
"label": "F7",
|
||||||
|
"x": 7,
|
||||||
|
"y": 0
|
||||||
|
}, {
|
||||||
|
"label": "F8",
|
||||||
|
"x": 8,
|
||||||
|
"y": 0
|
||||||
|
}, {
|
||||||
|
"label": "F9",
|
||||||
|
"x": 9,
|
||||||
|
"y": 0
|
||||||
|
}, {
|
||||||
|
"label": "F10",
|
||||||
|
"x": 10,
|
||||||
|
"y": 0
|
||||||
|
}, {
|
||||||
|
"label": "F11",
|
||||||
|
"x": 11,
|
||||||
|
"y": 0
|
||||||
|
}, {
|
||||||
|
"label": "F12",
|
||||||
|
"x": 12,
|
||||||
|
"y": 0
|
||||||
|
}, {
|
||||||
|
"label": "Prt Sc",
|
||||||
|
"x": 13,
|
||||||
|
"y": 0
|
||||||
|
}, {
|
||||||
|
"label": "Delete",
|
||||||
|
"x": 14,
|
||||||
|
"y": 0
|
||||||
|
}, {
|
||||||
|
"label": "home",
|
||||||
|
"x": 15,
|
||||||
|
"y": 0
|
||||||
|
}, {
|
||||||
|
"label": "Menu",
|
||||||
|
"x": 16,
|
||||||
|
"y": 0
|
||||||
|
}, {
|
||||||
|
"label": "Pg Up",
|
||||||
|
"x": 17,
|
||||||
|
"y": 0
|
||||||
|
}, {
|
||||||
|
"label": "Pg Dn",
|
||||||
|
"x": 18,
|
||||||
|
"y": 0
|
||||||
|
}, {
|
||||||
|
"label": "~",
|
||||||
|
"x": 0,
|
||||||
|
"y": 1
|
||||||
|
}, {
|
||||||
|
"label": "!",
|
||||||
|
"x": 1,
|
||||||
|
"y": 1
|
||||||
|
}, {
|
||||||
|
"label": "@",
|
||||||
|
"x": 2,
|
||||||
|
"y": 1
|
||||||
|
}, {
|
||||||
|
"label": "#",
|
||||||
|
"x": 3,
|
||||||
|
"y": 1
|
||||||
|
}, {
|
||||||
|
"label": "$",
|
||||||
|
"x": 4,
|
||||||
|
"y": 1
|
||||||
|
}, {
|
||||||
|
"label": "%",
|
||||||
|
"x": 5,
|
||||||
|
"y": 1
|
||||||
|
}, {
|
||||||
|
"label": "^",
|
||||||
|
"x": 6,
|
||||||
|
"y": 1
|
||||||
|
}, {
|
||||||
|
"label": "&",
|
||||||
|
"x": 7,
|
||||||
|
"y": 1
|
||||||
|
}, {
|
||||||
|
"label": "*",
|
||||||
|
"x": 8,
|
||||||
|
"y": 1
|
||||||
|
}, {
|
||||||
|
"label": "(",
|
||||||
|
"x": 9,
|
||||||
|
"y": 1
|
||||||
|
}, {
|
||||||
|
"label": ")",
|
||||||
|
"x": 10,
|
||||||
|
"y": 1
|
||||||
|
}, {
|
||||||
|
"label": "_",
|
||||||
|
"x": 11,
|
||||||
|
"y": 1
|
||||||
|
}, {
|
||||||
|
"label": "+",
|
||||||
|
"x": 12,
|
||||||
|
"y": 1
|
||||||
|
}, {
|
||||||
|
"label": "Backspace",
|
||||||
|
"x": 13,
|
||||||
|
"y": 1,
|
||||||
|
"w": 2
|
||||||
|
}, {
|
||||||
|
"label": "Num Lock",
|
||||||
|
"x": 15,
|
||||||
|
"y": 1
|
||||||
|
}, {
|
||||||
|
"label": "/",
|
||||||
|
"x": 16,
|
||||||
|
"y": 1
|
||||||
|
}, {
|
||||||
|
"label": "*",
|
||||||
|
"x": 17,
|
||||||
|
"y": 1
|
||||||
|
}, {
|
||||||
|
"label": "-",
|
||||||
|
"x": 18,
|
||||||
|
"y": 1
|
||||||
|
}, {
|
||||||
|
"label": "Tab",
|
||||||
|
"x": 0,
|
||||||
|
"y": 2,
|
||||||
|
"w": 1.5
|
||||||
|
}, {
|
||||||
|
"label": "Q",
|
||||||
|
"x": 1.5,
|
||||||
|
"y": 2
|
||||||
|
}, {
|
||||||
|
"label": "W",
|
||||||
|
"x": 2.5,
|
||||||
|
"y": 2
|
||||||
|
}, {
|
||||||
|
"label": "E",
|
||||||
|
"x": 3.5,
|
||||||
|
"y": 2
|
||||||
|
}, {
|
||||||
|
"label": "R",
|
||||||
|
"x": 4.5,
|
||||||
|
"y": 2
|
||||||
|
}, {
|
||||||
|
"label": "T",
|
||||||
|
"x": 5.5,
|
||||||
|
"y": 2
|
||||||
|
}, {
|
||||||
|
"label": "Y",
|
||||||
|
"x": 6.5,
|
||||||
|
"y": 2
|
||||||
|
}, {
|
||||||
|
"label": "U",
|
||||||
|
"x": 7.5,
|
||||||
|
"y": 2
|
||||||
|
}, {
|
||||||
|
"label": "I",
|
||||||
|
"x": 8.5,
|
||||||
|
"y": 2
|
||||||
|
}, {
|
||||||
|
"label": "O",
|
||||||
|
"x": 9.5,
|
||||||
|
"y": 2
|
||||||
|
}, {
|
||||||
|
"label": "P",
|
||||||
|
"x": 10.5,
|
||||||
|
"y": 2
|
||||||
|
}, {
|
||||||
|
"label": "{",
|
||||||
|
"x": 11.5,
|
||||||
|
"y": 2
|
||||||
|
}, {
|
||||||
|
"label": "}",
|
||||||
|
"x": 12.5,
|
||||||
|
"y": 2
|
||||||
|
}, {
|
||||||
|
"label": "Enter",
|
||||||
|
"x": 13.75,
|
||||||
|
"y": 2,
|
||||||
|
"w": 1.25,
|
||||||
|
"h": 2
|
||||||
|
}, {
|
||||||
|
"label": "7",
|
||||||
|
"x": 15,
|
||||||
|
"y": 2
|
||||||
|
}, {
|
||||||
|
"label": "8",
|
||||||
|
"x": 16,
|
||||||
|
"y": 2
|
||||||
|
}, {
|
||||||
|
"label": "9",
|
||||||
|
"x": 17,
|
||||||
|
"y": 2
|
||||||
|
}, {
|
||||||
|
"label": "+",
|
||||||
|
"x": 18,
|
||||||
|
"y": 2,
|
||||||
|
"h": 2
|
||||||
|
}, {
|
||||||
|
"label": "Caps Lock",
|
||||||
|
"x": 0,
|
||||||
|
"y": 3,
|
||||||
|
"w": 1.75
|
||||||
|
}, {
|
||||||
|
"label": "A",
|
||||||
|
"x": 1.75,
|
||||||
|
"y": 3
|
||||||
|
}, {
|
||||||
|
"label": "S",
|
||||||
|
"x": 2.75,
|
||||||
|
"y": 3
|
||||||
|
}, {
|
||||||
|
"label": "D",
|
||||||
|
"x": 3.75,
|
||||||
|
"y": 3
|
||||||
|
}, {
|
||||||
|
"label": "F",
|
||||||
|
"x": 4.75,
|
||||||
|
"y": 3
|
||||||
|
}, {
|
||||||
|
"label": "G",
|
||||||
|
"x": 5.75,
|
||||||
|
"y": 3
|
||||||
|
}, {
|
||||||
|
"label": "H",
|
||||||
|
"x": 6.75,
|
||||||
|
"y": 3
|
||||||
|
}, {
|
||||||
|
"label": "J",
|
||||||
|
"x": 7.75,
|
||||||
|
"y": 3
|
||||||
|
}, {
|
||||||
|
"label": "K",
|
||||||
|
"x": 8.75,
|
||||||
|
"y": 3
|
||||||
|
}, {
|
||||||
|
"label": "L",
|
||||||
|
"x": 9.75,
|
||||||
|
"y": 3
|
||||||
|
}, {
|
||||||
|
"label": ":",
|
||||||
|
"x": 10.75,
|
||||||
|
"y": 3
|
||||||
|
}, {
|
||||||
|
"label": "\"",
|
||||||
|
"x": 11.75,
|
||||||
|
"y": 3
|
||||||
|
}, {
|
||||||
|
"label": "~",
|
||||||
|
"x": 12.75,
|
||||||
|
"y": 3
|
||||||
|
}, {
|
||||||
|
"label": "4",
|
||||||
|
"x": 15,
|
||||||
|
"y": 3
|
||||||
|
}, {
|
||||||
|
"label": "5",
|
||||||
|
"x": 16,
|
||||||
|
"y": 3
|
||||||
|
}, {
|
||||||
|
"label": "6",
|
||||||
|
"x": 17,
|
||||||
|
"y": 3
|
||||||
|
}, {
|
||||||
|
"label": "Shift",
|
||||||
|
"x": 0,
|
||||||
|
"y": 4,
|
||||||
|
"w": 1.25
|
||||||
|
}, {
|
||||||
|
"label": "|",
|
||||||
|
"x": 1.25,
|
||||||
|
"y": 4
|
||||||
|
}, {
|
||||||
|
"label": "Z",
|
||||||
|
"x": 2.25,
|
||||||
|
"y": 4
|
||||||
|
}, {
|
||||||
|
"label": "X",
|
||||||
|
"x": 3.25,
|
||||||
|
"y": 4
|
||||||
|
}, {
|
||||||
|
"label": "C",
|
||||||
|
"x": 4.25,
|
||||||
|
"y": 4
|
||||||
|
}, {
|
||||||
|
"label": "V",
|
||||||
|
"x": 5.25,
|
||||||
|
"y": 4
|
||||||
|
}, {
|
||||||
|
"label": "B",
|
||||||
|
"x": 6.25,
|
||||||
|
"y": 4
|
||||||
|
}, {
|
||||||
|
"label": "N",
|
||||||
|
"x": 7.25,
|
||||||
|
"y": 4
|
||||||
|
}, {
|
||||||
|
"label": "M",
|
||||||
|
"x": 8.25,
|
||||||
|
"y": 4
|
||||||
|
}, {
|
||||||
|
"label": "<",
|
||||||
|
"x": 9.25,
|
||||||
|
"y": 4
|
||||||
|
}, {
|
||||||
|
"label": ">",
|
||||||
|
"x": 10.25,
|
||||||
|
"y": 4
|
||||||
|
}, {
|
||||||
|
"label": "?",
|
||||||
|
"x": 11.25,
|
||||||
|
"y": 4
|
||||||
|
}, {
|
||||||
|
"label": "Shift",
|
||||||
|
"x": 12.25,
|
||||||
|
"y": 4,
|
||||||
|
"w": 1.75
|
||||||
|
}, {
|
||||||
|
"label": "\u2191",
|
||||||
|
"x": 14,
|
||||||
|
"y": 4
|
||||||
|
}, {
|
||||||
|
"label": "1",
|
||||||
|
"x": 15,
|
||||||
|
"y": 4
|
||||||
|
}, {
|
||||||
|
"label": "2",
|
||||||
|
"x": 16,
|
||||||
|
"y": 4
|
||||||
|
}, {
|
||||||
|
"label": "3",
|
||||||
|
"x": 17,
|
||||||
|
"y": 4
|
||||||
|
}, {
|
||||||
|
"label": "Enter",
|
||||||
|
"x": 18,
|
||||||
|
"y": 4,
|
||||||
|
"h": 2
|
||||||
|
}, {
|
||||||
|
"label": "Ctrl",
|
||||||
|
"x": 0,
|
||||||
|
"y": 5,
|
||||||
|
"w": 1.25
|
||||||
|
}, {
|
||||||
|
"label": "Win",
|
||||||
|
"x": 1.25,
|
||||||
|
"y": 5,
|
||||||
|
"w": 1.25
|
||||||
|
}, {
|
||||||
|
"label": "Alt",
|
||||||
|
"x": 2.5,
|
||||||
|
"y": 5,
|
||||||
|
"w": 1.25
|
||||||
|
}, {
|
||||||
|
"x": 3.75,
|
||||||
|
"y": 5,
|
||||||
|
"w": 6.25
|
||||||
|
}, {
|
||||||
|
"label": "Alt",
|
||||||
|
"x": 10,
|
||||||
|
"y": 5,
|
||||||
|
"w": 1.5
|
||||||
|
}, {
|
||||||
|
"label": "Crtl",
|
||||||
|
"x": 11.5,
|
||||||
|
"y": 5,
|
||||||
|
"w": 1.5
|
||||||
|
}, {
|
||||||
|
"label": "\u2190",
|
||||||
|
"x": 13,
|
||||||
|
"y": 5
|
||||||
|
}, {
|
||||||
|
"label": "\u2193",
|
||||||
|
"x": 14,
|
||||||
|
"y": 5
|
||||||
|
}, {
|
||||||
|
"label": "\u2192",
|
||||||
|
"x": 15,
|
||||||
|
"y": 5
|
||||||
|
}, {
|
||||||
|
"label": "0",
|
||||||
|
"x": 16,
|
||||||
|
"y": 5
|
||||||
|
}, {
|
||||||
|
"label": ".",
|
||||||
|
"x": 17,
|
||||||
|
"y": 5
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
/* Copyright 2018 Elliot Powell
|
||||||
|
*
|
||||||
|
* 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( /* Base */
|
||||||
|
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_DEL, KC_HOME, KC_END, KC_PGUP, KC_PGDN, \
|
||||||
|
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \
|
||||||
|
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_P7, KC_P8, KC_P9, \
|
||||||
|
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, \
|
||||||
|
KC_LSFT, KC_BSLS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, \
|
||||||
|
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT \
|
||||||
|
),
|
||||||
|
};
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
void matrix_init_user(void) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void matrix_scan_user(void) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void led_set_user(uint8_t usb_led) {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
# The default keymap for ep96
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
# ep96
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
A simple 96 key keyboard
|
||||||
|
|
||||||
|
Keyboard Maintainer: Keyboard Maintainer: [Elliot Powell](https://github.com/e11i0t23), [/u/e11i0t23](https://reddit.com/u/e11i0t23)
|
||||||
|
Hardware Supported: EP96 PCB
|
||||||
|
Hardware Availability: Possible availability upon request
|
||||||
|
|
||||||
|
Make example for this keyboard (after setting up your build environment):
|
||||||
|
|
||||||
|
make ep/96:default
|
||||||
|
|
||||||
|
See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
|
||||||
@@ -0,0 +1,81 @@
|
|||||||
|
# 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
|
||||||
|
|
||||||
|
|
||||||
|
# Build Options
|
||||||
|
# change yes to no to disable
|
||||||
|
#
|
||||||
|
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 = 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 = 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)
|
||||||
@@ -85,17 +85,20 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
|
|
||||||
#define RGBW 1
|
#define RGBW 1
|
||||||
|
|
||||||
/* "debounce" is measured in keyboard scans. Some users reported
|
/*
|
||||||
* needing values as high as 15, which was at the time around 50ms.
|
* The debounce filtering reports a key/switch change directly,
|
||||||
|
* without any extra delay. After that the debounce logic will filter
|
||||||
|
* all further changes, until the key/switch reports the same state for
|
||||||
|
* the given count of scans.
|
||||||
|
* So a perfect switch will get a short debounce period and
|
||||||
|
* a bad key will get a much longer debounce period.
|
||||||
|
* The result is an adaptive debouncing period for each switch.
|
||||||
|
*
|
||||||
* If you don't define it here, the matrix code will default to
|
* If you don't define it here, the matrix code will default to
|
||||||
* 5, which is now closer to 10ms, but still plenty according to
|
* 5, which is now closer to 10ms, but still plenty according to
|
||||||
* manufacturer specs.
|
* manufacturer specs.
|
||||||
*
|
|
||||||
* Default is quite high, because of reports with some production
|
|
||||||
* runs seeming to need it. This may change when configuration for
|
|
||||||
* this is more directly exposed.
|
|
||||||
*/
|
*/
|
||||||
#define DEBOUNCE 15
|
#define DEBOUNCE 10
|
||||||
|
|
||||||
#define USB_MAX_POWER_CONSUMPTION 500
|
#define USB_MAX_POWER_CONSUMPTION 500
|
||||||
|
|
||||||
|
|||||||
@@ -269,6 +269,7 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
__attribute__ ((weak))
|
||||||
const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
|
const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
|
||||||
|
|
||||||
/*{row | col << 4}
|
/*{row | col << 4}
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
#include QMK_KEYBOARD_H
|
#include QMK_KEYBOARD_H
|
||||||
#include "debug.h"
|
|
||||||
#include "action_layer.h"
|
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
|
|
||||||
#define BASE 0 // default layer
|
#define BASE 0 // default layer
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
// Placeholder. See ../default/keymap.c for details
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
RGBLIGHT_ENABLE = no
|
||||||
|
RGB_MATRIX_ENABLE = yes # enable later
|
||||||
|
|
||||||
|
SRC += ../default/keymap.c
|
||||||
@@ -57,6 +57,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
|
|
||||||
/* matrix state(1:on, 0:off) */
|
/* matrix state(1:on, 0:off) */
|
||||||
static matrix_row_t matrix[MATRIX_ROWS];
|
static matrix_row_t matrix[MATRIX_ROWS];
|
||||||
|
/*
|
||||||
|
* matrix state(1:on, 0:off)
|
||||||
|
* contains the raw values without debounce filtering of the last read cycle.
|
||||||
|
*/
|
||||||
|
static matrix_row_t raw_matrix[MATRIX_ROWS];
|
||||||
|
|
||||||
// Debouncing: store for each key the number of scans until it's eligible to
|
// Debouncing: store for each key the number of scans until it's eligible to
|
||||||
// change. When scanning the matrix, ignore any changes in keys that have
|
// change. When scanning the matrix, ignore any changes in keys that have
|
||||||
@@ -118,6 +123,7 @@ void matrix_init(void)
|
|||||||
// initialize matrix state: all keys off
|
// initialize matrix state: all keys off
|
||||||
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
|
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
|
||||||
matrix[i] = 0;
|
matrix[i] = 0;
|
||||||
|
raw_matrix[i] = 0;
|
||||||
for (uint8_t j=0; j < MATRIX_COLS; ++j) {
|
for (uint8_t j=0; j < MATRIX_COLS; ++j) {
|
||||||
debounce_matrix[i * MATRIX_COLS + j] = 0;
|
debounce_matrix[i * MATRIX_COLS + j] = 0;
|
||||||
}
|
}
|
||||||
@@ -151,26 +157,30 @@ void matrix_power_up(void) {
|
|||||||
|
|
||||||
// Returns a matrix_row_t whose bits are set if the corresponding key should be
|
// Returns a matrix_row_t whose bits are set if the corresponding key should be
|
||||||
// eligible to change in this scan.
|
// eligible to change in this scan.
|
||||||
matrix_row_t debounce_mask(uint8_t row) {
|
matrix_row_t debounce_mask(matrix_row_t rawcols, uint8_t row) {
|
||||||
matrix_row_t result = 0;
|
matrix_row_t result = 0;
|
||||||
for (uint8_t j=0; j < MATRIX_COLS; ++j) {
|
matrix_row_t change = rawcols ^ raw_matrix[row];
|
||||||
if (debounce_matrix[row * MATRIX_COLS + j]) {
|
raw_matrix[row] = rawcols;
|
||||||
--debounce_matrix[row * MATRIX_COLS + j];
|
for (uint8_t i = 0; i < MATRIX_COLS; ++i) {
|
||||||
|
if (debounce_matrix[row * MATRIX_COLS + i]) {
|
||||||
|
--debounce_matrix[row * MATRIX_COLS + i];
|
||||||
} else {
|
} else {
|
||||||
result |= (1 << j);
|
result |= (1 << i);
|
||||||
|
}
|
||||||
|
if (change & (1 << i)) {
|
||||||
|
debounce_matrix[row * MATRIX_COLS + i] = DEBOUNCE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Report changed keys in the given row. Resets the debounce countdowns
|
matrix_row_t debounce_read_cols(uint8_t row) {
|
||||||
// corresponding to each set bit in 'change' to DEBOUNCE.
|
// Read the row without debouncing filtering and store it for later usage.
|
||||||
void debounce_report(matrix_row_t change, uint8_t row) {
|
matrix_row_t cols = read_cols(row);
|
||||||
for (uint8_t i = 0; i < MATRIX_COLS; ++i) {
|
// Get the Debounce mask.
|
||||||
if (change & (1 << i)) {
|
matrix_row_t mask = debounce_mask(cols, row);
|
||||||
debounce_matrix[row * MATRIX_COLS + i] = DEBOUNCE;
|
// debounce the row and return the result.
|
||||||
}
|
return (cols & mask) | (matrix[row] & ~mask);;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t matrix_scan(void)
|
uint8_t matrix_scan(void)
|
||||||
@@ -214,15 +224,12 @@ uint8_t matrix_scan(void)
|
|||||||
select_row(i + MATRIX_ROWS_PER_SIDE);
|
select_row(i + MATRIX_ROWS_PER_SIDE);
|
||||||
// we don't need a 30us delay anymore, because selecting a
|
// we don't need a 30us delay anymore, because selecting a
|
||||||
// left-hand row requires more than 30us for i2c.
|
// left-hand row requires more than 30us for i2c.
|
||||||
matrix_row_t mask = debounce_mask(i);
|
|
||||||
matrix_row_t cols = (read_cols(i) & mask) | (matrix[i] & ~mask);
|
// grab cols from left hand
|
||||||
debounce_report(cols ^ matrix[i], i);
|
matrix[i] = debounce_read_cols(i);
|
||||||
matrix[i] = cols;
|
|
||||||
// grab cols from right hand
|
// grab cols from right hand
|
||||||
mask = debounce_mask(i + MATRIX_ROWS_PER_SIDE);
|
matrix[i + MATRIX_ROWS_PER_SIDE] = debounce_read_cols(i + MATRIX_ROWS_PER_SIDE);
|
||||||
cols = (read_cols(i + MATRIX_ROWS_PER_SIDE) & mask) | (matrix[i + MATRIX_ROWS_PER_SIDE] & ~mask);
|
|
||||||
debounce_report(cols ^ matrix[i + MATRIX_ROWS_PER_SIDE], i + MATRIX_ROWS_PER_SIDE);
|
|
||||||
matrix[i + MATRIX_ROWS_PER_SIDE] = cols;
|
|
||||||
unselect_rows();
|
unselect_rows();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -379,7 +386,7 @@ static void select_row(uint8_t row)
|
|||||||
break;
|
break;
|
||||||
case 11:
|
case 11:
|
||||||
DDRD |= (1<<2);
|
DDRD |= (1<<2);
|
||||||
PORTD &= ~(1<<3);
|
PORTD &= ~(1<<2);
|
||||||
break;
|
break;
|
||||||
case 12:
|
case 12:
|
||||||
DDRD |= (1<<3);
|
DDRD |= (1<<3);
|
||||||
@@ -392,4 +399,3 @@ static void select_row(uint8_t row)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -15,8 +15,7 @@
|
|||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
|
|
||||||
# # project specific files
|
# # project specific files
|
||||||
SRC = matrix.c \
|
SRC += matrix.c
|
||||||
i2c_master.c
|
|
||||||
|
|
||||||
# MCU name
|
# MCU name
|
||||||
MCU = atmega32u4
|
MCU = atmega32u4
|
||||||
@@ -85,4 +84,9 @@ API_SYSEX_ENABLE = no
|
|||||||
RGBLIGHT_ENABLE = yes
|
RGBLIGHT_ENABLE = yes
|
||||||
RGB_MATRIX_ENABLE = no # enable later
|
RGB_MATRIX_ENABLE = no # enable later
|
||||||
|
|
||||||
|
ifeq ($(strip $(RGB_MATRIX_ENABLE)), no)
|
||||||
|
SRC += i2c_master.c
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
LAYOUTS = ergodox
|
LAYOUTS = ergodox
|
||||||
Executable
+88
@@ -0,0 +1,88 @@
|
|||||||
|
/* Copyright 2018 @TurboMech /u/TurboMech <discord> @A9entOran9e#6134
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
|
||||||
|
#define _BL 0 //Base layer
|
||||||
|
#define _FN1 1 //Function layer
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
|
||||||
|
/* BL
|
||||||
|
____________________________________________________________________________________________________________________________________________________________________________
|
||||||
|
| | | | | | | | | | | | | | | | | | | |
|
||||||
|
| ESC | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | DELETE | P SCN | HOME | END | P UP | P DOWN |
|
||||||
|
|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|
|
||||||
|
| ` | | | | | | | | | | | | | BACK | NUM | | | |
|
||||||
|
| ¬ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | _ - | = + | SPACE | LOCK | / | * | - |
|
||||||
|
|________|________|________|________|________|________|________|________|________|________|________|________|________|_________________|________|________|________|________|
|
||||||
|
| | | | | | | | | | | | [ | ] | | | | | |
|
||||||
|
| TAB | Q | W | E | R | T | Y | U | I | O | P | { | } | | 7 | 8 | 9 | |
|
||||||
|
|____________|________|________|________|________|________|________|________|________|________|________|________|________|__ ENTER |________|________|________| + |
|
||||||
|
| | | | | | | | | | | ; | ' | # | | | | | |
|
||||||
|
| CAPS LOCK | A | S | D | F | G | H | J | K | L | : | @ | ~ | | 4 | 5 | 6 | |
|
||||||
|
|______________|________|________|________|________|________|________|________|________|________|________|________|________|___________|________|________|________|________|
|
||||||
|
| | \ | | | | | | | | , | . | / | | | | | | |
|
||||||
|
| SHIFT | | | Z | X | C | V | B | N | M | < | > | ? | SHIFT | UP | 1 | 2 | 3 | |
|
||||||
|
|__________|_______|________|________|________|________|________|________|________|________|________|________|________________|________|________|________|________| ENTER |
|
||||||
|
| | | | | | | MO | | | | | | |
|
||||||
|
| CTRL | LGUI | L ALT | SPACE | R ALT | R CTRL | _FN | LEFT | DOWN | RIGHT | 0 | . | |
|
||||||
|
|__________|__________|__________|________________________________________________________|________|________|________|________|________|________|________|________|________|
|
||||||
|
*/
|
||||||
|
|
||||||
|
[_BL] = LAYOUT_split_shift_and_bs(
|
||||||
|
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, KC_PSCR, KC_HOME, KC_END, KC_PGUP, KC_PGDN,
|
||||||
|
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_NO, KC_BSPC, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS,
|
||||||
|
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_NUHS, KC_P7, KC_P8, KC_P9, KC_PPLS,
|
||||||
|
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_NO, KC_P4, KC_P5, KC_P6,
|
||||||
|
KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT,
|
||||||
|
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, MO(1), KC_LEFT, KC_DOWN, KC_RIGHT, KC_P0, KC_PDOT, KC_NO
|
||||||
|
),
|
||||||
|
|
||||||
|
/* FN_1
|
||||||
|
____________________________________________________________________________________________________________________________________________________________________________
|
||||||
|
| | | | | | | | | | | | | | | VOL | VOL | NEXT | | |
|
||||||
|
| RESET | | | | | | | | | | | | | MUTE | DOWN | UP | TRACK | HOME | END |
|
||||||
|
|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|
|
||||||
|
| | RGB | RGB | RGB | RGB | RGB | RGB | RGB | RGB | | | | | | | | | |
|
||||||
|
| | TOGGLE | MODE |INCREASE|DECREASE| HUE | HUE | SAT | | | | | | DELETE | | | | |
|
||||||
|
|________|________|________|________|________|INCREASE|DECREASE|INCREASE|DECREASE|________|________|________|________|_________________|________|________|________|________|
|
||||||
|
| | BACK | BACK | | | | | | | | | | | | | | | |
|
||||||
|
| | LIGHT | LIGHT | | | | | | | | | | | | | | | |
|
||||||
|
|____________| TOGGLE |INCREASE|DECREASE|________|________|________|________|________|________|________|________|________|__ |________|________|________| |
|
||||||
|
| | | | | | | | | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | | | | | |
|
||||||
|
|______________|________|________|________|________|________|________|________|________|________|________|________|________|___________|________|________|________|________|
|
||||||
|
| | | | | | | | | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | | | | | | |
|
||||||
|
|__________|_______|________|________|________|________|________|________|________|________|________|________|________________|________|________|________|________| |
|
||||||
|
| | | | | | | | | | | | | |
|
||||||
|
| | | | | | | | | | | | | |
|
||||||
|
|__________|__________|__________|________________________________________________________|________|________|________|________|________|________|________|________|________|
|
||||||
|
*/
|
||||||
|
|
||||||
|
[_FN1] = LAYOUT_split_shift_and_bs(
|
||||||
|
RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT, KC_HOME, KC_END,
|
||||||
|
_______, RGB_TOG, RGB_MOD, RGB_VAI, RGB_VAD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, _______, _______, _______, _______, _______, KC_DEL, _______, _______, _______, _______,
|
||||||
|
_______, BL_TOGG, BL_INC, BL_DEC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||||
|
),
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
+218
-72
@@ -1,5 +1,10 @@
|
|||||||
/*
|
/*
|
||||||
* WARNING: be careful changing this code, it is very timing dependent
|
* WARNING: be careful changing this code, it is very timing dependent
|
||||||
|
*
|
||||||
|
* 2018-10-28 checked
|
||||||
|
* avr-gcc 4.9.2
|
||||||
|
* avr-gcc 5.4.0
|
||||||
|
* avr-gcc 7.3.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef F_CPU
|
#ifndef F_CPU
|
||||||
@@ -14,10 +19,60 @@
|
|||||||
#include "serial.h"
|
#include "serial.h"
|
||||||
//#include <pro_micro.h>
|
//#include <pro_micro.h>
|
||||||
|
|
||||||
#ifdef USE_SERIAL
|
#ifdef SOFT_SERIAL_PIN
|
||||||
|
|
||||||
#ifndef SERIAL_USE_MULTI_TRANSACTION
|
#ifdef __AVR_ATmega32U4__
|
||||||
/* --- USE Simple API (OLD API, compatible with let's split serial.c) */
|
// if using ATmega32U4 I2C, can not use PD0 and PD1 in soft serial.
|
||||||
|
#ifdef USE_I2C
|
||||||
|
#if SOFT_SERIAL_PIN == D0 || SOFT_SERIAL_PIN == D1
|
||||||
|
#error Using ATmega32U4 I2C, so can not use PD0, PD1
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if SOFT_SERIAL_PIN >= D0 && SOFT_SERIAL_PIN <= D3
|
||||||
|
#define SERIAL_PIN_DDR DDRD
|
||||||
|
#define SERIAL_PIN_PORT PORTD
|
||||||
|
#define SERIAL_PIN_INPUT PIND
|
||||||
|
#if SOFT_SERIAL_PIN == D0
|
||||||
|
#define SERIAL_PIN_MASK _BV(PD0)
|
||||||
|
#define EIMSK_BIT _BV(INT0)
|
||||||
|
#define EICRx_BIT (~(_BV(ISC00) | _BV(ISC01)))
|
||||||
|
#define SERIAL_PIN_INTERRUPT INT0_vect
|
||||||
|
#elif SOFT_SERIAL_PIN == D1
|
||||||
|
#define SERIAL_PIN_MASK _BV(PD1)
|
||||||
|
#define EIMSK_BIT _BV(INT1)
|
||||||
|
#define EICRx_BIT (~(_BV(ISC10) | _BV(ISC11)))
|
||||||
|
#define SERIAL_PIN_INTERRUPT INT1_vect
|
||||||
|
#elif SOFT_SERIAL_PIN == D2
|
||||||
|
#define SERIAL_PIN_MASK _BV(PD2)
|
||||||
|
#define EIMSK_BIT _BV(INT2)
|
||||||
|
#define EICRx_BIT (~(_BV(ISC20) | _BV(ISC21)))
|
||||||
|
#define SERIAL_PIN_INTERRUPT INT2_vect
|
||||||
|
#elif SOFT_SERIAL_PIN == D3
|
||||||
|
#define SERIAL_PIN_MASK _BV(PD3)
|
||||||
|
#define EIMSK_BIT _BV(INT3)
|
||||||
|
#define EICRx_BIT (~(_BV(ISC30) | _BV(ISC31)))
|
||||||
|
#define SERIAL_PIN_INTERRUPT INT3_vect
|
||||||
|
#endif
|
||||||
|
#elif SOFT_SERIAL_PIN == E6
|
||||||
|
#define SERIAL_PIN_DDR DDRE
|
||||||
|
#define SERIAL_PIN_PORT PORTE
|
||||||
|
#define SERIAL_PIN_INPUT PINE
|
||||||
|
#define SERIAL_PIN_MASK _BV(PE6)
|
||||||
|
#define EIMSK_BIT _BV(INT6)
|
||||||
|
#define EICRx_BIT (~(_BV(ISC60) | _BV(ISC61)))
|
||||||
|
#define SERIAL_PIN_INTERRUPT INT6_vect
|
||||||
|
#else
|
||||||
|
#error invalid SOFT_SERIAL_PIN value
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#else
|
||||||
|
#error serial.c now support ATmega32U4 only
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//////////////// for backward compatibility ////////////////////////////////
|
||||||
|
#if !defined(SERIAL_USE_SINGLE_TRANSACTION) && !defined(SERIAL_USE_MULTI_TRANSACTION)
|
||||||
|
/* --- USE OLD API (compatible with let's split serial.c) */
|
||||||
#if SERIAL_SLAVE_BUFFER_LENGTH > 0
|
#if SERIAL_SLAVE_BUFFER_LENGTH > 0
|
||||||
uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0};
|
uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0};
|
||||||
#endif
|
#endif
|
||||||
@@ -42,56 +97,118 @@ SSTD_t transactions[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
void serial_master_init(void)
|
void serial_master_init(void)
|
||||||
{ soft_serial_initiator_init(transactions); }
|
{ soft_serial_initiator_init(transactions, TID_LIMIT(transactions)); }
|
||||||
|
|
||||||
void serial_slave_init(void)
|
void serial_slave_init(void)
|
||||||
{ soft_serial_target_init(transactions); }
|
{ soft_serial_target_init(transactions, TID_LIMIT(transactions)); }
|
||||||
|
|
||||||
// 0 => no error
|
// 0 => no error
|
||||||
// 1 => slave did not respond
|
// 1 => slave did not respond
|
||||||
// 2 => checksum error
|
// 2 => checksum error
|
||||||
int serial_update_buffers()
|
int serial_update_buffers()
|
||||||
{ return soft_serial_transaction(); }
|
{
|
||||||
|
int result;
|
||||||
|
result = soft_serial_transaction();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
#endif // Simple API (OLD API, compatible with let's split serial.c)
|
#endif // end of OLD API (compatible with let's split serial.c)
|
||||||
|
////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#define ALWAYS_INLINE __attribute__((always_inline))
|
#define ALWAYS_INLINE __attribute__((always_inline))
|
||||||
#define NO_INLINE __attribute__((noinline))
|
#define NO_INLINE __attribute__((noinline))
|
||||||
#define _delay_sub_us(x) __builtin_avr_delay_cycles(x)
|
#define _delay_sub_us(x) __builtin_avr_delay_cycles(x)
|
||||||
|
|
||||||
// Serial pulse period in microseconds.
|
// parity check
|
||||||
#define TID_SEND_ADJUST 14
|
#define ODD_PARITY 1
|
||||||
|
#define EVEN_PARITY 0
|
||||||
|
#define PARITY EVEN_PARITY
|
||||||
|
|
||||||
#define SELECT_SERIAL_SPEED 1
|
#ifdef SERIAL_DELAY
|
||||||
#if SELECT_SERIAL_SPEED == 0
|
// custom setup in config.h
|
||||||
|
// #define TID_SEND_ADJUST 2
|
||||||
|
// #define SERIAL_DELAY 6 // micro sec
|
||||||
|
// #define READ_WRITE_START_ADJUST 30 // cycles
|
||||||
|
// #define READ_WRITE_WIDTH_ADJUST 8 // cycles
|
||||||
|
#else
|
||||||
|
// ============ Standard setups ============
|
||||||
|
|
||||||
|
#ifndef SELECT_SOFT_SERIAL_SPEED
|
||||||
|
#define SELECT_SOFT_SERIAL_SPEED 1
|
||||||
|
// 0: about 189kbps
|
||||||
|
// 1: about 137kbps (default)
|
||||||
|
// 2: about 75kbps
|
||||||
|
// 3: about 39kbps
|
||||||
|
// 4: about 26kbps
|
||||||
|
// 5: about 20kbps
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if __GNUC__ < 6
|
||||||
|
#define TID_SEND_ADJUST 14
|
||||||
|
#else
|
||||||
|
#define TID_SEND_ADJUST 2
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if SELECT_SOFT_SERIAL_SPEED == 0
|
||||||
// Very High speed
|
// Very High speed
|
||||||
#define SERIAL_DELAY 4 // micro sec
|
#define SERIAL_DELAY 4 // micro sec
|
||||||
#define READ_WRITE_START_ADJUST 33 // cycles
|
#if __GNUC__ < 6
|
||||||
#define READ_WRITE_WIDTH_ADJUST 3 // cycles
|
#define READ_WRITE_START_ADJUST 33 // cycles
|
||||||
#elif SELECT_SERIAL_SPEED == 1
|
#define READ_WRITE_WIDTH_ADJUST 3 // cycles
|
||||||
|
#else
|
||||||
|
#define READ_WRITE_START_ADJUST 34 // cycles
|
||||||
|
#define READ_WRITE_WIDTH_ADJUST 7 // cycles
|
||||||
|
#endif
|
||||||
|
#elif SELECT_SOFT_SERIAL_SPEED == 1
|
||||||
// High speed
|
// High speed
|
||||||
#define SERIAL_DELAY 6 // micro sec
|
#define SERIAL_DELAY 6 // micro sec
|
||||||
#define READ_WRITE_START_ADJUST 30 // cycles
|
#if __GNUC__ < 6
|
||||||
#define READ_WRITE_WIDTH_ADJUST 3 // cycles
|
#define READ_WRITE_START_ADJUST 30 // cycles
|
||||||
#elif SELECT_SERIAL_SPEED == 2
|
#define READ_WRITE_WIDTH_ADJUST 3 // cycles
|
||||||
|
#else
|
||||||
|
#define READ_WRITE_START_ADJUST 33 // cycles
|
||||||
|
#define READ_WRITE_WIDTH_ADJUST 7 // cycles
|
||||||
|
#endif
|
||||||
|
#elif SELECT_SOFT_SERIAL_SPEED == 2
|
||||||
// Middle speed
|
// Middle speed
|
||||||
#define SERIAL_DELAY 12 // micro sec
|
#define SERIAL_DELAY 12 // micro sec
|
||||||
#define READ_WRITE_START_ADJUST 30 // cycles
|
#define READ_WRITE_START_ADJUST 30 // cycles
|
||||||
#define READ_WRITE_WIDTH_ADJUST 3 // cycles
|
#if __GNUC__ < 6
|
||||||
#elif SELECT_SERIAL_SPEED == 3
|
#define READ_WRITE_WIDTH_ADJUST 3 // cycles
|
||||||
|
#else
|
||||||
|
#define READ_WRITE_WIDTH_ADJUST 7 // cycles
|
||||||
|
#endif
|
||||||
|
#elif SELECT_SOFT_SERIAL_SPEED == 3
|
||||||
// Low speed
|
// Low speed
|
||||||
#define SERIAL_DELAY 24 // micro sec
|
#define SERIAL_DELAY 24 // micro sec
|
||||||
#define READ_WRITE_START_ADJUST 30 // cycles
|
#define READ_WRITE_START_ADJUST 30 // cycles
|
||||||
#define READ_WRITE_WIDTH_ADJUST 3 // cycles
|
#if __GNUC__ < 6
|
||||||
#elif SELECT_SERIAL_SPEED == 4
|
#define READ_WRITE_WIDTH_ADJUST 3 // cycles
|
||||||
|
#else
|
||||||
|
#define READ_WRITE_WIDTH_ADJUST 7 // cycles
|
||||||
|
#endif
|
||||||
|
#elif SELECT_SOFT_SERIAL_SPEED == 4
|
||||||
// Very Low speed
|
// Very Low speed
|
||||||
#define SERIAL_DELAY 50 // micro sec
|
#define SERIAL_DELAY 36 // micro sec
|
||||||
#define READ_WRITE_START_ADJUST 30 // cycles
|
#define READ_WRITE_START_ADJUST 30 // cycles
|
||||||
#define READ_WRITE_WIDTH_ADJUST 3 // cycles
|
#if __GNUC__ < 6
|
||||||
|
#define READ_WRITE_WIDTH_ADJUST 3 // cycles
|
||||||
|
#else
|
||||||
|
#define READ_WRITE_WIDTH_ADJUST 7 // cycles
|
||||||
|
#endif
|
||||||
|
#elif SELECT_SOFT_SERIAL_SPEED == 5
|
||||||
|
// Ultra Low speed
|
||||||
|
#define SERIAL_DELAY 48 // micro sec
|
||||||
|
#define READ_WRITE_START_ADJUST 30 // cycles
|
||||||
|
#if __GNUC__ < 6
|
||||||
|
#define READ_WRITE_WIDTH_ADJUST 3 // cycles
|
||||||
|
#else
|
||||||
|
#define READ_WRITE_WIDTH_ADJUST 7 // cycles
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
#error Illegal Serial Speed
|
#error invalid SELECT_SOFT_SERIAL_SPEED value
|
||||||
#endif
|
#endif /* SELECT_SOFT_SERIAL_SPEED */
|
||||||
|
#endif /* SERIAL_DELAY */
|
||||||
|
|
||||||
#define SERIAL_DELAY_HALF1 (SERIAL_DELAY/2)
|
#define SERIAL_DELAY_HALF1 (SERIAL_DELAY/2)
|
||||||
#define SERIAL_DELAY_HALF2 (SERIAL_DELAY - SERIAL_DELAY/2)
|
#define SERIAL_DELAY_HALF2 (SERIAL_DELAY - SERIAL_DELAY/2)
|
||||||
@@ -105,17 +222,21 @@ int serial_update_buffers()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
static SSTD_t *Transaction_table = NULL;
|
static SSTD_t *Transaction_table = NULL;
|
||||||
|
static uint8_t Transaction_table_size = 0;
|
||||||
|
|
||||||
|
inline static void serial_delay(void) ALWAYS_INLINE;
|
||||||
inline static
|
inline static
|
||||||
void serial_delay(void) {
|
void serial_delay(void) {
|
||||||
_delay_us(SERIAL_DELAY);
|
_delay_us(SERIAL_DELAY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline static void serial_delay_half1(void) ALWAYS_INLINE;
|
||||||
inline static
|
inline static
|
||||||
void serial_delay_half1(void) {
|
void serial_delay_half1(void) {
|
||||||
_delay_us(SERIAL_DELAY_HALF1);
|
_delay_us(SERIAL_DELAY_HALF1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline static void serial_delay_half2(void) ALWAYS_INLINE;
|
||||||
inline static
|
inline static
|
||||||
void serial_delay_half2(void) {
|
void serial_delay_half2(void) {
|
||||||
_delay_us(SERIAL_DELAY_HALF2);
|
_delay_us(SERIAL_DELAY_HALF2);
|
||||||
@@ -135,6 +256,7 @@ void serial_input_with_pullup(void) {
|
|||||||
SERIAL_PIN_PORT |= SERIAL_PIN_MASK;
|
SERIAL_PIN_PORT |= SERIAL_PIN_MASK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline static uint8_t serial_read_pin(void) ALWAYS_INLINE;
|
||||||
inline static
|
inline static
|
||||||
uint8_t serial_read_pin(void) {
|
uint8_t serial_read_pin(void) {
|
||||||
return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK);
|
return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK);
|
||||||
@@ -152,30 +274,28 @@ void serial_high(void) {
|
|||||||
SERIAL_PIN_PORT |= SERIAL_PIN_MASK;
|
SERIAL_PIN_PORT |= SERIAL_PIN_MASK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void soft_serial_initiator_init(SSTD_t *sstd_table)
|
void soft_serial_initiator_init(SSTD_t *sstd_table, int sstd_table_size)
|
||||||
{
|
{
|
||||||
Transaction_table = sstd_table;
|
Transaction_table = sstd_table;
|
||||||
|
Transaction_table_size = (uint8_t)sstd_table_size;
|
||||||
serial_output();
|
serial_output();
|
||||||
serial_high();
|
serial_high();
|
||||||
}
|
}
|
||||||
|
|
||||||
void soft_serial_target_init(SSTD_t *sstd_table)
|
void soft_serial_target_init(SSTD_t *sstd_table, int sstd_table_size)
|
||||||
{
|
{
|
||||||
Transaction_table = sstd_table;
|
Transaction_table = sstd_table;
|
||||||
|
Transaction_table_size = (uint8_t)sstd_table_size;
|
||||||
serial_input_with_pullup();
|
serial_input_with_pullup();
|
||||||
|
|
||||||
#if SERIAL_PIN_MASK == _BV(PD0)
|
// Enable INT0-INT3,INT6
|
||||||
// Enable INT0
|
EIMSK |= EIMSK_BIT;
|
||||||
EIMSK |= _BV(INT0);
|
#if SERIAL_PIN_MASK == _BV(PE6)
|
||||||
// Trigger on falling edge of INT0
|
// Trigger on falling edge of INT6
|
||||||
EICRA &= ~(_BV(ISC00) | _BV(ISC01));
|
EICRB &= EICRx_BIT;
|
||||||
#elif SERIAL_PIN_MASK == _BV(PD2)
|
|
||||||
// Enable INT2
|
|
||||||
EIMSK |= _BV(INT2);
|
|
||||||
// Trigger on falling edge of INT2
|
|
||||||
EICRA &= ~(_BV(ISC20) | _BV(ISC21));
|
|
||||||
#else
|
#else
|
||||||
#error unknown SERIAL_PIN_MASK value
|
// Trigger on falling edge of INT0-INT3
|
||||||
|
EICRA &= EICRx_BIT;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -191,7 +311,7 @@ void sync_recv(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Used by the reciver to send a synchronization signal to the sender.
|
// Used by the reciver to send a synchronization signal to the sender.
|
||||||
static void sync_send(void)NO_INLINE;
|
static void sync_send(void) NO_INLINE;
|
||||||
static
|
static
|
||||||
void sync_send(void) {
|
void sync_send(void) {
|
||||||
serial_low();
|
serial_low();
|
||||||
@@ -205,12 +325,12 @@ static uint8_t serial_read_chunk(uint8_t *pterrcount, uint8_t bit) {
|
|||||||
uint8_t byte, i, p, pb;
|
uint8_t byte, i, p, pb;
|
||||||
|
|
||||||
_delay_sub_us(READ_WRITE_START_ADJUST);
|
_delay_sub_us(READ_WRITE_START_ADJUST);
|
||||||
for( i = 0, byte = 0, p = 0; i < bit; i++ ) {
|
for( i = 0, byte = 0, p = PARITY; i < bit; i++ ) {
|
||||||
serial_delay_half1(); // read the middle of pulses
|
serial_delay_half1(); // read the middle of pulses
|
||||||
if( serial_read_pin() ) {
|
if( serial_read_pin() ) {
|
||||||
byte = (byte << 1) | 1; p ^= 1;
|
byte = (byte << 1) | 1; p ^= 1;
|
||||||
} else {
|
} else {
|
||||||
byte = (byte << 1) | 0; p ^= 0;
|
byte = (byte << 1) | 0; p ^= 0;
|
||||||
}
|
}
|
||||||
_delay_sub_us(READ_WRITE_WIDTH_ADJUST);
|
_delay_sub_us(READ_WRITE_WIDTH_ADJUST);
|
||||||
serial_delay_half2();
|
serial_delay_half2();
|
||||||
@@ -230,13 +350,13 @@ static uint8_t serial_read_chunk(uint8_t *pterrcount, uint8_t bit) {
|
|||||||
void serial_write_chunk(uint8_t data, uint8_t bit) NO_INLINE;
|
void serial_write_chunk(uint8_t data, uint8_t bit) NO_INLINE;
|
||||||
void serial_write_chunk(uint8_t data, uint8_t bit) {
|
void serial_write_chunk(uint8_t data, uint8_t bit) {
|
||||||
uint8_t b, p;
|
uint8_t b, p;
|
||||||
for( p = 0, b = 1<<(bit-1); b ; b >>= 1) {
|
for( p = PARITY, b = 1<<(bit-1); b ; b >>= 1) {
|
||||||
if(data & b) {
|
if(data & b) {
|
||||||
serial_high(); p ^= 1;
|
serial_high(); p ^= 1;
|
||||||
} else {
|
} else {
|
||||||
serial_low(); p ^= 0;
|
serial_low(); p ^= 0;
|
||||||
}
|
}
|
||||||
serial_delay();
|
serial_delay();
|
||||||
}
|
}
|
||||||
/* send parity bit */
|
/* send parity bit */
|
||||||
if(p & 1) { serial_high(); }
|
if(p & 1) { serial_high(); }
|
||||||
@@ -288,6 +408,13 @@ void change_reciver2sender(void) {
|
|||||||
serial_delay_half1(); //4
|
serial_delay_half1(); //4
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline uint8_t nibble_bits_count(uint8_t bits)
|
||||||
|
{
|
||||||
|
bits = (bits & 0x5) + (bits >> 1 & 0x5);
|
||||||
|
bits = (bits & 0x3) + (bits >> 2 & 0x3);
|
||||||
|
return bits;
|
||||||
|
}
|
||||||
|
|
||||||
// interrupt handle to be used by the target device
|
// interrupt handle to be used by the target device
|
||||||
ISR(SERIAL_PIN_INTERRUPT) {
|
ISR(SERIAL_PIN_INTERRUPT) {
|
||||||
|
|
||||||
@@ -297,12 +424,15 @@ ISR(SERIAL_PIN_INTERRUPT) {
|
|||||||
SSTD_t *trans = Transaction_table;
|
SSTD_t *trans = Transaction_table;
|
||||||
#else
|
#else
|
||||||
// recive transaction table index
|
// recive transaction table index
|
||||||
uint8_t tid;
|
uint8_t tid, bits;
|
||||||
uint8_t pecount = 0;
|
uint8_t pecount = 0;
|
||||||
sync_recv();
|
sync_recv();
|
||||||
tid = serial_read_chunk(&pecount,4);
|
bits = serial_read_chunk(&pecount,7);
|
||||||
if(pecount> 0)
|
tid = bits>>3;
|
||||||
|
bits = (bits&7) != nibble_bits_count(tid);
|
||||||
|
if( bits || pecount> 0 || tid > Transaction_table_size ) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
serial_delay_half1();
|
serial_delay_half1();
|
||||||
|
|
||||||
serial_high(); // response step1 low->high
|
serial_high(); // response step1 low->high
|
||||||
@@ -315,17 +445,17 @@ ISR(SERIAL_PIN_INTERRUPT) {
|
|||||||
// target send phase
|
// target send phase
|
||||||
if( trans->target2initiator_buffer_size > 0 )
|
if( trans->target2initiator_buffer_size > 0 )
|
||||||
serial_send_packet((uint8_t *)trans->target2initiator_buffer,
|
serial_send_packet((uint8_t *)trans->target2initiator_buffer,
|
||||||
trans->target2initiator_buffer_size);
|
trans->target2initiator_buffer_size);
|
||||||
// target switch to input
|
// target switch to input
|
||||||
change_sender2reciver();
|
change_sender2reciver();
|
||||||
|
|
||||||
// target recive phase
|
// target recive phase
|
||||||
if( trans->initiator2target_buffer_size > 0 ) {
|
if( trans->initiator2target_buffer_size > 0 ) {
|
||||||
if (serial_recive_packet((uint8_t *)trans->initiator2target_buffer,
|
if (serial_recive_packet((uint8_t *)trans->initiator2target_buffer,
|
||||||
trans->initiator2target_buffer_size) ) {
|
trans->initiator2target_buffer_size) ) {
|
||||||
*trans->status = TRANSACTION_ACCEPTED;
|
*trans->status = TRANSACTION_ACCEPTED;
|
||||||
} else {
|
} else {
|
||||||
*trans->status = TRANSACTION_DATA_ERROR;
|
*trans->status = TRANSACTION_DATA_ERROR;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
*trans->status = TRANSACTION_ACCEPTED;
|
*trans->status = TRANSACTION_ACCEPTED;
|
||||||
@@ -349,6 +479,8 @@ int soft_serial_transaction(void) {
|
|||||||
SSTD_t *trans = Transaction_table;
|
SSTD_t *trans = Transaction_table;
|
||||||
#else
|
#else
|
||||||
int soft_serial_transaction(int sstd_index) {
|
int soft_serial_transaction(int sstd_index) {
|
||||||
|
if( sstd_index > Transaction_table_size )
|
||||||
|
return TRANSACTION_TYPE_ERROR;
|
||||||
SSTD_t *trans = &Transaction_table[sstd_index];
|
SSTD_t *trans = &Transaction_table[sstd_index];
|
||||||
#endif
|
#endif
|
||||||
cli();
|
cli();
|
||||||
@@ -375,9 +507,10 @@ int soft_serial_transaction(int sstd_index) {
|
|||||||
|
|
||||||
#else
|
#else
|
||||||
// send transaction table index
|
// send transaction table index
|
||||||
|
int tid = (sstd_index<<3) | (7 & nibble_bits_count(sstd_index));
|
||||||
sync_send();
|
sync_send();
|
||||||
_delay_sub_us(TID_SEND_ADJUST);
|
_delay_sub_us(TID_SEND_ADJUST);
|
||||||
serial_write_chunk(sstd_index, 4);
|
serial_write_chunk(tid, 7);
|
||||||
serial_delay_half1();
|
serial_delay_half1();
|
||||||
|
|
||||||
// wait for the target response (step1 low->high)
|
// wait for the target response (step1 low->high)
|
||||||
@@ -389,12 +522,12 @@ int soft_serial_transaction(int sstd_index) {
|
|||||||
// check if the target is present (step2 high->low)
|
// check if the target is present (step2 high->low)
|
||||||
for( int i = 0; serial_read_pin(); i++ ) {
|
for( int i = 0; serial_read_pin(); i++ ) {
|
||||||
if (i > SLAVE_INT_ACK_WIDTH + 1) {
|
if (i > SLAVE_INT_ACK_WIDTH + 1) {
|
||||||
// slave failed to pull the line low, assume not present
|
// slave failed to pull the line low, assume not present
|
||||||
serial_output();
|
serial_output();
|
||||||
serial_high();
|
serial_high();
|
||||||
*trans->status = TRANSACTION_NO_RESPONSE;
|
*trans->status = TRANSACTION_NO_RESPONSE;
|
||||||
sei();
|
sei();
|
||||||
return TRANSACTION_NO_RESPONSE;
|
return TRANSACTION_NO_RESPONSE;
|
||||||
}
|
}
|
||||||
_delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT);
|
_delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT);
|
||||||
}
|
}
|
||||||
@@ -404,12 +537,12 @@ int soft_serial_transaction(int sstd_index) {
|
|||||||
// if the target is present syncronize with it
|
// if the target is present syncronize with it
|
||||||
if( trans->target2initiator_buffer_size > 0 ) {
|
if( trans->target2initiator_buffer_size > 0 ) {
|
||||||
if (!serial_recive_packet((uint8_t *)trans->target2initiator_buffer,
|
if (!serial_recive_packet((uint8_t *)trans->target2initiator_buffer,
|
||||||
trans->target2initiator_buffer_size) ) {
|
trans->target2initiator_buffer_size) ) {
|
||||||
serial_output();
|
serial_output();
|
||||||
serial_high();
|
serial_high();
|
||||||
*trans->status = TRANSACTION_DATA_ERROR;
|
*trans->status = TRANSACTION_DATA_ERROR;
|
||||||
sei();
|
sei();
|
||||||
return TRANSACTION_DATA_ERROR;
|
return TRANSACTION_DATA_ERROR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -419,7 +552,7 @@ int soft_serial_transaction(int sstd_index) {
|
|||||||
// initiator send phase
|
// initiator send phase
|
||||||
if( trans->initiator2target_buffer_size > 0 ) {
|
if( trans->initiator2target_buffer_size > 0 ) {
|
||||||
serial_send_packet((uint8_t *)trans->initiator2target_buffer,
|
serial_send_packet((uint8_t *)trans->initiator2target_buffer,
|
||||||
trans->initiator2target_buffer_size);
|
trans->initiator2target_buffer_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
// always, release the line when not in use
|
// always, release the line when not in use
|
||||||
@@ -441,4 +574,17 @@ int soft_serial_get_and_clean_status(int sstd_index) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Helix serial.c history
|
||||||
|
// 2018-1-29 fork from let's split and add PD2, modify sync_recv() (#2308, bceffdefc)
|
||||||
|
// 2018-6-28 bug fix master to slave comm and speed up (#3255, 1038bbef4)
|
||||||
|
// (adjusted with avr-gcc 4.9.2)
|
||||||
|
// 2018-7-13 remove USE_SERIAL_PD2 macro (#3374, f30d6dd78)
|
||||||
|
// (adjusted with avr-gcc 4.9.2)
|
||||||
|
// 2018-8-11 add support multi-type transaction (#3608, feb5e4aae)
|
||||||
|
// (adjusted with avr-gcc 4.9.2)
|
||||||
|
// 2018-10-21 fix serial and RGB animation conflict (#4191, 4665e4fff)
|
||||||
|
// (adjusted with avr-gcc 7.3.0)
|
||||||
|
// 2018-10-28 re-adjust compiler depend value of delay (#4269, 8517f8a66)
|
||||||
|
// (adjusted with avr-gcc 5.4.0, 7.3.0)
|
||||||
@@ -4,40 +4,47 @@
|
|||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
// /////////////////////////////////////////////////////////////////
|
// /////////////////////////////////////////////////////////////////
|
||||||
// Need Soft Serial defines in serial_config.h
|
// Need Soft Serial defines in config.h
|
||||||
// /////////////////////////////////////////////////////////////////
|
// /////////////////////////////////////////////////////////////////
|
||||||
// ex.
|
// ex.
|
||||||
// #define SERIAL_PIN_DDR DDRD
|
// #define SOFT_SERIAL_PIN ?? // ?? = D0,D1,D2,D3,E6
|
||||||
// #define SERIAL_PIN_PORT PORTD
|
// OPTIONAL: #define SELECT_SOFT_SERIAL_SPEED ? // ? = 1,2,3,4,5
|
||||||
// #define SERIAL_PIN_INPUT PIND
|
// // 1: about 137kbps (default)
|
||||||
// #define SERIAL_PIN_MASK _BV(PD?) ?=0,2
|
// // 2: about 75kbps
|
||||||
// #define SERIAL_PIN_INTERRUPT INT?_vect ?=0,2
|
// // 3: about 39kbps
|
||||||
|
// // 4: about 26kbps
|
||||||
|
// // 5: about 20kbps
|
||||||
//
|
//
|
||||||
// //// USE Simple API (OLD API, compatible with let's split serial.c)
|
// //// USE OLD API (compatible with let's split serial.c)
|
||||||
// ex.
|
// ex.
|
||||||
// #define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2
|
// #define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2
|
||||||
// #define SERIAL_MASTER_BUFFER_LENGTH 1
|
// #define SERIAL_MASTER_BUFFER_LENGTH 1
|
||||||
//
|
//
|
||||||
// //// USE flexible API (using multi-type transaction function)
|
// //// USE NEW API
|
||||||
// #define SERIAL_USE_MULTI_TRANSACTION
|
// //// USE simple API (using signle-type transaction function)
|
||||||
|
// #define SERIAL_USE_SINGLE_TRANSACTION
|
||||||
|
// //// USE flexible API (using multi-type transaction function)
|
||||||
|
// #define SERIAL_USE_MULTI_TRANSACTION
|
||||||
//
|
//
|
||||||
// /////////////////////////////////////////////////////////////////
|
// /////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
#ifndef SERIAL_USE_MULTI_TRANSACTION
|
//////////////// for backward compatibility ////////////////////////////////
|
||||||
/* --- USE Simple API (OLD API, compatible with let's split serial.c) */
|
#if !defined(SERIAL_USE_SINGLE_TRANSACTION) && !defined(SERIAL_USE_MULTI_TRANSACTION)
|
||||||
#if SERIAL_SLAVE_BUFFER_LENGTH > 0
|
/* --- USE OLD API (compatible with let's split serial.c) */
|
||||||
extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH];
|
#if SERIAL_SLAVE_BUFFER_LENGTH > 0
|
||||||
#endif
|
extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH];
|
||||||
#if SERIAL_MASTER_BUFFER_LENGTH > 0
|
#endif
|
||||||
extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH];
|
#if SERIAL_MASTER_BUFFER_LENGTH > 0
|
||||||
#endif
|
extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH];
|
||||||
|
#endif
|
||||||
|
|
||||||
void serial_master_init(void);
|
void serial_master_init(void);
|
||||||
void serial_slave_init(void);
|
void serial_slave_init(void);
|
||||||
int serial_update_buffers(void);
|
int serial_update_buffers(void);
|
||||||
|
|
||||||
#endif // USE Simple API
|
#endif // end of USE OLD API
|
||||||
|
////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
// Soft Serial Transaction Descriptor
|
// Soft Serial Transaction Descriptor
|
||||||
typedef struct _SSTD_t {
|
typedef struct _SSTD_t {
|
||||||
@@ -47,16 +54,18 @@ typedef struct _SSTD_t {
|
|||||||
uint8_t target2initiator_buffer_size;
|
uint8_t target2initiator_buffer_size;
|
||||||
uint8_t *target2initiator_buffer;
|
uint8_t *target2initiator_buffer;
|
||||||
} SSTD_t;
|
} SSTD_t;
|
||||||
|
#define TID_LIMIT( table ) (sizeof(table) / sizeof(SSTD_t))
|
||||||
|
|
||||||
// initiator is transaction start side
|
// initiator is transaction start side
|
||||||
void soft_serial_initiator_init(SSTD_t *sstd_table);
|
void soft_serial_initiator_init(SSTD_t *sstd_table, int sstd_table_size);
|
||||||
// target is interrupt accept side
|
// target is interrupt accept side
|
||||||
void soft_serial_target_init(SSTD_t *sstd_table);
|
void soft_serial_target_init(SSTD_t *sstd_table, int sstd_table_size);
|
||||||
|
|
||||||
// initiator resullt
|
// initiator resullt
|
||||||
#define TRANSACTION_END 0
|
#define TRANSACTION_END 0
|
||||||
#define TRANSACTION_NO_RESPONSE 0x1
|
#define TRANSACTION_NO_RESPONSE 0x1
|
||||||
#define TRANSACTION_DATA_ERROR 0x2
|
#define TRANSACTION_DATA_ERROR 0x2
|
||||||
|
#define TRANSACTION_TYPE_ERROR 0x4
|
||||||
#ifndef SERIAL_USE_MULTI_TRANSACTION
|
#ifndef SERIAL_USE_MULTI_TRANSACTION
|
||||||
int soft_serial_transaction(void);
|
int soft_serial_transaction(void);
|
||||||
#else
|
#else
|
||||||
@@ -72,9 +81,9 @@ int soft_serial_transaction(int sstd_index);
|
|||||||
// target:
|
// target:
|
||||||
// TRANSACTION_DATA_ERROR
|
// TRANSACTION_DATA_ERROR
|
||||||
// or TRANSACTION_ACCEPTED
|
// or TRANSACTION_ACCEPTED
|
||||||
#define TRANSACTION_ACCEPTED 0x4
|
#define TRANSACTION_ACCEPTED 0x8
|
||||||
#ifdef SERIAL_USE_MULTI_TRANSACTION
|
#ifdef SERIAL_USE_MULTI_TRANSACTION
|
||||||
int soft_serial_get_and_clean_status(int sstd_index);
|
int soft_serial_get_and_clean_status(int sstd_index);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* SOFT_SERIAL_H */
|
#endif /* SOFT_SERIAL_H */
|
||||||
@@ -2,13 +2,9 @@
|
|||||||
#define SOFT_SERIAL_CONFIG_H
|
#define SOFT_SERIAL_CONFIG_H
|
||||||
|
|
||||||
/* Soft Serial defines */
|
/* Soft Serial defines */
|
||||||
#define SERIAL_PIN_DDR DDRD
|
#define SOFT_SERIAL_PIN D2
|
||||||
#define SERIAL_PIN_PORT PORTD
|
|
||||||
#define SERIAL_PIN_INPUT PIND
|
|
||||||
#define SERIAL_PIN_MASK _BV(PD2)
|
|
||||||
#define SERIAL_PIN_INTERRUPT INT2_vect
|
|
||||||
|
|
||||||
#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2
|
#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2
|
||||||
#define SERIAL_MASTER_BUFFER_LENGTH 1
|
#define SERIAL_MASTER_BUFFER_LENGTH 1
|
||||||
|
|
||||||
#endif /* SOFT_SERIAL_CONFIG_H */
|
#endif /* SOFT_SERIAL_CONFIG_H */
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
#include "108key_trackpoint.h"
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "quantum.h"
|
||||||
|
|
||||||
|
#define LAYOUT( \
|
||||||
|
K000, K002, K003, K004, K005, K007, K008, K009, K010, K011, K012, K013, K014, K015, K016, K017, K019, K020, K021, K022, \
|
||||||
|
\
|
||||||
|
K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, K215, K216, K217, K219, K220, K221, K222, \
|
||||||
|
K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, K316, K317, K319, K320, K321, \
|
||||||
|
K400, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, K419, K420, K421, K422, \
|
||||||
|
K501, K502, K503, K504, K505, K506, K507, K508, K509, K510, K511, K513, K516, K519, K520, K521, \
|
||||||
|
K600, K601, K603, K606, K610, K611, K613, K614, K615, K616, K617, K619, K621, K622, \
|
||||||
|
K705, K706, K707 \
|
||||||
|
) { \
|
||||||
|
{ K000, KC_NO, K002, K003, K004, K005, KC_NO, K007, K008, K009, K010, K011, K012, K013, K014, K015, K016, K017, KC_NO, K019, K020, K021, K022 }, \
|
||||||
|
{ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \
|
||||||
|
{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, KC_NO, K214, K215, K216, K217, KC_NO, K219, K220, K221, K222 }, \
|
||||||
|
{ K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, K316, K317, KC_NO, K319, K320, K321, KC_NO }, \
|
||||||
|
{ K400, KC_NO, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K419, K420, K421, K422 }, \
|
||||||
|
{ KC_NO, K501, K502, K503, K504, K505, K506, K507, K508, K509, K510, K511, KC_NO, K513, KC_NO, KC_NO, K516, KC_NO, KC_NO, K519, K520, K521, KC_NO }, \
|
||||||
|
{ K600, K601, KC_NO, K603, KC_NO, KC_NO, K606, KC_NO, KC_NO, KC_NO, K610, K611, KC_NO, K613, K614, K615, K616, K617, KC_NO, K619, KC_NO, K621, K622 }, \
|
||||||
|
{ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K705, K706, K707, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO } \
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
# 108 Key with TrackPoint
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
This is based off the handwired/trackpoint keyboard and generated code from [Keyboard Firmware Builder](https://kbfirmware.com/).
|
||||||
|
|
||||||
|
Keyboard Maintainer: [mkem114](https://github.com/mkem114)
|
||||||
|
Hardware Supported (tested): Teensy++ 2.0
|
||||||
|
|
||||||
|
Make example for this keyboard (after setting up your build environment):
|
||||||
|
|
||||||
|
make handwired/108keyTrackpoint: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).
|
||||||
|
|
||||||
|
You may have to modify the source code to suit 104 keys, RGB back-lights, different micro-controllers, or big ass enter.
|
||||||
|
|
||||||
|
There are three keymaps:
|
||||||
|
* qwerty with the four extra keys being: mute, media prev, media next, and media play
|
||||||
|
* dvorak with the four extra keys being: mute, media prev, media next, and media play
|
||||||
|
* dvorak_media with the caps lock being media play and the four extra keys being: mute, volume down, volume up, and media next
|
||||||
|
|
||||||
|
To figure out how to wire your specific TrackPoint have a look out: [How to integrate a trackpoint in a mechanical keyboard](https://github.com/alonswartz/trackpoint).
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "config_common.h"
|
||||||
|
|
||||||
|
#define VENDOR_ID 0x1234
|
||||||
|
#define PRODUCT_ID 0x5678
|
||||||
|
#define DEVICE_VER 0x0001
|
||||||
|
#define MANUFACTURER QMK
|
||||||
|
#define PRODUCT 108Key-Trackpoint
|
||||||
|
#define DESCRIPTION A 108 key ANSI keyboard with a trackpoint and three mouse buttons
|
||||||
|
|
||||||
|
#define MATRIX_ROWS 8
|
||||||
|
#define MATRIX_COLS 23
|
||||||
|
|
||||||
|
#ifdef PS2_USE_USART
|
||||||
|
#define PS2_CLOCK_PORT PORTD
|
||||||
|
#define PS2_CLOCK_PIN PIND
|
||||||
|
#define PS2_CLOCK_DDR DDRD
|
||||||
|
#define PS2_CLOCK_BIT 5
|
||||||
|
#define PS2_DATA_PORT PORTD
|
||||||
|
#define PS2_DATA_PIN PIND
|
||||||
|
#define PS2_DATA_DDR DDRD
|
||||||
|
#define PS2_DATA_BIT 2
|
||||||
|
|
||||||
|
/* synchronous, odd parity, 1-bit stop, 8-bit data, sample at falling edge */
|
||||||
|
/* set DDR of CLOCK as input to be slave */
|
||||||
|
#define PS2_USART_INIT() do { \
|
||||||
|
PS2_CLOCK_DDR &= ~(1<<PS2_CLOCK_BIT); \
|
||||||
|
PS2_DATA_DDR &= ~(1<<PS2_DATA_BIT); \
|
||||||
|
UCSR1C = ((1 << UMSEL10) | \
|
||||||
|
(3 << UPM10) | \
|
||||||
|
(0 << USBS1) | \
|
||||||
|
(3 << UCSZ10) | \
|
||||||
|
(0 << UCPOL1)); \
|
||||||
|
UCSR1A = 0; \
|
||||||
|
UBRR1H = 0; \
|
||||||
|
UBRR1L = 0; \
|
||||||
|
} while (0)
|
||||||
|
#define PS2_USART_RX_INT_ON() do { \
|
||||||
|
UCSR1B = ((1 << RXCIE1) | \
|
||||||
|
(1 << RXEN1)); \
|
||||||
|
} while (0)
|
||||||
|
#define PS2_USART_RX_POLL_ON() do { \
|
||||||
|
UCSR1B = (1 << RXEN1); \
|
||||||
|
} while (0)
|
||||||
|
#define PS2_USART_OFF() do { \
|
||||||
|
UCSR1C = 0; \
|
||||||
|
UCSR1B &= ~((1 << RXEN1) | \
|
||||||
|
(1 << TXEN1)); \
|
||||||
|
} while (0)
|
||||||
|
#define PS2_USART_RX_READY (UCSR1A & (1<<RXC1))
|
||||||
|
#define PS2_USART_RX_DATA UDR1
|
||||||
|
#define PS2_USART_ERROR (UCSR1A & ((1<<FE1) | (1<<DOR1) | (1<<UPE1)))
|
||||||
|
#define PS2_USART_RX_VECT USART1_RX_vect
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define MATRIX_ROW_PINS { B0, B1, B2, B3, B4, B5, B6, B7 }
|
||||||
|
#define MATRIX_COL_PINS { C0, C1, C2, C3, C4, C5, C6, C7, D0, D1, F0, D3, D4, F1, D6, D7, E0, E1, E2, E3, E4, E5, E6 }
|
||||||
|
#define UNUSED_PINS
|
||||||
|
|
||||||
|
/* COL2ROW or ROW2COL */
|
||||||
|
#define DIODE_DIRECTION COL2ROW
|
||||||
|
|
||||||
|
#define DEBOUNCING_DELAY 5
|
||||||
|
|
||||||
|
#define LOCKING_SUPPORT_ENABLE
|
||||||
|
#define LOCKING_RESYNC_ENABLE
|
||||||
|
|
||||||
|
/* key combination for commkand */
|
||||||
|
#define IS_COMMAND() ( \
|
||||||
|
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
|
||||||
|
)
|
||||||
|
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
[0] = LAYOUT (
|
||||||
|
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, KC_MUTE, KC_MPRV, KC_MNXT, KC_MPLY,
|
||||||
|
|
||||||
|
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS,
|
||||||
|
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, KC_P7, KC_P8, KC_P9,
|
||||||
|
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_P4, KC_P5, KC_P6, KC_PPLS,
|
||||||
|
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT, KC_UP, KC_P1, KC_P2, KC_P3,
|
||||||
|
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_LALT, KC_LGUI, KC_APP, KC_LCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT,
|
||||||
|
KC_BTN1, KC_BTN3, KC_BTN2
|
||||||
|
)
|
||||||
|
};
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
[0] = LAYOUT (
|
||||||
|
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, KC_MUTE, KC_MPRV, KC_MNXT, KC_MPLY,
|
||||||
|
|
||||||
|
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, KC_RBRC, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS,
|
||||||
|
KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, KC_EQL, KC_BSLS, KC_DEL, KC_END, KC_PGDN, KC_P7, KC_P8, KC_P9,
|
||||||
|
KC_CAPS, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS,
|
||||||
|
KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_LSFT, KC_UP, KC_P1, KC_P2, KC_P3,
|
||||||
|
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_LALT, KC_LGUI, KC_APP, KC_LCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT,
|
||||||
|
KC_BTN1, KC_BTN3, KC_BTN2
|
||||||
|
)
|
||||||
|
};
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
[0] = LAYOUT (
|
||||||
|
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT,
|
||||||
|
|
||||||
|
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, KC_RBRC, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS,
|
||||||
|
KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, KC_EQL, KC_BSLS, KC_DEL, KC_END, KC_PGDN, KC_P7, KC_P8, KC_P9,
|
||||||
|
KC_MPLY, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS,
|
||||||
|
KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_LSFT, KC_UP, KC_P1, KC_P2, KC_P3,
|
||||||
|
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_LALT, KC_LGUI, KC_APP, KC_LCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT,
|
||||||
|
KC_BTN1, KC_BTN3, KC_BTN2
|
||||||
|
)
|
||||||
|
};
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
# 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 = halfkay
|
||||||
|
|
||||||
|
|
||||||
|
# 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 = 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)
|
||||||
|
PS2_MOUSE_ENABLE = yes
|
||||||
|
PS2_USE_USART = yes
|
||||||
@@ -10,4 +10,34 @@
|
|||||||
#include <avr/io.h>
|
#include <avr/io.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
|
// This is the 21-key keypad to 4x6 element matrix mapping
|
||||||
|
#define LAYOUT( \
|
||||||
|
KM_ESC, KM_TAB, KM_BSL, KM_ARR, \
|
||||||
|
KM_NUM, KM_FSL, KM_AST, KM_MIN, \
|
||||||
|
KM___7, KM___8, KM___9, KM_EQU, \
|
||||||
|
KM___4, KM___5, KM___6, KM_PLS, \
|
||||||
|
KM___1, KM___2, KM___3, ___ENT, \
|
||||||
|
KM___0, _____0, KM_DOT, KM_ENT \
|
||||||
|
) { \
|
||||||
|
{ KM_ESC, KM_TAB, KM_BSL, KM_ARR }, \
|
||||||
|
{ KM_NUM, KM_FSL, KM_AST, KM_MIN }, \
|
||||||
|
{ KM___7, KM___8, KM___9, KM_EQU }, \
|
||||||
|
{ KM___4, KM___5, KM___6, KM_PLS }, \
|
||||||
|
{ KM___1, KM___2, KM___3, KC_NO }, \
|
||||||
|
{ KM___0, KC_NO, KM_DOT, KM_ENT } \
|
||||||
|
}
|
||||||
|
|
||||||
|
// This is the 21-key keypad to 2x11 element matrix mapping
|
||||||
|
#define LAYOUT_pad21( \
|
||||||
|
KM_ESC, KM_TAB, KM_BSL, KM_ARR, \
|
||||||
|
KM_NUM, KM_FSL, KM_AST, KM_MIN, \
|
||||||
|
KM___7, KM___8, KM___9, \
|
||||||
|
KM___4, KM___5, KM___6, KM_PLS, \
|
||||||
|
KM___1, KM___2, KM___3, \
|
||||||
|
KM___0, KM_DOT, KM_ENT \
|
||||||
|
) { \
|
||||||
|
{ KM_ESC, KM_TAB, KM_BSL, KM_ARR, KM___7, KM___8, KM___9, KM_PLS, KM___1, KM___2, KM___3, }, \
|
||||||
|
{ KM_NUM, KM_FSL, KM_AST, KM_MIN, KM___4, KM___5, KM___6, KM_ENT, KC_NO, KM___0, KM_DOT, }, \
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
{
|
||||||
|
"keyboard_name": "arrow_pad",
|
||||||
|
"url": "",
|
||||||
|
"maintainer": "qmk",
|
||||||
|
"width": 4,
|
||||||
|
"height": 6,
|
||||||
|
"layouts": {
|
||||||
|
"LAYOUT": {
|
||||||
|
"layout": [
|
||||||
|
{"label":"KM_ESC", "x":0, "y":0},
|
||||||
|
{"label":"KM_TAB", "x":1, "y":0},
|
||||||
|
{"label":"KM_BSL", "x":2, "y":0},
|
||||||
|
{"label":"KM_ARR", "x":3, "y":0},
|
||||||
|
{"label":"KM_NUM", "x":0, "y":1},
|
||||||
|
{"label":"KM_FSL", "x":1, "y":1},
|
||||||
|
{"label":"KM_AST", "x":2, "y":1},
|
||||||
|
{"label":"KM_MIN", "x":3, "y":1},
|
||||||
|
{"label":"KM___7", "x":0, "y":2},
|
||||||
|
{"label":"KM___8", "x":1, "y":2},
|
||||||
|
{"label":"KM___9", "x":2, "y":2},
|
||||||
|
{"label":"KM_EQU", "x":3, "y":2},
|
||||||
|
{"label":"KM___4", "x":0, "y":3},
|
||||||
|
{"label":"KM___5", "x":1, "y":3},
|
||||||
|
{"label":"KM___6", "x":2, "y":3},
|
||||||
|
{"label":"KM_PLS", "x":3, "y":3},
|
||||||
|
{"label":"KM___1", "x":0, "y":4},
|
||||||
|
{"label":"KM___2", "x":1, "y":4},
|
||||||
|
{"label":"KM___3", "x":2, "y":4},
|
||||||
|
{"label":"___ENT", "x":3, "y":4},
|
||||||
|
{"label":"KM___0", "x":0, "y":5},
|
||||||
|
{"label":"_____0", "x":1, "y":5},
|
||||||
|
{"label":"KM_DOT", "x":2, "y":5},
|
||||||
|
{"label":"KM_ENT", "x":3, "y":5}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"LAYOUT_pad21": {
|
||||||
|
"layout": [
|
||||||
|
{"label":"KM_ESC", "x":0, "y":0},
|
||||||
|
{"label":"KM_TAB", "x":1, "y":0},
|
||||||
|
{"label":"KM_BSL", "x":2, "y":0},
|
||||||
|
{"label":"KM_ARR", "x":3, "y":0},
|
||||||
|
{"label":"KM_NUM", "x":0, "y":1},
|
||||||
|
{"label":"KM_FSL", "x":1, "y":1},
|
||||||
|
{"label":"KM_AST", "x":2, "y":1},
|
||||||
|
{"label":"KM_MIN", "x":3, "y":1},
|
||||||
|
{"label":"KM___7", "x":0, "y":2},
|
||||||
|
{"label":"KM___8", "x":1, "y":2},
|
||||||
|
{"label":"KM___9", "x":2, "y":2},
|
||||||
|
{"label":"KM___4", "x":0, "y":3},
|
||||||
|
{"label":"KM___5", "x":1, "y":3},
|
||||||
|
{"label":"KM___6", "x":2, "y":3},
|
||||||
|
{"label":"KM_PLS", "x":3, "y":2, "h":2},
|
||||||
|
{"label":"KM___1", "x":0, "y":4},
|
||||||
|
{"label":"KM___2", "x":1, "y":4},
|
||||||
|
{"label":"KM___3", "x":2, "y":4},
|
||||||
|
{"label":"KM___0", "x":0, "y":5, "w":2},
|
||||||
|
{"label":"KM_DOT", "x":2, "y":5},
|
||||||
|
{"label":"KM_ENT", "x":3, "y":4, "h":2}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,35 +1,18 @@
|
|||||||
|
|
||||||
#include "arrow_pad.h"
|
#include QMK_KEYBOARD_H
|
||||||
#include "led.h"
|
#include "led.h"
|
||||||
|
|
||||||
// This is the 21-key keypad to 2x11 element matrix mapping
|
enum layers {
|
||||||
#define LAYOUT( \
|
LAYER_BASE,
|
||||||
KM_ESC, KM_TAB, KM_BSL, KM_ARR, \
|
LAYER_EDIT,
|
||||||
KM_NUM, KM_FSL, KM_AST, KM_MIN, \
|
LAYER_FUNCTION
|
||||||
KM___7, KM___8, KM___9, KM_EQU, \
|
};
|
||||||
KM___4, KM___5, KM___6, KM_PLS, \
|
|
||||||
KM___1, KM___2, KM___3, ___ENT, \
|
|
||||||
KM___0, _____0, KM_DOT, KM_ENT \
|
|
||||||
) { \
|
|
||||||
{ KM_ESC, KM_TAB, KM_BSL, KM_ARR }, \
|
|
||||||
{ KM_NUM, KM_FSL, KM_AST, KM_MIN }, \
|
|
||||||
{ KM___7, KM___8, KM___9, KM_EQU }, \
|
|
||||||
{ KM___4, KM___5, KM___6, KM_PLS }, \
|
|
||||||
{ KM___1, KM___2, KM___3, KC_NO }, \
|
|
||||||
{ KM___0, KC_NO, KM_DOT, KM_ENT } \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define LAYER_BASE 0
|
enum custom_keycodes {
|
||||||
#define LAYER_EDIT 1
|
M_COPY = SAFE_RANGE, // KC_FN5: MACRO_COPY_CUT
|
||||||
#define LAYER_FUNCTION 2
|
M_SHFCT, // KC_FN6: MACRO_SHIFT_CONTROL
|
||||||
|
M_CTALT // KC_FN7: MACRO_CONTROL_ALT
|
||||||
#define MACRO_COPY_CUT 0
|
};
|
||||||
#define MACRO_SHIFT_CONTROL 1
|
|
||||||
#define MACRO_CONTROL_ALT 2
|
|
||||||
|
|
||||||
#define M_COPY KC_FN5
|
|
||||||
#define M_SHFCT KC_FN6
|
|
||||||
#define M_CTALT KC_FN7
|
|
||||||
|
|
||||||
#define SC_UNDO LCTL(KC_Z)
|
#define SC_UNDO LCTL(KC_Z)
|
||||||
#define SC_REDO LCTL(KC_Y)
|
#define SC_REDO LCTL(KC_Y)
|
||||||
@@ -42,13 +25,10 @@
|
|||||||
#define SC_ACLS LALT(KC_F4)
|
#define SC_ACLS LALT(KC_F4)
|
||||||
#define SC_CCLS LCTL(KC_F4)
|
#define SC_CCLS LCTL(KC_F4)
|
||||||
|
|
||||||
#define _______ KC_TRNS
|
|
||||||
#define XXXXXXX KC_NO
|
|
||||||
|
|
||||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
|
||||||
[LAYER_BASE] = LAYOUT( \
|
[LAYER_BASE] = LAYOUT( \
|
||||||
KC_ESC, KC_TAB, KC_BSLS, KC_FN0, \
|
KC_ESC, KC_TAB, KC_BSLS, MO(2), \
|
||||||
KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \
|
KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \
|
||||||
KC_P7, KC_P8, KC_P9, KC_PEQL, \
|
KC_P7, KC_P8, KC_P9, KC_PEQL, \
|
||||||
KC_P4, KC_P5, KC_P6, KC_PPLS, \
|
KC_P4, KC_P5, KC_P6, KC_PPLS, \
|
||||||
@@ -57,15 +37,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||||||
|
|
||||||
[LAYER_EDIT] = LAYOUT( \
|
[LAYER_EDIT] = LAYOUT( \
|
||||||
KC_ESC, KC_TAB, KC_SPC, _______, \
|
KC_ESC, KC_TAB, KC_SPC, _______, \
|
||||||
KC_FN1, SC_PSTE, SC_REDO, SC_UNDO, \
|
TG(1), SC_PSTE, SC_REDO, SC_UNDO, \
|
||||||
KC_HOME, KC_UP, KC_PGUP, KC_LALT, \
|
KC_HOME, KC_UP, KC_PGUP, KC_LALT, \
|
||||||
KC_LEFT, M_COPY, KC_RGHT, KC_LCTL, \
|
KC_LEFT, M_COPY, KC_RGHT, KC_LCTL, \
|
||||||
KC_END, KC_DOWN, KC_PGDN, XXXXXXX, \
|
KC_END, KC_DOWN, KC_PGDN, XXXXXXX, \
|
||||||
KC_BSPC, KC_PENT, KC_DEL, M_SHFCT),
|
KC_BSPC, KC_PENT, KC_DEL, M_SHFCT ),
|
||||||
|
|
||||||
[LAYER_FUNCTION] = LAYOUT( \
|
[LAYER_FUNCTION] = LAYOUT( \
|
||||||
KC_FN2, KC_FN3, KC_FN4, _______, \
|
BL_TOGG, BL_INC, BL_DEC, _______, \
|
||||||
KC_FN1, _______, _______, _______, \
|
TG(1), _______, _______, _______, \
|
||||||
_______, _______, _______, _______, \
|
_______, _______, _______, _______, \
|
||||||
_______, _______, _______, _______, \
|
_______, _______, _______, _______, \
|
||||||
_______, _______, _______, XXXXXXX, \
|
_______, _______, _______, XXXXXXX, \
|
||||||
@@ -74,68 +54,46 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
const uint16_t PROGMEM fn_actions[] = {
|
bool process_record_user(uint16_t keycode, keyrecord_t * record) {
|
||||||
[0] = ACTION_LAYER_MOMENTARY(LAYER_FUNCTION),
|
|
||||||
[1] = ACTION_LAYER_TOGGLE(LAYER_EDIT),
|
|
||||||
[2] = ACTION_BACKLIGHT_TOGGLE(),
|
|
||||||
[3] = ACTION_BACKLIGHT_INCREASE(),
|
|
||||||
[4] = ACTION_BACKLIGHT_DECREASE(),
|
|
||||||
[5] = ACTION_MACRO_TAP(MACRO_COPY_CUT),
|
|
||||||
[6] = ACTION_MACRO_TAP(MACRO_SHIFT_CONTROL),
|
|
||||||
[7] = ACTION_MACRO_TAP(MACRO_CONTROL_ALT),
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
|
||||||
{
|
|
||||||
// MACRODOWN only works in this function
|
// MACRODOWN only works in this function
|
||||||
switch (id) {
|
switch (keycode) {
|
||||||
|
|
||||||
case MACRO_COPY_CUT:
|
case M_COPY:
|
||||||
if (record->event.pressed) {
|
if (record->event.pressed) {
|
||||||
register_code(KC_LCTL);
|
register_code(KC_LCTL);
|
||||||
if (record->tap.count == 1) {
|
if (record->tap.count == 1) {
|
||||||
register_code(KC_C);
|
register_code(KC_C);
|
||||||
unregister_code(KC_C);
|
unregister_code(KC_C);
|
||||||
}
|
} else if (record->tap.count == 2) {
|
||||||
else if (record->tap.count == 2) {
|
register_code(KC_X);
|
||||||
register_code(KC_X);
|
unregister_code(KC_X);
|
||||||
unregister_code(KC_X);
|
}
|
||||||
}
|
unregister_code(KC_LCTL);
|
||||||
unregister_code(KC_LCTL);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case MACRO_SHIFT_CONTROL:
|
|
||||||
if (record->event.pressed) {
|
|
||||||
if (record->tap.count <= 2) register_mods(MOD_BIT(KC_LSFT));
|
|
||||||
if (record->tap.count == 2) register_mods(MOD_BIT(KC_LCTL));
|
|
||||||
if (record->tap.count == 3) register_code(KC_PENT);;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_LCTL));
|
|
||||||
unregister_code(KC_PENT);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case MACRO_CONTROL_ALT:
|
|
||||||
if (record->event.pressed) {
|
|
||||||
if (record->tap.count < 2) register_mods(MOD_BIT(KC_LCTL));
|
|
||||||
if (record->tap.count >= 2) register_mods(MOD_BIT(KC_LALT));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
unregister_mods(MOD_BIT(KC_LCTL) | MOD_BIT(KC_LALT));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
return MACRO_NONE;
|
case M_SHFCT:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
if (record->tap.count <= 2) register_mods(MOD_BIT(KC_LSFT));
|
||||||
|
if (record->tap.count == 2) register_mods(MOD_BIT(KC_LCTL));
|
||||||
|
if (record->tap.count == 3) register_code(KC_PENT);;
|
||||||
|
} else {
|
||||||
|
unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_LCTL));
|
||||||
|
unregister_code(KC_PENT);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case M_CTALT:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
if (record->tap.count < 2) register_mods(MOD_BIT(KC_LCTL));
|
||||||
|
if (record->tap.count >= 2) register_mods(MOD_BIT(KC_LALT));
|
||||||
|
} else {
|
||||||
|
unregister_mods(MOD_BIT(KC_LCTL) | MOD_BIT(KC_LALT));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void led_set_user(uint8_t usb_led)
|
void led_set_user(uint8_t usb_led)
|
||||||
|
|||||||
@@ -1,32 +1,18 @@
|
|||||||
|
|
||||||
#include "arrow_pad.h"
|
#include QMK_KEYBOARD_H
|
||||||
#include "led.h"
|
#include "led.h"
|
||||||
|
|
||||||
// This is the 21-key keypad to 2x11 element matrix mapping
|
enum layers {
|
||||||
#define LAYOUT( \
|
LAYER_BASE,
|
||||||
KM_ESC, KM_TAB, KM_BSL, KM_ARR, \
|
LAYER_EDIT,
|
||||||
KM_NUM, KM_FSL, KM_AST, KM_MIN, \
|
LAYER_FUNCTION
|
||||||
KM___7, KM___8, KM___9, ___PLS, \
|
};
|
||||||
KM___4, KM___5, KM___6, KM_PLS, \
|
|
||||||
KM___1, KM___2, KM___3, ___ENT, \
|
|
||||||
KM___0, _____0, KM_DOT, KM_ENT \
|
|
||||||
) { \
|
|
||||||
{ KM_ESC, KM_TAB, KM_BSL, KM_ARR, KM___7, KM___8, KM___9, KM_PLS, KM___1, KM___2, KM___3, }, \
|
|
||||||
{ KM_NUM, KM_FSL, KM_AST, KM_MIN, KM___4, KM___5, KM___6, KM_ENT, KC_NO, KM___0, KM_DOT, }, \
|
|
||||||
}
|
|
||||||
|
|
||||||
|
enum custom_keycodes {
|
||||||
#define LAYER_BASE 0
|
M_COPY = SAFE_RANGE, // KC_FN5: MACRO_COPY_CUT
|
||||||
#define LAYER_EDIT 1
|
M_SHFCT, // KC_FN6: MACRO_SHIFT_CONTROL
|
||||||
#define LAYER_FUNCTION 2
|
M_CTALT // KC_FN7: MACRO_CONTROL_ALT
|
||||||
|
};
|
||||||
#define MACRO_COPY_CUT 0
|
|
||||||
#define MACRO_SHIFT_CONTROL 1
|
|
||||||
#define MACRO_CONTROL_ALT 2
|
|
||||||
|
|
||||||
#define M_COPY KC_FN5
|
|
||||||
#define M_SHFCT KC_FN6
|
|
||||||
#define M_CTALT KC_FN7
|
|
||||||
|
|
||||||
#define SC_UNDO LCTL(KC_Z)
|
#define SC_UNDO LCTL(KC_Z)
|
||||||
#define SC_REDO LCTL(KC_Y)
|
#define SC_REDO LCTL(KC_Y)
|
||||||
@@ -39,100 +25,75 @@
|
|||||||
#define SC_ACLS LALT(KC_F4)
|
#define SC_ACLS LALT(KC_F4)
|
||||||
#define SC_CCLS LCTL(KC_F4)
|
#define SC_CCLS LCTL(KC_F4)
|
||||||
|
|
||||||
#define _______ KC_TRNS
|
|
||||||
#define XXXXXXX KC_NO
|
|
||||||
|
|
||||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
|
||||||
[LAYER_BASE] = LAYOUT( \
|
[LAYER_BASE] = LAYOUT_pad21( \
|
||||||
KC_ESC, KC_TAB, KC_BSLS, KC_FN0, \
|
KC_ESC, KC_TAB, KC_BSLS, MO(2), \
|
||||||
KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \
|
KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \
|
||||||
KC_P7, KC_P8, KC_P9, XXXXXXX, \
|
KC_P7, KC_P8, KC_P9, \
|
||||||
KC_P4, KC_P5, KC_P6, KC_PPLS, \
|
KC_P4, KC_P5, KC_P6, KC_PPLS, \
|
||||||
KC_P1, KC_P2, KC_P3, XXXXXXX, \
|
KC_P1, KC_P2, KC_P3, \
|
||||||
KC_P0, XXXXXXX, KC_PDOT, KC_PENT ),
|
KC_P0, KC_PDOT, KC_PENT ),
|
||||||
|
|
||||||
[LAYER_EDIT] = LAYOUT( \
|
[LAYER_EDIT] = LAYOUT_pad21( \
|
||||||
KC_ESC, KC_TAB, KC_SPC, _______, \
|
KC_ESC, KC_TAB, KC_SPC, _______, \
|
||||||
KC_FN1, SC_PSTE, SC_REDO, SC_UNDO, \
|
TG(1), SC_PSTE, SC_REDO, SC_UNDO, \
|
||||||
KC_HOME, KC_UP, KC_PGUP, XXXXXXX, \
|
KC_HOME, KC_UP, KC_PGUP, \
|
||||||
KC_LEFT, M_COPY, KC_RGHT, M_CTALT, \
|
KC_LEFT, M_COPY, KC_RGHT, M_CTALT, \
|
||||||
KC_END, KC_DOWN, KC_PGDN, XXXXXXX, \
|
KC_END, KC_DOWN, KC_PGDN, \
|
||||||
KC_BSPC, XXXXXXX, KC_DEL, M_SHFCT),
|
KC_BSPC, KC_DEL, M_SHFCT),
|
||||||
|
|
||||||
[LAYER_FUNCTION] = LAYOUT( \
|
[LAYER_FUNCTION] = LAYOUT_pad21( \
|
||||||
KC_FN2, KC_FN3, KC_FN4, _______, \
|
BL_TOGG, BL_INC, BL_DEC, _______, \
|
||||||
KC_FN1, _______, _______, _______, \
|
TG(1), _______, _______, _______, \
|
||||||
_______, _______, _______, XXXXXXX, \
|
_______, _______, _______, \
|
||||||
_______, _______, _______, _______, \
|
_______, _______, _______, _______, \
|
||||||
_______, _______, _______, XXXXXXX, \
|
_______, _______, _______, \
|
||||||
RESET, XXXXXXX, _______, _______ ),
|
RESET, _______, _______ ),
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
const uint16_t PROGMEM fn_actions[] = {
|
bool process_record_user(uint16_t keycode, keyrecord_t * record) {
|
||||||
[0] = ACTION_LAYER_MOMENTARY(LAYER_FUNCTION),
|
|
||||||
[1] = ACTION_LAYER_TOGGLE(LAYER_EDIT),
|
|
||||||
[2] = ACTION_BACKLIGHT_TOGGLE(),
|
|
||||||
[3] = ACTION_BACKLIGHT_INCREASE(),
|
|
||||||
[4] = ACTION_BACKLIGHT_DECREASE(),
|
|
||||||
[5] = ACTION_MACRO_TAP(MACRO_COPY_CUT),
|
|
||||||
[6] = ACTION_MACRO_TAP(MACRO_SHIFT_CONTROL),
|
|
||||||
[7] = ACTION_MACRO_TAP(MACRO_CONTROL_ALT),
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
|
||||||
{
|
|
||||||
// MACRODOWN only works in this function
|
// MACRODOWN only works in this function
|
||||||
switch (id) {
|
switch (keycode) {
|
||||||
|
|
||||||
case MACRO_COPY_CUT:
|
case M_COPY:
|
||||||
if (record->event.pressed) {
|
if (record->event.pressed) {
|
||||||
register_code(KC_LCTL);
|
register_code(KC_LCTL);
|
||||||
if (record->tap.count == 1) {
|
if (record->tap.count == 1) {
|
||||||
register_code(KC_C);
|
register_code(KC_C);
|
||||||
unregister_code(KC_C);
|
unregister_code(KC_C);
|
||||||
}
|
} else if (record->tap.count == 2) {
|
||||||
else if (record->tap.count == 2) {
|
register_code(KC_X);
|
||||||
register_code(KC_X);
|
unregister_code(KC_X);
|
||||||
unregister_code(KC_X);
|
}
|
||||||
}
|
unregister_code(KC_LCTL);
|
||||||
unregister_code(KC_LCTL);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case MACRO_SHIFT_CONTROL:
|
|
||||||
if (record->event.pressed) {
|
|
||||||
if (record->tap.count <= 2) register_mods(MOD_BIT(KC_LSFT));
|
|
||||||
if (record->tap.count == 2) register_mods(MOD_BIT(KC_LCTL));
|
|
||||||
if (record->tap.count == 3) register_code(KC_PENT);;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_LCTL));
|
|
||||||
unregister_code(KC_PENT);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case MACRO_CONTROL_ALT:
|
|
||||||
if (record->event.pressed) {
|
|
||||||
if (record->tap.count < 2) register_mods(MOD_BIT(KC_LCTL));
|
|
||||||
if (record->tap.count >= 2) register_mods(MOD_BIT(KC_LALT));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
unregister_mods(MOD_BIT(KC_LCTL) | MOD_BIT(KC_LALT));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
return MACRO_NONE;
|
case M_SHFCT:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
if (record->tap.count <= 2) register_mods(MOD_BIT(KC_LSFT));
|
||||||
|
if (record->tap.count == 2) register_mods(MOD_BIT(KC_LCTL));
|
||||||
|
if (record->tap.count == 3) register_code(KC_PENT);;
|
||||||
|
} else {
|
||||||
|
unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_LCTL));
|
||||||
|
unregister_code(KC_PENT);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case M_CTALT:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
if (record->tap.count < 2) register_mods(MOD_BIT(KC_LCTL));
|
||||||
|
if (record->tap.count >= 2) register_mods(MOD_BIT(KC_LALT));
|
||||||
|
} else {
|
||||||
|
unregister_mods(MOD_BIT(KC_LCTL) | MOD_BIT(KC_LALT));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void led_set_user(uint8_t usb_led)
|
void led_set_user(uint8_t usb_led)
|
||||||
|
|||||||
@@ -1,35 +1,18 @@
|
|||||||
|
|
||||||
#include "arrow_pad.h"
|
#include QMK_KEYBOARD_H
|
||||||
#include "led.h"
|
#include "led.h"
|
||||||
|
|
||||||
// This is the 21-key keypad to 2x11 element matrix mapping
|
enum layers {
|
||||||
#define LAYOUT( \
|
LAYER_BASE,
|
||||||
KM_ESC, KM_TAB, KM_BSL, KM_ARR, \
|
LAYER_EDIT,
|
||||||
KM_NUM, KM_FSL, KM_AST, KM_MIN, \
|
LAYER_FUNCTION
|
||||||
KM___7, KM___8, KM___9, KM_EQU, \
|
};
|
||||||
KM___4, KM___5, KM___6, KM_PLS, \
|
|
||||||
KM___1, KM___2, KM___3, ___ENT, \
|
|
||||||
KM___0, _____0, KM_DOT, KM_ENT \
|
|
||||||
) { \
|
|
||||||
{ KM_ESC, KM_TAB, KM_BSL, KM_ARR }, \
|
|
||||||
{ KM_NUM, KM_FSL, KM_AST, KM_MIN }, \
|
|
||||||
{ KM___7, KM___8, KM___9, KM_EQU }, \
|
|
||||||
{ KM___4, KM___5, KM___6, KM_PLS }, \
|
|
||||||
{ KM___1, KM___2, KM___3, KC_NO }, \
|
|
||||||
{ KM___0, KC_NO, KM_DOT, KM_ENT } \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define LAYER_BASE 0
|
enum custom_keycodes {
|
||||||
#define LAYER_EDIT 1
|
M_COPY = SAFE_RANGE, // KC_FN5: MACRO_COPY_CUT
|
||||||
#define LAYER_FUNCTION 2
|
M_SHFCT, // KC_FN6: MACRO_SHIFT_CONTROL
|
||||||
|
M_CTALT // KC_FN7: MACRO_CONTROL_ALT
|
||||||
#define MACRO_COPY_CUT 0
|
};
|
||||||
#define MACRO_SHIFT_CONTROL 1
|
|
||||||
#define MACRO_CONTROL_ALT 2
|
|
||||||
|
|
||||||
#define M_COPY KC_FN5
|
|
||||||
#define M_SHFCT KC_FN6
|
|
||||||
#define M_CTALT KC_FN7
|
|
||||||
|
|
||||||
#define SC_UNDO LCTL(KC_Z)
|
#define SC_UNDO LCTL(KC_Z)
|
||||||
#define SC_REDO LCTL(KC_Y)
|
#define SC_REDO LCTL(KC_Y)
|
||||||
@@ -42,13 +25,10 @@
|
|||||||
#define SC_ACLS LALT(KC_F4)
|
#define SC_ACLS LALT(KC_F4)
|
||||||
#define SC_CCLS LCTL(KC_F4)
|
#define SC_CCLS LCTL(KC_F4)
|
||||||
|
|
||||||
#define _______ KC_TRNS
|
|
||||||
#define XXXXXXX KC_NO
|
|
||||||
|
|
||||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
|
||||||
[LAYER_BASE] = LAYOUT( \
|
[LAYER_BASE] = LAYOUT( \
|
||||||
KC_ESC, KC_TAB, KC_BSLS, KC_FN0, \
|
KC_ESC, KC_TAB, KC_BSLS, MO(2), \
|
||||||
KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \
|
KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \
|
||||||
KC_P7, KC_P8, KC_P9, KC_PEQL, \
|
KC_P7, KC_P8, KC_P9, KC_PEQL, \
|
||||||
KC_P4, KC_P5, KC_P6, KC_PPLS, \
|
KC_P4, KC_P5, KC_P6, KC_PPLS, \
|
||||||
@@ -57,15 +37,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||||||
|
|
||||||
[LAYER_EDIT] = LAYOUT( \
|
[LAYER_EDIT] = LAYOUT( \
|
||||||
KC_ESC, KC_TAB, KC_SPC, _______, \
|
KC_ESC, KC_TAB, KC_SPC, _______, \
|
||||||
KC_FN1, SC_PSTE, SC_REDO, SC_UNDO, \
|
TG(1), SC_PSTE, SC_REDO, SC_UNDO, \
|
||||||
KC_HOME, KC_UP, KC_PGUP, KC_LALT, \
|
KC_HOME, KC_UP, KC_PGUP, KC_LALT, \
|
||||||
KC_LEFT, M_COPY, KC_RGHT, KC_LCTL, \
|
KC_LEFT, M_COPY, KC_RGHT, KC_LCTL, \
|
||||||
KC_END, KC_DOWN, KC_PGDN, XXXXXXX, \
|
KC_END, KC_DOWN, KC_PGDN, XXXXXXX, \
|
||||||
KC_BSPC, KC_PENT, KC_DEL, M_SHFCT),
|
KC_BSPC, KC_PENT, KC_DEL, M_SHFCT ),
|
||||||
|
|
||||||
[LAYER_FUNCTION] = LAYOUT( \
|
[LAYER_FUNCTION] = LAYOUT( \
|
||||||
KC_FN2, KC_FN3, KC_FN4, _______, \
|
BL_TOGG, BL_INC, BL_DEC, _______, \
|
||||||
KC_FN1, _______, _______, _______, \
|
TG(1), _______, _______, _______, \
|
||||||
_______, _______, _______, _______, \
|
_______, _______, _______, _______, \
|
||||||
_______, _______, _______, _______, \
|
_______, _______, _______, _______, \
|
||||||
_______, _______, _______, XXXXXXX, \
|
_______, _______, _______, XXXXXXX, \
|
||||||
@@ -74,68 +54,46 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
const uint16_t PROGMEM fn_actions[] = {
|
bool process_record_user(uint16_t keycode, keyrecord_t * record) {
|
||||||
[0] = ACTION_LAYER_MOMENTARY(LAYER_FUNCTION),
|
|
||||||
[1] = ACTION_LAYER_TOGGLE(LAYER_EDIT),
|
|
||||||
[2] = ACTION_BACKLIGHT_TOGGLE(),
|
|
||||||
[3] = ACTION_BACKLIGHT_INCREASE(),
|
|
||||||
[4] = ACTION_BACKLIGHT_DECREASE(),
|
|
||||||
[5] = ACTION_MACRO_TAP(MACRO_COPY_CUT),
|
|
||||||
[6] = ACTION_MACRO_TAP(MACRO_SHIFT_CONTROL),
|
|
||||||
[7] = ACTION_MACRO_TAP(MACRO_CONTROL_ALT),
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
|
||||||
{
|
|
||||||
// MACRODOWN only works in this function
|
// MACRODOWN only works in this function
|
||||||
switch (id) {
|
switch (keycode) {
|
||||||
|
|
||||||
case MACRO_COPY_CUT:
|
case M_COPY:
|
||||||
if (record->event.pressed) {
|
if (record->event.pressed) {
|
||||||
register_code(KC_LCTL);
|
register_code(KC_LCTL);
|
||||||
if (record->tap.count == 1) {
|
if (record->tap.count == 1) {
|
||||||
register_code(KC_C);
|
register_code(KC_C);
|
||||||
unregister_code(KC_C);
|
unregister_code(KC_C);
|
||||||
}
|
} else if (record->tap.count == 2) {
|
||||||
else if (record->tap.count == 2) {
|
register_code(KC_X);
|
||||||
register_code(KC_X);
|
unregister_code(KC_X);
|
||||||
unregister_code(KC_X);
|
}
|
||||||
}
|
unregister_code(KC_LCTL);
|
||||||
unregister_code(KC_LCTL);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case MACRO_SHIFT_CONTROL:
|
|
||||||
if (record->event.pressed) {
|
|
||||||
if (record->tap.count <= 2) register_mods(MOD_BIT(KC_LSFT));
|
|
||||||
if (record->tap.count == 2) register_mods(MOD_BIT(KC_LCTL));
|
|
||||||
if (record->tap.count == 3) register_code(KC_PENT);;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_LCTL));
|
|
||||||
unregister_code(KC_PENT);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case MACRO_CONTROL_ALT:
|
|
||||||
if (record->event.pressed) {
|
|
||||||
if (record->tap.count < 2) register_mods(MOD_BIT(KC_LCTL));
|
|
||||||
if (record->tap.count >= 2) register_mods(MOD_BIT(KC_LALT));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
unregister_mods(MOD_BIT(KC_LCTL) | MOD_BIT(KC_LALT));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
return MACRO_NONE;
|
case M_SHFCT:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
if (record->tap.count <= 2) register_mods(MOD_BIT(KC_LSFT));
|
||||||
|
if (record->tap.count == 2) register_mods(MOD_BIT(KC_LCTL));
|
||||||
|
if (record->tap.count == 3) register_code(KC_PENT);;
|
||||||
|
} else {
|
||||||
|
unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_LCTL));
|
||||||
|
unregister_code(KC_PENT);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case M_CTALT:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
if (record->tap.count < 2) register_mods(MOD_BIT(KC_LCTL));
|
||||||
|
if (record->tap.count >= 2) register_mods(MOD_BIT(KC_LALT));
|
||||||
|
} else {
|
||||||
|
unregister_mods(MOD_BIT(KC_LCTL) | MOD_BIT(KC_LALT));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void led_set_user(uint8_t usb_led)
|
void led_set_user(uint8_t usb_led)
|
||||||
|
|||||||
@@ -94,13 +94,13 @@ More info can be found on [GeekHack](https://geekhack.org/index.php?topic=73632.
|
|||||||
The second ArrowPad was a conversion from a 21-key Genovation keypad. It used a 2 row x 11 column matrix.
|
The second ArrowPad was a conversion from a 21-key Genovation keypad. It used a 2 row x 11 column matrix.
|
||||||
|
|
||||||
```
|
```
|
||||||
#define KEYMAP( \
|
#define LAYOUT_pad21( \
|
||||||
KM_ESC, KM_TAB, KM_BSL, KM_ARR, \
|
KM_ESC, KM_TAB, KM_BSL, KM_ARR, \
|
||||||
KM_NUM, KM_FSL, KM_AST, KM_MIN, \
|
KM_NUM, KM_FSL, KM_AST, KM_MIN, \
|
||||||
KM___7, KM___8, KM___9, ___PLS, \
|
KM___7, KM___8, KM___9, \
|
||||||
KM___4, KM___5, KM___6, KM_PLS, \
|
KM___4, KM___5, KM___6, KM_PLS, \
|
||||||
KM___1, KM___2, KM___3, ___ENT, \
|
KM___1, KM___2, KM___3, \
|
||||||
KM___0, _____0, KM_DOT, KM_ENT \
|
KM___0, KM_DOT, KM_ENT \
|
||||||
) { \
|
) { \
|
||||||
{ KM_ESC, KM_TAB, KM_BSL, KM_ARR, KM___7, KM___8, KM___9, KM_PLS, KM___1, KM___2, KM___3, }, \
|
{ KM_ESC, KM_TAB, KM_BSL, KM_ARR, KM___7, KM___8, KM___9, KM_PLS, KM___1, KM___2, KM___3, }, \
|
||||||
{ KM_NUM, KM_FSL, KM_AST, KM_MIN, KM___4, KM___5, KM___6, KM_ENT, KC_NO, KM___0, KM_DOT, }, \
|
{ KM_NUM, KM_FSL, KM_AST, KM_MIN, KM___4, KM___5, KM___6, KM_ENT, KC_NO, KM___0, KM_DOT, }, \
|
||||||
@@ -119,7 +119,7 @@ Download or clone the whole firmware and navigate to the keyboards/arrow_pad fol
|
|||||||
Depending on which keymap you would like to use, you will have to compile slightly differently.
|
Depending on which keymap you would like to use, you will have to compile slightly differently.
|
||||||
|
|
||||||
### Default
|
### Default
|
||||||
To build with the default keymap, simply run `make default`.
|
To build with the default keymap, simply run `make handwired/arrow_pad:default`.
|
||||||
|
|
||||||
### Other Keymaps
|
### Other Keymaps
|
||||||
Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create file named `<name>.c` in the keymaps folder, and see keymap document (you can find in top readme.md) and existent keymap files.
|
Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create file named `<name>.c` in the keymaps folder, and see keymap document (you can find in top readme.md) and existent keymap files.
|
||||||
@@ -127,7 +127,7 @@ Several version of keymap are available in advance but you are recommended to de
|
|||||||
To build the firmware binary hex file with a keymap just do `make` with a keymap like this:
|
To build the firmware binary hex file with a keymap just do `make` with a keymap like this:
|
||||||
|
|
||||||
```
|
```
|
||||||
$ make [default|pad_21|pad_24|<name>]
|
$ make handwired/arrow_pad:[default|pad_21|pad_24|<name>]
|
||||||
```
|
```
|
||||||
|
|
||||||
Keymaps follow the format **__\<name\>.c__** and are stored in the `keymaps` folder.
|
Keymaps follow the format **__\<name\>.c__** and are stored in the `keymaps` folder.
|
||||||
@@ -1,3 +1,2 @@
|
|||||||
SRC += pico/matrix.c \
|
SRC += pico/matrix.c
|
||||||
pico/split_util.c \
|
SRC += pico/split_util.c
|
||||||
ws2812.c
|
|
||||||
@@ -4,6 +4,7 @@
|
|||||||
#undef TAPPING_FORCE_HOLD
|
#undef TAPPING_FORCE_HOLD
|
||||||
#undef TAPPING_TERM
|
#undef TAPPING_TERM
|
||||||
#define TAPPING_TERM 120
|
#define TAPPING_TERM 120
|
||||||
|
#define SWAP_SCLN
|
||||||
|
|
||||||
// If you need more program area, try select and reduce rgblight modes to use.
|
// If you need more program area, try select and reduce rgblight modes to use.
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
|
|||||||
switch(keycode) {
|
switch(keycode) {
|
||||||
case KC_LOCK:
|
case KC_LOCK:
|
||||||
if (record->event.pressed) {
|
if (record->event.pressed) {
|
||||||
if (edvorakjp_config.enable_kc_lang) {
|
if (get_enable_kc_lang()) {
|
||||||
SEND_STRING( SS_LCTRL(SS_LSFT(SS_TAP(X_POWER))) );
|
SEND_STRING( SS_LCTRL(SS_LSFT(SS_TAP(X_POWER))) );
|
||||||
} else {
|
} else {
|
||||||
SEND_STRING( SS_LGUI("l") );
|
SEND_STRING( SS_LGUI("l") );
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||||||
|
|
||||||
[_EDVORAK] = LAYOUT_kc(
|
[_EDVORAK] = LAYOUT_kc(
|
||||||
//,----+----+----+----+----+----. ,----+----+----+----+----+----.
|
//,----+----+----+----+----+----. ,----+----+----+----+----+----.
|
||||||
LBRC,RBRC,COMM,DOT , P , Y , F , G , R , W , Q ,BSLS,
|
LBRC,RBRC,COMM,DOT , Y , P , F , G , R , W , Q ,BSLS,
|
||||||
//|----+----+----+----+----+----| |----+----+----+----+----+----|
|
//|----+----+----+----+----+----| |----+----+----+----+----+----|
|
||||||
EQL , A , O , E , I , U , D , T , N , S , M ,MINS,
|
EQL , A , O , E , I , U , D , T , N , S , M ,MINS,
|
||||||
//|----+----+----+----+----+----| |----+----+----+----+----+----|
|
//|----+----+----+----+----+----| |----+----+----+----+----+----|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||||||
//,----+----+----+----+----+----. ,----+----+----+----+----+----.
|
//,----+----+----+----+----+----. ,----+----+----+----+----+----.
|
||||||
GRV ,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN,BSPC,
|
GRV ,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN,BSPC,
|
||||||
//|----+----+----+----+----+----| |----+----+----+----+----+----|
|
//|----+----+----+----+----+----| |----+----+----+----+----+----|
|
||||||
LBRC,RBRC,COMM,DOT , P , Y , F , G , R , W , Q ,BSLS,
|
LBRC,RBRC,COMM,DOT , Y , P , F , G , R , W , Q ,BSLS,
|
||||||
//|----+----+----+----+----+----| |----+----+----+----+----+----|
|
//|----+----+----+----+----+----| |----+----+----+----+----+----|
|
||||||
EQL , A , O , E , I , U , D , T , N , S , M ,MINS,
|
EQL , A , O , E , I , U , D , T , N , S , M ,MINS,
|
||||||
//|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----|
|
//|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----|
|
||||||
|
|||||||
@@ -23,15 +23,10 @@ void render_status(struct CharacterMatrix *matrix) {
|
|||||||
|
|
||||||
// Render to mode icon
|
// Render to mode icon
|
||||||
static char logo[][2][3] = {{{0x95,0x96,0},{0xb5,0xb6,0}},{{0x97,0x98,0},{0xb7,0xb8,0}}};
|
static char logo[][2][3] = {{{0x95,0x96,0},{0xb5,0xb6,0}},{{0x97,0x98,0},{0xb7,0xb8,0}}};
|
||||||
if (edvorakjp_config.enable_kc_lang) {
|
int mode_number = get_enable_kc_lang() ? 0 : 1;
|
||||||
matrix_write(matrix, logo[0][0]);
|
matrix_write(matrix, logo[mode_number][0]);
|
||||||
matrix_write_P(matrix, PSTR("\n"));
|
matrix_write(matrix, "\n");
|
||||||
matrix_write(matrix, logo[0][1]);
|
matrix_write(matrix, logo[mode_number][1]);
|
||||||
} else {
|
|
||||||
matrix_write(matrix, logo[1][0]);
|
|
||||||
matrix_write_P(matrix, PSTR("\n"));
|
|
||||||
matrix_write(matrix, logo[1][1]);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Define layers here, Have not worked out how to have text displayed for each layer. Copy down the number you see and add a case for it below
|
// Define layers here, Have not worked out how to have text displayed for each layer. Copy down the number you see and add a case for it below
|
||||||
char buf[40];
|
char buf[40];
|
||||||
@@ -63,7 +58,7 @@ void render_status(struct CharacterMatrix *matrix) {
|
|||||||
// Host Keyboard LED Status
|
// Host Keyboard LED Status
|
||||||
char led[40];
|
char led[40];
|
||||||
snprintf(led, sizeof(led), "\n%s %s %s %s",
|
snprintf(led, sizeof(led), "\n%s %s %s %s",
|
||||||
edvorakjp_config.enable_jp_extra_layer && japanese_mode ? "EXT" : " ",
|
get_enable_jp_extra_layer() && get_japanese_mode() ? "EXT" : " ",
|
||||||
(host_keyboard_leds() & (1<<USB_LED_NUM_LOCK)) ? "NMLK" : " ",
|
(host_keyboard_leds() & (1<<USB_LED_NUM_LOCK)) ? "NMLK" : " ",
|
||||||
(host_keyboard_leds() & (1<<USB_LED_CAPS_LOCK)) ? "CAPS" : " ",
|
(host_keyboard_leds() & (1<<USB_LED_CAPS_LOCK)) ? "CAPS" : " ",
|
||||||
(host_keyboard_leds() & (1<<USB_LED_SCROLL_LOCK)) ? "SCLK" : " ");
|
(host_keyboard_leds() & (1<<USB_LED_SCROLL_LOCK)) ? "SCLK" : " ");
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
SRC += rev2/matrix.c
|
SRC += rev2/matrix.c
|
||||||
SRC += rev2/split_util.c
|
SRC += rev2/split_util.c
|
||||||
SRC += rev2/split_scomm.c
|
SRC += rev2/split_scomm.c
|
||||||
SRC += ws2812.c
|
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
/* Copyright 2017 Benjamin Kesselring
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
|
||||||
|
|
||||||
|
// place overrides here
|
||||||
|
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
/* Copyright 2018 Milton Griffin
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
|
||||||
|
// Keyboard Layers
|
||||||
|
#define _QW 0
|
||||||
|
#define _FN 1
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
|
||||||
|
/* QWERTY
|
||||||
|
* .--------------------------------------------------------------------------------------------------------------------------------------.
|
||||||
|
* | ESC | 1 | 2 | 3 | 4 | 5 | - | ` | = | 6 | 7 | 8 | 9 | 0 | BACKSP |
|
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
|
||||||
|
* | TAB | Q | W | E | R | T | [ | \ | ] | Y | U | I | O | P | ' |
|
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------|
|
||||||
|
* | CAP LK | A | S | D | F | G | HOME | DEL | PG UP | H | J | K | L | ; | ENTER |
|
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------|
|
||||||
|
* | LSHIFT | Z | X | C | V | B | END | UP | PG DN | N | M | , | . | / | RSHIFT |
|
||||||
|
* |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+-----------------+--------+--------|
|
||||||
|
* | LCTRL | LGUI | LALT | FN | SPACE | SPACE | LEFT | DOWN | RIGHT | SPACE | SPACE | FN | RALT | RGUI | RCTRL |
|
||||||
|
* '--------------------------------------------------------------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
|
||||||
|
[_QW] = LAYOUT_ortho_5x15( /* QWERTY */
|
||||||
|
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_MINS, KC_GRV, KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \
|
||||||
|
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, KC_BSLS, KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_QUOT, \
|
||||||
|
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_HOME, KC_DEL, KC_PGUP, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, \
|
||||||
|
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_END, KC_UP, KC_PGDN, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \
|
||||||
|
KC_LCTL, KC_LGUI, KC_LALT, MO(_FN), KC_SPC, KC_SPC, KC_LEFT, KC_DOWN, KC_RGHT, KC_SPC, KC_SPC, MO(_FN), KC_RALT, KC_RGUI, KC_RCTL \
|
||||||
|
),
|
||||||
|
|
||||||
|
/* FUNCTION
|
||||||
|
* .--------------------------------------------------------------------------------------------------------------------------------------.
|
||||||
|
* | F1 | F2 | F3 | F4 | F5 | F6 | NUM LK | P/ | P* | F7 | F8 | F9 | F10 | F11 | F12 |
|
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
|
||||||
|
* | SELECT | CALC | MYCOMP | MAIL | RGB HD | RGB HI | P7 | P8 | P9 | - | | | PR SCR | SCR LK | PAUSE |
|
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
|
||||||
|
* | PREV | PLAY | NEXT | STOP | RGB SD | RGB SI | P4 | P5 | P6 | + | | RESET | | | |
|
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
|
||||||
|
* | VOL- | MUTE | VOL+ | APP | RGB VD | RGB VI | P1 | P2 | P3 | PENT | | | | | |
|
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
|
||||||
|
* | | | RGB TG | FN | RGB RMD| RGB MD | P0 | | P. | PENT | PENT | FN | | | |
|
||||||
|
* '--------------------------------------------------------------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
|
||||||
|
[_FN] = LAYOUT_ortho_5x15( /* FUNCTION */
|
||||||
|
KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_NLCK, KC_SLSH, KC_ASTR, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \
|
||||||
|
KC_MSEL, KC_CALC, KC_MYCM, KC_MAIL, RGB_HUD, RGB_HUI, KC_P7, KC_P8, KC_P9, KC_MINS, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, \
|
||||||
|
KC_MPRV, KC_MPLY, KC_MNXT, KC_MSTP, RGB_SAD, RGB_SAI, KC_P4, KC_P5, KC_P6, KC_PLUS, _______, RESET, _______, _______, _______, \
|
||||||
|
KC_VOLD, KC_MUTE, KC_VOLU, KC_APP, RGB_VAD, RGB_VAI, KC_P1, KC_P2, KC_P3, KC_PENT, _______, _______, _______, _______, _______, \
|
||||||
|
_______, _______, RGB_TOG, MO(_FN), RGB_RMOD,RGB_MOD, KC_P0, _______, KC_PDOT, KC_PENT, KC_PENT, MO(_FN), _______, _______, _______ \
|
||||||
|
),
|
||||||
|
};
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
# The default keymap for xd75, with led controls
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
# Copyright 2013 Jun Wako <[email protected]>
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 2 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
/* Copyright 2018 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
|
||||||
|
|
||||||
|
// place overrides here
|
||||||
Loaded 100 of 213 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user