forked from mirror/qmk_firmware
Compare commits
77 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bd70f5261c | ||
|
|
dc8db6551d | ||
|
|
9d0153dc70 | ||
|
|
8bcb77cb9a | ||
|
|
708b3f9192 | ||
|
|
caeb213400 | ||
|
|
db16271a72 | ||
|
|
dc67fd9b87 | ||
|
|
6ab5a7d048 | ||
|
|
c5c5d37e08 | ||
|
|
ed169a6b30 | ||
|
|
5244b13173 | ||
|
|
022e1fdac8 | ||
|
|
3347b63d83 | ||
|
|
d38696a493 | ||
|
|
b593cfccbd | ||
|
|
65eb0f939f | ||
|
|
40d6766576 | ||
|
|
d92994be71 | ||
|
|
fe8b7619d3 | ||
|
|
89a515913f | ||
|
|
403536986d | ||
|
|
4d2ae22690 | ||
|
|
996880a1da | ||
|
|
4493f31f80 | ||
|
|
0880850b15 | ||
|
|
8f70adc0b6 | ||
|
|
87c2f97def | ||
|
|
eb35f58a6e | ||
|
|
249bc3a5c5 | ||
|
|
86966fce69 | ||
|
|
ec3df85f08 | ||
|
|
b2fdb072e5 | ||
|
|
869ede8e4a | ||
|
|
8014fb14b6 | ||
|
|
8e888794fa | ||
|
|
c84d361e95 | ||
|
|
f0d27e22aa | ||
|
|
8bcac1c8f7 | ||
|
|
6928bce461 | ||
|
|
5995432202 | ||
|
|
893d86cb89 | ||
|
|
2ff646c642 | ||
|
|
d953aa730e | ||
|
|
4b4f1c6edb | ||
|
|
41fb9120d0 | ||
|
|
6e61126e08 | ||
|
|
9dea8a7d86 | ||
|
|
b26217414c | ||
|
|
2d8266bd7b | ||
|
|
bbd47fcaa2 | ||
|
|
1a1b22ef07 | ||
|
|
0978dca728 | ||
|
|
ff6c70415c | ||
|
|
d8971d707e | ||
|
|
0e08fad5c5 | ||
|
|
dcfa4712fb | ||
|
|
5de86a05c3 | ||
|
|
de10757f05 | ||
|
|
b77d51f41a | ||
|
|
9d6cea070e | ||
|
|
4cae7becb1 | ||
|
|
30209de9fd | ||
|
|
16cd1d9bf7 | ||
|
|
8e9d45d270 | ||
|
|
b202e59322 | ||
|
|
da6d6ce2e1 | ||
|
|
82dd84e257 | ||
|
|
0be7345640 | ||
|
|
c0185116d7 | ||
|
|
34ba7f1c18 | ||
|
|
d412854e37 | ||
|
|
aab2ac22c5 | ||
|
|
61ba8efa3e | ||
|
|
e01307f265 | ||
|
|
7fb312ccd7 | ||
|
|
4a66bdf294 |
25
.github/ISSUE_TEMPLATE/bug_report.md
vendored
25
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -18,19 +18,18 @@ assignees: ''
|
||||
|
||||
## System Information
|
||||
|
||||
- Keyboard:
|
||||
- Revision (if applicable):
|
||||
- Operating system:
|
||||
- AVR GCC version:
|
||||
<!-- Run `avr-gcc --version` to find this out. -->
|
||||
- ARM GCC version:
|
||||
<!-- Run `arm-none-eabi-gcc --version` to find this out. -->
|
||||
- QMK Firmware version:
|
||||
<!-- Run `git describe --abbrev=0 --tags` to find this out. -->
|
||||
- Any keyboard related software installed?
|
||||
- [ ] AutoHotKey
|
||||
- [ ] Karabiner
|
||||
- [ ] Other:
|
||||
**Keyboard:**
|
||||
**Revision (if applicable):**
|
||||
**Operating system:**
|
||||
**`qmk doctor` output:**
|
||||
```
|
||||
(Paste output here)
|
||||
```
|
||||
|
||||
**Any keyboard related software installed?**
|
||||
- [ ] AutoHotKey (Windows)
|
||||
- [ ] Karabiner (macOS)
|
||||
- [ ] Other:
|
||||
|
||||
## Additional Context
|
||||
|
||||
|
||||
@@ -33,7 +33,33 @@
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "string",
|
||||
"enum": ["LAYOUT", "LAYOUT_planck_1x2uC"]
|
||||
"enum": [
|
||||
"LAYOUT",
|
||||
"LAYOUT_1x2uC",
|
||||
"LAYOUT_1x2uL",
|
||||
"LAYOUT_1x2uR",
|
||||
"LAYOUT_2x2uC",
|
||||
"LAYOUT_2x3uC",
|
||||
"LAYOUT_625uC",
|
||||
"LAYOUT_ANSI_DEFAULT",
|
||||
"LAYOUT_JP",
|
||||
"LAYOUT_ortho_3x12_1x2uC",
|
||||
"LAYOUT_ortho_4x12_1x2uC",
|
||||
"LAYOUT_ortho_4x12_1x2uL",
|
||||
"LAYOUT_ortho_4x12_1x2uR",
|
||||
"LAYOUT_ortho_5x12_1x2uC",
|
||||
"LAYOUT_ortho_5x12_2x2uC",
|
||||
"LAYOUT_ortho_5x14_1x2uC",
|
||||
"LAYOUT_ortho_5x14_1x2uL",
|
||||
"LAYOUT_ortho_5x14_1x2uR",
|
||||
"LAYOUT_planck_1x2uC",
|
||||
"LAYOUT_planck_1x2uL",
|
||||
"LAYOUT_planck_1x2uR",
|
||||
"LAYOUT_preonic_1x2uC",
|
||||
"LAYOUT_preonic_1x2uL",
|
||||
"LAYOUT_preonic_1x2uR",
|
||||
"LAYOUT_reviung34_2uL"
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
|
||||
@@ -109,6 +109,7 @@
|
||||
},
|
||||
"layouts": {
|
||||
"type": "object",
|
||||
"propertyNames": {"$ref": "qmk.definitions.v1#/layout_macro"},
|
||||
"additionalProperties": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
|
||||
@@ -15,11 +15,11 @@
|
||||
"device_version": "1.0.0"
|
||||
},
|
||||
"features": {
|
||||
"bootmagic_lite": true,
|
||||
"bootmagic": true,
|
||||
"command": false,
|
||||
"console": false,
|
||||
"extrakey": true,
|
||||
"mousekey": true,
|
||||
"nkro": true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -188,7 +188,7 @@ cli.log.info('Reading from %s and writing to %s', cli.args.filename, cli.args.ou
|
||||
|
||||
# Testing, and Linting, and Formatting (oh my!)
|
||||
|
||||
We use nose2, flake8, and yapf to test, lint, and format code. You can use the `pytest` and `format-py` subcommands to run these tests:
|
||||
We use nose2, flake8, and yapf to test, lint, and format code. You can use the `pytest` and `format-python` subcommands to run these tests:
|
||||
|
||||
### Testing and Linting
|
||||
|
||||
@@ -196,7 +196,7 @@ We use nose2, flake8, and yapf to test, lint, and format code. You can use the `
|
||||
|
||||
### Formatting
|
||||
|
||||
qmk format-py
|
||||
qmk format-python
|
||||
|
||||
## Formatting Details
|
||||
|
||||
|
||||
@@ -245,7 +245,7 @@ The following configuration options are only available when using `SPLIT_POINTIN
|
||||
| `pointing_device_get_report(void)` | Returns the current mouse report (as a `mouse_report_t` data structure). |
|
||||
| `pointing_device_set_report(mouse_report)` | Sets the mouse report to the assigned `mouse_report_t` data structured passed to the function. |
|
||||
| `pointing_device_send(void)` | Sends the current mouse report to the host system. Function can be replaced. |
|
||||
| `has_mouse_report_changed(old, new)` | Compares the old and new `mouse_report_t` data and returns true only if it has changed. |
|
||||
| `has_mouse_report_changed(new_report, old_report)` | Compares the old and new `mouse_report_t` data and returns true only if it has changed. |
|
||||
| `pointing_device_adjust_by_defines(mouse_report)` | Applies rotations and invert configurations to a raw mouse report. |
|
||||
|
||||
|
||||
@@ -276,14 +276,14 @@ The report_mouse_t (here "mouseReport") has the following properties:
|
||||
To manually manipulate the mouse reports outside of the `pointing_device_task_*` functions, you can use:
|
||||
|
||||
* `pointing_device_get_report()` - Returns the current report_mouse_t that represents the information sent to the host computer
|
||||
* `pointing_device_set_report(report_mouse_t newMouseReport)` - Overrides and saves the report_mouse_t to be sent to the host computer
|
||||
* `pointing_device_set_report(report_mouse_t mouse_report)` - Overrides and saves the report_mouse_t to be sent to the host computer
|
||||
* `pointing_device_send()` - Sends the mouse report to the host and zeroes out the report.
|
||||
|
||||
When the mouse report is sent, the x, y, v, and h values are set to 0 (this is done in `pointing_device_send()`, which can be overridden to avoid this behavior). This way, button states persist, but movement will only occur once. For further customization, both `pointing_device_init` and `pointing_device_task` can be overridden.
|
||||
|
||||
Additionally, by default, `pointing_device_send()` will only send a report when the report has actually changed. This prevents it from continuously sending mouse reports, which will keep the host system awake. This behavior can be changed by creating your own `pointing_device_send()` function.
|
||||
|
||||
Also, you use the `has_mouse_report_changed(new, old)` function to check to see if the report has changed.
|
||||
Also, you use the `has_mouse_report_changed(new_report, old_report)` function to check to see if the report has changed.
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
@@ -275,14 +275,14 @@ $ qmk kle2json -f kle.txt -f
|
||||
Ψ Wrote out to info.json
|
||||
```
|
||||
|
||||
## `qmk format-py`
|
||||
## `qmk format-python`
|
||||
|
||||
このコマンドは `qmk_firmware` 内の python コードを整形します。
|
||||
|
||||
**使用法**:
|
||||
|
||||
```
|
||||
qmk format-py
|
||||
qmk format-python
|
||||
```
|
||||
|
||||
## `qmk pytest`
|
||||
|
||||
@@ -192,7 +192,7 @@ cli.log.info('Reading from %s and writing to %s', cli.args.filename, cli.args.ou
|
||||
|
||||
# テスト、リントおよびフォーマット
|
||||
|
||||
nose2、flake8 および yapf を使ってコードをテスト、リントおよびフォーマットします。これらのテストを実行するために `pytest` と `format-py` サブコマンドを使うことができます。
|
||||
nose2、flake8 および yapf を使ってコードをテスト、リントおよびフォーマットします。これらのテストを実行するために `pytest` と `format-python` サブコマンドを使うことができます。
|
||||
|
||||
### テストとリント
|
||||
|
||||
@@ -200,7 +200,7 @@ nose2、flake8 および yapf を使ってコードをテスト、リントお
|
||||
|
||||
### フォーマット
|
||||
|
||||
qmk format-py
|
||||
qmk format-python
|
||||
|
||||
## フォーマットの詳細
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ POINTING_DEVICE_ENABLE = yes
|
||||
マウスレポートを操作するために、以下の関数を使うことができます:
|
||||
|
||||
* `pointing_device_get_report()` - ホストコンピュータに送信された情報を表す現在の report_mouse_t を返します。
|
||||
* `pointing_device_set_report(report_mouse_t newMouseReport)` - ホストコンピュータに送信される report_mouse_t を上書き保存します。
|
||||
* `pointing_device_set_report(report_mouse_t mouse_report)` - ホストコンピュータに送信される report_mouse_t を上書き保存します。
|
||||
|
||||
report_mouse_t (ここでは "mouseReport") が以下のプロパティを持つことを覚えておいてください:
|
||||
|
||||
@@ -34,7 +34,7 @@ report_mouse_t (ここでは "mouseReport") が以下のプロパティを持つ
|
||||
|
||||
さらに、デフォルトでは、`pointing_device_send()` はレポートが実際に変更された場合のみレポートを送信します。これにより、マウスレポートが継続的に送信されてホストシステムが起動されたままになることを防ぎます。この動作は、独自の `pointing_device_send()` 関数を作成することで変更できます。
|
||||
|
||||
また、`has_mouse_report_changed(new, old)` 関数を使って、レポートが変更されたかどうかを確認できます。(訳注:独自の `pointing_device_send()` 関数を作成する場合でも、その中で `has_mouse_report_changed(new, old)` 関数でチェックして、デフォルトの `pointing_device_send()` と類似の無駄なレポートの抑制をして、ホストシステムがスリープ状態に入れる余地を残すようにしておくのが良いでしょう。)
|
||||
また、`has_mouse_report_changed(new_report, old_report)` 関数を使って、レポートが変更されたかどうかを確認できます。(訳注:独自の `pointing_device_send()` 関数を作成する場合でも、その中で `has_mouse_report_changed(new_report, old_report)` 関数でチェックして、デフォルトの `pointing_device_send()` と類似の無駄なレポートの抑制をして、ホストシステムがスリープ状態に入れる余地を残すようにしておくのが良いでしょう。)
|
||||
|
||||
以下の例では、カスタムキーを使ってマウスをクリックし垂直および水平方向に127単位スクロールし、リリースされた時にそれを全て元に戻します - なぜならこれは完全に便利な機能だからです。いいですか、以下はひとつの例です:
|
||||
|
||||
|
||||
@@ -132,7 +132,7 @@ The main part of this file is the `keymaps[]` definition. This is where you list
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
After this you'll find a list of LAYOUT() macros. A LAYOUT() is simply a list of keys to define a single layer. Typically you'll have one or more "base layers" (such as QWERTY, Dvorak, or Colemak) and then you'll layer on top of that one or more "function" layers. Due to the way layers are processed you can't overlay a "lower" layer on top of a "higher" layer.
|
||||
After this you'll find the layer definitions. Typically you'll have one or more "base layers" (such as QWERTY, Dvorak, or Colemak) and then you'll layer on top of that one or more "function" layers. Due to the way layers are processed you can't overlay a "lower" layer on top of a "higher" layer.
|
||||
|
||||
`keymaps[][MATRIX_ROWS][MATRIX_COLS]` in QMK holds the 16 bit action code (sometimes referred as the quantum keycode) in it. For the keycode representing typical keys, its high byte is 0 and its low byte is the USB HID usage ID for keyboard.
|
||||
|
||||
@@ -153,7 +153,9 @@ Here is an example of the Clueboard's base layer:
|
||||
|
||||
Some interesting things to note about this:
|
||||
|
||||
* From a C source point of view it's only a single array, but we have embedded whitespace to more easily visualize where each key is on the physical device.
|
||||
* The layer is defined using the LAYOUT macro, traditionally defined in the keyboard's `.h` file.
|
||||
* The LAYOUT macro takes a single list of keycodes, but we have written it in the C source using embedded whitespace and newlines to visualize where each key is on the physical device.
|
||||
* The LAYOUT macro hides and handles the mapping to the hardware's key scan matrix.
|
||||
* Plain keyboard scancodes are prefixed with KC_, while "special" keys are not.
|
||||
* The upper left key activates custom function 0 (`F(0)`)
|
||||
* The "Fn" key is defined with `MO(_FL)`, which moves to the `_FL` layer while that key is being held down.
|
||||
|
||||
@@ -50,7 +50,7 @@ https://github.com/qmk/qmk_firmware/pulls?q=is%3Apr+is%3Aclosed+label%3Akeyboard
|
||||
- valid maintainer
|
||||
- displays correctly in Configurator (press Ctrl+Shift+I to preview local file, turn on fast input to verify ordering)
|
||||
- `readme.md`
|
||||
- standard template should be present -- [link to template](https://github.com/qmk/qmk_firmware/blob/master/data/templates/avr/readme.md)
|
||||
- standard template should be present -- [link to template](https://github.com/qmk/qmk_firmware/blob/master/data/templates/keyboard/readme.md)
|
||||
- flash command is present, and has `:flash` at end
|
||||
- valid hardware availability link (unless handwired) -- private groupbuys are okay, but one-off prototypes will be questioned. If open-source, a link to files should be provided.
|
||||
- clear instructions on how to reset the board into bootloader mode
|
||||
|
||||
@@ -28,11 +28,11 @@ The `info.json` file is a JSON formatted dictionary with the following keys avai
|
||||
* `layout_aliases`
|
||||
* A dictionary containing layout aliases. The key is the alias and the value is a layout in `layouts` it maps to.
|
||||
* `layouts`
|
||||
* Physical Layout representations. See the [Layout Format](#layout_format) section for more detail.
|
||||
* Physical Layout representations. See the [Layout Format](#layout-format) section for more detail.
|
||||
* `matrix_pins`
|
||||
* Configure the pins corresponding to columns and rows, or direct pins. See the [Matrix Pins](#matrix_pins) section for more detail.
|
||||
* Configure the pins corresponding to columns and rows, or direct pins. See the [Matrix Pins](#matrix-pins) section for more detail.
|
||||
* `rgblight`
|
||||
* Configure the [RGB Lighting feature](feature_rgblight.md). See the [RGB Lighting](#rgb_lighting) section for more detail.
|
||||
* Configure the [RGB Lighting feature](feature_rgblight.md). See the [RGB Lighting](#rgb-lighting) section for more detail.
|
||||
* `usb`
|
||||
* Configure USB VID, PID, and other parameters. See the [USB](#USB) section for more detail.
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ Largest in size is "magic" -- the QMK magic keycodes -- which control things lik
|
||||
|
||||
If you've done all of that, and you don't want to disable features like RGB, Audio, OLEDs, etc, there are some additional options that you can add to your config.h that can help.
|
||||
|
||||
Starting with Lock Key support. If you have an Cherry MX Lock switch (lucky you!), you don't want to do this. But chances are, you don't. In that case, add this to your `config.h`:
|
||||
Starting with Lock Key support. If you have a Cherry MX Lock switch (lucky you!), you don't want to do this. But chances are, you don't. In that case, add this to your `config.h`:
|
||||
```c
|
||||
#undef LOCKING_SUPPORT_ENABLE
|
||||
#undef LOCKING_RESYNC_ENABLE
|
||||
|
||||
@@ -8,27 +8,22 @@ This document attempts to explain how the QMK firmware works from a very high le
|
||||
|
||||
## Startup
|
||||
|
||||
You can think of QMK as no different from any other computer program. It is started, performs its tasks, and then ends. The entry point for the program is the `main()` function, just like it is on any other C program. However, for a newcomer to QMK it can be confusing because the `main()` function appears in multiple places, and it can be hard to tell which one to look at.
|
||||
You can think of QMK as no different from any other computer program. It is started and performs its tasks, but this program never finishes. Like other C programs, the entry point is the `main()` function. For QMK, the `main()` function is found in [`quantum/main.c`](https://github.com/qmk/qmk_firmware/blob/0.15.13/quantum/main.c#L55).
|
||||
|
||||
The reason for this is the different platforms that QMK supports. The most common platform is `lufa`, which runs on AVR processors such at the atmega32u4. We also support `chibios` and `vusb`.
|
||||
If you browse through the `main()` function you'll find that it starts by initializing any hardware that has been configured (including USB to the host). The most common platform for QMK is `lufa`, which runs on AVR processors such as the atmega32u4. When compiled for that platform, it will invoke for example `platform_setup()` in [`platforms/avr/platform.c`](https://github.com/qmk/qmk_firmware/blob/0.15.13/platforms/avr/platform.c#L19) and `protocol_setup()` in [`tmk_core/protocol/lufa/lufa.c`](https://github.com/qmk/qmk_firmware/blob/0.15.13/tmk_core/protocol/lufa/lufa.c#L1066). It will use other implementations when compiled for other platforms like `chibios` and `vusb`. At first glance, it can look like a lot of functionality but most of the time the code will be disabled by `#define`s.
|
||||
|
||||
We'll focus on AVR processors for the moment, which use the `lufa` platform. You can find the `main()` function in [tmk_core/protocol/lufa/lufa.c](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/tmk_core/protocol/lufa/lufa.c#L1028). If you browse through that function you'll find that it initializes any hardware that has been configured (including USB to the host) and then it starts the core part of the program with a [`while(1)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/tmk_core/protocol/lufa/lufa.c#L1069). This is [The Main Loop](#the-main-loop).
|
||||
The `main()` function will then start the core part of the program with a [`while (true)`](https://github.com/qmk/qmk_firmware/blob/0.15.13/quantum/main.c#L63). This is [The Main Loop](#the-main-loop).
|
||||
|
||||
## The Main Loop
|
||||
|
||||
This section of code is called "The Main Loop" because it's responsible for looping over the same set of instructions forever. This is where QMK dispatches out to the functions responsible for making the keyboard do everything it is supposed to do. At first glance it can look like a lot of functionality but most of the time the code will be disabled by `#define`'s.
|
||||
This section of code is called "The Main Loop" because it's responsible for looping over the same set of instructions forever, without ever reaching the end. This is where QMK dispatches out to the functions responsible for making the keyboard do everything it is supposed to do.
|
||||
|
||||
```
|
||||
keyboard_task();
|
||||
```
|
||||
|
||||
This is where all the keyboard specific functionality is dispatched. The source code for `keyboard_task()` can be found in [tmk_core/common/keyboard.c](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/tmk_core/common/keyboard.c#L216), and it is responsible for detecting changes in the matrix and turning status LEDs on and off.
|
||||
The main loop will call [`protocol_task()`](https://github.com/qmk/qmk_firmware/blob/0.15.13/quantum/main.c#L38), which in turn will call `keyboard_task()` in [`quantum/keyboard.c`](https://github.com/qmk/qmk_firmware/blob/0.15.13/quantum/keyboard.c#L377). This is where all the keyboard specific functionality is dispatched, and it is responsible for detecting changes in the matrix and turning status LEDs on and off.
|
||||
|
||||
Within `keyboard_task()` you'll find code to handle:
|
||||
|
||||
* [Matrix Scanning](#matrix-scanning)
|
||||
* Mouse Handling
|
||||
* Serial Link(s)
|
||||
* Keyboard status LEDs (Caps Lock, Num Lock, Scroll Lock)
|
||||
|
||||
#### Matrix Scanning
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
#include "analog.h"
|
||||
#include "gpio.h"
|
||||
#include "wait.h"
|
||||
#include "timer.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
// Set Parameters
|
||||
uint16_t minAxisValue = ANALOG_JOYSTICK_AXIS_MIN;
|
||||
|
||||
@@ -118,15 +118,6 @@ void matrix_print(void)
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t matrix_key_count(void)
|
||||
{
|
||||
uint8_t count = 0;
|
||||
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
|
||||
count += bitpop16(matrix[i]);
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
/* Column pin configuration
|
||||
* col: 0 1 2 3 4 5 6 7 8 9 10 11
|
||||
* pin: D7 E6 B4 B5 B6 B2 B3 B1 F7 F6 F5 F4
|
||||
|
||||
@@ -130,15 +130,6 @@ void matrix_print(void)
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t matrix_key_count(void)
|
||||
{
|
||||
uint8_t count = 0;
|
||||
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
|
||||
count += bitpop16(matrix[i]);
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
/* Column pin configuration
|
||||
* col: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
||||
* pin: F7 F6 F5 F4 F1 F0 E6 D7 D6 D5 D1 D0 B7 B6 B0 C7
|
||||
|
||||
226
keyboards/annepro2/annepro2.c
Normal file
226
keyboards/annepro2/annepro2.c
Normal file
@@ -0,0 +1,226 @@
|
||||
/* Copyright 2021 OpenAnnePro community
|
||||
*
|
||||
* 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 "hal.h"
|
||||
#include "annepro2.h"
|
||||
#include "annepro2_ble.h"
|
||||
#include "spi_master.h"
|
||||
#include "ap2_led.h"
|
||||
#include "protocol.h"
|
||||
|
||||
#define RAM_MAGIC_LOCATION 0x20001ffc
|
||||
#define IAP_MAGIC_VALUE 0x0000fab2
|
||||
|
||||
static const SerialConfig led_uart_init_config = {
|
||||
.speed = 115200,
|
||||
};
|
||||
|
||||
#ifndef LED_UART_BAUD_RATE
|
||||
# define LED_UART_BAUD_RATE 115200
|
||||
#endif // LED_UART_BAUD_RATE
|
||||
|
||||
static const SerialConfig led_uart_runtine_config = {
|
||||
.speed = LED_UART_BAUD_RATE,
|
||||
};
|
||||
|
||||
static const SerialConfig ble_uart_config = {
|
||||
.speed = 115200,
|
||||
};
|
||||
|
||||
static uint8_t led_mcu_wakeup[11] = {0x7b, 0x10, 0x43, 0x10, 0x03, 0x00, 0x00, 0x7d, 0x02, 0x01, 0x02};
|
||||
|
||||
ble_capslock_t ble_capslock = {._dummy = {0}, .caps_lock = false};
|
||||
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
static uint8_t current_rgb_row = 0;
|
||||
#endif
|
||||
|
||||
void bootloader_jump(void) {
|
||||
// Send msg to shine to boot into IAP
|
||||
ap2_set_IAP();
|
||||
|
||||
// wait for shine to boot into IAP
|
||||
wait_ms(15);
|
||||
|
||||
// Load ble into IAP
|
||||
annepro2_ble_bootload();
|
||||
wait_ms(15);
|
||||
|
||||
// Magic key to set keyboard to IAP
|
||||
// It’s from reversing original boot loader
|
||||
// If value is that it stays in boot loader aka IAP
|
||||
*((uint32_t *)RAM_MAGIC_LOCATION) = IAP_MAGIC_VALUE;
|
||||
|
||||
// Load the main MCU into IAP
|
||||
__disable_irq();
|
||||
NVIC_SystemReset();
|
||||
}
|
||||
|
||||
void keyboard_pre_init_kb(void) {
|
||||
// Start LED UART
|
||||
sdStart(&SD0, &led_uart_init_config);
|
||||
/* Let the LED chip settle a bit before switching the mode.
|
||||
* That helped at least one person. */
|
||||
wait_ms(15);
|
||||
sdWrite(&SD0, led_mcu_wakeup, sizeof(led_mcu_wakeup));
|
||||
|
||||
// wait to receive response from wakeup
|
||||
wait_ms(15);
|
||||
|
||||
proto_init(&proto, led_command_callback);
|
||||
|
||||
// loop to clear out receive buffer from shine wakeup
|
||||
while (!sdGetWouldBlock(&SD0)) sdGet(&SD0);
|
||||
|
||||
sdStart(&SD0, &led_uart_runtine_config);
|
||||
keyboard_pre_init_user();
|
||||
}
|
||||
|
||||
void keyboard_post_init_kb(void) {
|
||||
// Start BLE UART
|
||||
sdStart(&SD1, &ble_uart_config);
|
||||
annepro2_ble_startup();
|
||||
|
||||
// Give the send uart thread some time to
|
||||
// send out the queue before we read back
|
||||
wait_ms(100);
|
||||
|
||||
// loop to clear out receive buffer from ble wakeup
|
||||
while (!sdGetWouldBlock(&SD1)) sdGet(&SD1);
|
||||
|
||||
ap2_led_get_status();
|
||||
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
ap2_led_enable();
|
||||
#endif
|
||||
|
||||
keyboard_post_init_user();
|
||||
}
|
||||
|
||||
void matrix_scan_kb() {
|
||||
// if there's stuff on the ble serial buffer
|
||||
// read it into the capslock struct
|
||||
while (!sdGetWouldBlock(&SD1)) {
|
||||
sdReadTimeout(&SD1, (uint8_t *)&ble_capslock, sizeof(ble_capslock_t), 10);
|
||||
}
|
||||
|
||||
/* While there's data from LED keyboard sent - read it. */
|
||||
while (!sdGetWouldBlock(&SD0)) {
|
||||
uint8_t byte = sdGet(&SD0);
|
||||
proto_consume(&proto, byte);
|
||||
}
|
||||
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
/* If there's data ready to be sent to LED MCU - send it. */
|
||||
if(rgb_row_changed[current_rgb_row])
|
||||
{
|
||||
rgb_row_changed[current_rgb_row] = 0;
|
||||
ap2_led_mask_set_row(current_rgb_row);
|
||||
}
|
||||
current_rgb_row = (current_rgb_row + 1) % NUM_ROW;
|
||||
#endif
|
||||
|
||||
matrix_scan_user();
|
||||
}
|
||||
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
if (record->event.pressed) {
|
||||
if (ap2_led_status.matrix_enabled && ap2_led_status.is_reactive) {
|
||||
ap2_led_forward_keypress(record->event.key.row, record->event.key.col);
|
||||
}
|
||||
|
||||
const ap2_led_t blue = {
|
||||
.p.blue = 0xff,
|
||||
.p.red = 0x00,
|
||||
.p.green = 0x00,
|
||||
.p.alpha = 0xff,
|
||||
};
|
||||
|
||||
switch (keycode) {
|
||||
case KC_AP2_BT1:
|
||||
annepro2_ble_broadcast(0);
|
||||
/* FIXME: This hardcodes col/row position */
|
||||
ap2_led_blink(0, 1, blue, 8, 50);
|
||||
return false;
|
||||
|
||||
case KC_AP2_BT2:
|
||||
annepro2_ble_broadcast(1);
|
||||
ap2_led_blink(0, 2, blue, 8, 50);
|
||||
return false;
|
||||
|
||||
case KC_AP2_BT3:
|
||||
annepro2_ble_broadcast(2);
|
||||
ap2_led_blink(0, 3, blue, 8, 50);
|
||||
return false;
|
||||
|
||||
case KC_AP2_BT4:
|
||||
annepro2_ble_broadcast(3);
|
||||
ap2_led_blink(0, 4, blue, 8, 50);
|
||||
return false;
|
||||
|
||||
case KC_AP2_USB:
|
||||
annepro2_ble_disconnect();
|
||||
return false;
|
||||
|
||||
case KC_AP2_BT_UNPAIR:
|
||||
annepro2_ble_unpair();
|
||||
return false;
|
||||
|
||||
case KC_AP_LED_OFF:
|
||||
ap2_led_disable();
|
||||
break;
|
||||
|
||||
case KC_AP_LED_ON:
|
||||
if (ap2_led_status.matrix_enabled) {
|
||||
ap2_led_next_profile();
|
||||
} else {
|
||||
ap2_led_enable();
|
||||
}
|
||||
ap2_led_reset_foreground_color();
|
||||
break;
|
||||
|
||||
case KC_AP_LED_NEXT_PROFILE:
|
||||
ap2_led_next_profile();
|
||||
ap2_led_reset_foreground_color();
|
||||
break;
|
||||
|
||||
case KC_AP_LED_PREV_PROFILE:
|
||||
ap2_led_prev_profile();
|
||||
ap2_led_reset_foreground_color();
|
||||
break;
|
||||
|
||||
case KC_AP_LED_NEXT_INTENSITY:
|
||||
ap2_led_next_intensity();
|
||||
ap2_led_reset_foreground_color();
|
||||
return false;
|
||||
|
||||
case KC_AP_LED_SPEED:
|
||||
ap2_led_next_animation_speed();
|
||||
ap2_led_reset_foreground_color();
|
||||
return false;
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
case RGB_TOG:
|
||||
if(rgb_matrix_is_enabled()) ap2_led_disable();
|
||||
else ap2_led_enable();
|
||||
return true;
|
||||
#endif
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return process_record_user(keycode, record);
|
||||
}
|
||||
65
keyboards/annepro2/annepro2.h
Normal file
65
keyboards/annepro2/annepro2.h
Normal file
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* Copyright (c) 2018 Yaotian Feng
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "quantum.h"
|
||||
#include <stdint.h>
|
||||
#include "ap2_led.h"
|
||||
|
||||
typedef struct __attribute__((__packed__)) {
|
||||
uint8_t _dummy[10];
|
||||
bool caps_lock;
|
||||
} ble_capslock_t;
|
||||
extern ble_capslock_t ble_capslock;
|
||||
|
||||
// Matrix keymap
|
||||
// clang-format off
|
||||
#define LAYOUT_60_ansi( \
|
||||
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \
|
||||
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \
|
||||
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \
|
||||
K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, \
|
||||
K40, K42, K43, K46, K49, K4A, K4B, K4C \
|
||||
) { \
|
||||
/* COL1 COL2 COL3 COL4 COL5 COL6 COL7 COL8 COL9 COL10 COL11 COL12 COL13 COL14*/ \
|
||||
/* ROW1 */ { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \
|
||||
/* ROW2 */ { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \
|
||||
/* ROW3 */ { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, KC_NO}, \
|
||||
/* ROW4 */ { K30, KC_NO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, KC_NO}, \
|
||||
/* ROW5 */ { K40, KC_NO, K42, K43, KC_NO, KC_NO, K46, KC_NO, KC_NO, K49, K4A, K4B, K4C, KC_NO}, \
|
||||
}
|
||||
// clang-format on
|
||||
|
||||
enum AP2KeyCodes {
|
||||
KC_AP2_BT1 = SAFE_RANGE,
|
||||
KC_AP2_BT2,
|
||||
KC_AP2_BT3,
|
||||
KC_AP2_BT4,
|
||||
KC_AP2_BT_UNPAIR,
|
||||
KC_AP2_USB,
|
||||
KC_AP_LED_ON,
|
||||
KC_AP_LED_OFF,
|
||||
KC_AP_LED_NEXT_PROFILE,
|
||||
KC_AP_LED_PREV_PROFILE,
|
||||
KC_AP_LED_NEXT_INTENSITY,
|
||||
KC_AP_LED_SPEED,
|
||||
AP2_SAFE_RANGE,
|
||||
};
|
||||
|
||||
#undef SAFE_RANGE
|
||||
#define SAFE_RANGE AP2_SAFE_RANGE
|
||||
|
||||
170
keyboards/annepro2/annepro2_ble.c
Normal file
170
keyboards/annepro2/annepro2_ble.c
Normal file
@@ -0,0 +1,170 @@
|
||||
/*
|
||||
Copyright (C) 2020 Yaotian Feng, Codetector<codetector@codetector.cn>
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
#include "annepro2_ble.h"
|
||||
#include "ch.h"
|
||||
#include "hal.h"
|
||||
#include "host.h"
|
||||
#include "host_driver.h"
|
||||
#include "report.h"
|
||||
|
||||
/* -------------------- Static Function Prototypes -------------------------- */
|
||||
static uint8_t ap2_ble_leds(void);
|
||||
static void ap2_ble_mouse(report_mouse_t *report);
|
||||
static void ap2_ble_system(uint16_t data);
|
||||
static void ap2_ble_consumer(uint16_t data);
|
||||
static void ap2_ble_keyboard(report_keyboard_t *report);
|
||||
|
||||
static void ap2_ble_swtich_ble_driver(void);
|
||||
|
||||
/* -------------------- Static Local Variables ------------------------------ */
|
||||
static host_driver_t ap2_ble_driver = {
|
||||
ap2_ble_leds, ap2_ble_keyboard, ap2_ble_mouse, ap2_ble_system, ap2_ble_consumer,
|
||||
};
|
||||
|
||||
static uint8_t ble_mcu_wakeup[11] = {0x7b, 0x12, 0x53, 0x00, 0x03, 0x00, 0x01, 0x7d, 0x02, 0x01, 0x02};
|
||||
|
||||
static uint8_t ble_mcu_start_broadcast[11] = {
|
||||
0x7b, 0x12, 0x53, 0x00, 0x03, 0x00, 0x00, 0x7d, 0x40, 0x01, 0x00 // Broadcast ID[0-3]
|
||||
};
|
||||
|
||||
static uint8_t ble_mcu_connect[11] = {
|
||||
0x7b, 0x12, 0x53, 0x00, 0x03, 0x00, 0x00, 0x7d, 0x40, 0x04, 0x00 // Connect ID [0-3]
|
||||
};
|
||||
|
||||
static uint8_t ble_mcu_send_report[10] = {
|
||||
0x7b, 0x12, 0x53, 0x00, 0x0A, 0x00, 0x00, 0x7d, 0x10, 0x04,
|
||||
};
|
||||
|
||||
static uint8_t ble_mcu_send_consumer_report[10] = {
|
||||
0x7b, 0x12, 0x53, 0x00, 0x06, 0x00, 0x00, 0x7d, 0x10, 0x08,
|
||||
};
|
||||
|
||||
static uint8_t ble_mcu_unpair[10] = {
|
||||
0x7b, 0x12, 0x53, 0x00, 0x02, 0x00, 0x00, 0x7d, 0x40, 0x05,
|
||||
};
|
||||
|
||||
static uint8_t ble_mcu_bootload[11] = {0x7b, 0x10, 0x51, 0x10, 0x03, 0x00, 0x00, 0x7d, 0x02, 0x01, 0x01};
|
||||
|
||||
static host_driver_t *last_host_driver = NULL;
|
||||
#ifdef NKRO_ENABLE
|
||||
static bool lastNkroStatus = false;
|
||||
#endif // NKRO_ENABLE
|
||||
|
||||
/* -------------------- Public Function Implementation ---------------------- */
|
||||
|
||||
void annepro2_ble_bootload(void) { sdWrite(&SD1, ble_mcu_bootload, sizeof(ble_mcu_bootload)); }
|
||||
|
||||
void annepro2_ble_startup(void) { sdWrite(&SD1, ble_mcu_wakeup, sizeof(ble_mcu_wakeup)); }
|
||||
|
||||
void annepro2_ble_broadcast(uint8_t port) {
|
||||
if (port > 3) {
|
||||
port = 3;
|
||||
}
|
||||
// sdPut(&SD1, 0x00);
|
||||
sdWrite(&SD1, ble_mcu_start_broadcast, sizeof(ble_mcu_start_broadcast));
|
||||
sdPut(&SD1, port);
|
||||
static int lastBroadcast = -1;
|
||||
if (lastBroadcast == port) {
|
||||
annepro2_ble_connect(port);
|
||||
}
|
||||
lastBroadcast = port;
|
||||
}
|
||||
|
||||
void annepro2_ble_connect(uint8_t port) {
|
||||
if (port > 3) {
|
||||
port = 3;
|
||||
}
|
||||
sdWrite(&SD1, ble_mcu_connect, sizeof(ble_mcu_connect));
|
||||
sdPut(&SD1, port);
|
||||
ap2_ble_swtich_ble_driver();
|
||||
}
|
||||
|
||||
void annepro2_ble_disconnect(void) {
|
||||
/* Skip if the driver is already enabled */
|
||||
if (host_get_driver() != &ap2_ble_driver) {
|
||||
return;
|
||||
}
|
||||
|
||||
clear_keyboard();
|
||||
#ifdef NKRO_ENABLE
|
||||
keymap_config.nkro = lastNkroStatus;
|
||||
#endif
|
||||
host_set_driver(last_host_driver);
|
||||
}
|
||||
|
||||
void annepro2_ble_unpair(void) {
|
||||
// sdPut(&SD1, 0x0);
|
||||
sdWrite(&SD1, ble_mcu_unpair, sizeof(ble_mcu_unpair));
|
||||
}
|
||||
|
||||
/* ------------------- Static Function Implementation ----------------------- */
|
||||
static void ap2_ble_swtich_ble_driver(void) {
|
||||
if (host_get_driver() == &ap2_ble_driver) {
|
||||
return;
|
||||
}
|
||||
clear_keyboard();
|
||||
last_host_driver = host_get_driver();
|
||||
#ifdef NKRO_ENABLE
|
||||
lastNkroStatus = keymap_config.nkro;
|
||||
#endif
|
||||
keymap_config.nkro = false;
|
||||
host_set_driver(&ap2_ble_driver);
|
||||
}
|
||||
|
||||
static uint8_t ap2_ble_leds(void) {
|
||||
return 0; // TODO: Figure out how to obtain LED status
|
||||
}
|
||||
|
||||
static void ap2_ble_mouse(report_mouse_t *report) {}
|
||||
|
||||
static void ap2_ble_system(uint16_t data) {}
|
||||
|
||||
static inline uint16_t CONSUMER2AP2(uint16_t usage) {
|
||||
switch (usage) {
|
||||
case AUDIO_VOL_DOWN:
|
||||
return 0x04;
|
||||
case AUDIO_VOL_UP:
|
||||
return 0x02;
|
||||
case AUDIO_MUTE:
|
||||
return 0x01;
|
||||
case TRANSPORT_PLAY_PAUSE:
|
||||
return 0x08;
|
||||
case TRANSPORT_NEXT_TRACK:
|
||||
return 0x10;
|
||||
case TRANSPORT_PREV_TRACK:
|
||||
return 0x20;
|
||||
default:
|
||||
return 0x00;
|
||||
}
|
||||
}
|
||||
|
||||
static void ap2_ble_consumer(uint16_t data) {
|
||||
sdPut(&SD1, 0x0);
|
||||
sdWrite(&SD1, ble_mcu_send_consumer_report, sizeof(ble_mcu_send_consumer_report));
|
||||
sdPut(&SD1, CONSUMER2AP2(data));
|
||||
static const uint8_t dummy[3] = {0};
|
||||
sdWrite(&SD1, dummy, sizeof(dummy));
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Send keyboard HID report for Bluetooth driver
|
||||
*/
|
||||
static void ap2_ble_keyboard(report_keyboard_t *report) {
|
||||
sdPut(&SD1, 0x0);
|
||||
sdWrite(&SD1, ble_mcu_send_report, sizeof(ble_mcu_send_report));
|
||||
sdWrite(&SD1, &report->raw[0], KEYBOARD_REPORT_SIZE);
|
||||
}
|
||||
27
keyboards/annepro2/annepro2_ble.h
Normal file
27
keyboards/annepro2/annepro2_ble.h
Normal file
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
Copyright (C) 2020 Yaotian Feng, Codetector<codetector@codetector.cn>
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "annepro2.h"
|
||||
#include "quantum.h"
|
||||
|
||||
void annepro2_ble_bootload(void);
|
||||
void annepro2_ble_startup(void);
|
||||
void annepro2_ble_broadcast(uint8_t port);
|
||||
void annepro2_ble_connect(uint8_t port);
|
||||
void annepro2_ble_disconnect(void);
|
||||
void annepro2_ble_unpair(void);
|
||||
135
keyboards/annepro2/ap2_led.c
Normal file
135
keyboards/annepro2/ap2_led.c
Normal file
@@ -0,0 +1,135 @@
|
||||
/* Copyright 2021 OpenAnnePro community
|
||||
*
|
||||
* 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 <string.h>
|
||||
#include <stdio.h>
|
||||
#include "hal.h"
|
||||
#include "annepro2.h"
|
||||
#include "ap2_led.h"
|
||||
#include "protocol.h"
|
||||
|
||||
ap2_led_t led_mask[KEY_COUNT];
|
||||
ap2_led_status_t ap2_led_status;
|
||||
uint8_t rgb_row_changed[NUM_ROW];
|
||||
|
||||
void led_command_callback(const message_t *msg) {
|
||||
switch (msg->command) {
|
||||
case CMD_LED_STATUS:
|
||||
ap2_led_status.amount_of_profiles = msg->payload[0];
|
||||
ap2_led_status.current_profile = msg->payload[1];
|
||||
ap2_led_status.matrix_enabled = msg->payload[2];
|
||||
ap2_led_status.is_reactive = msg->payload[3];
|
||||
ap2_led_status.led_intensity = msg->payload[4];
|
||||
ap2_led_status.errors = msg->payload[5];
|
||||
break;
|
||||
|
||||
#ifdef CONSOLE_ENABLE
|
||||
case CMD_LED_DEBUG:
|
||||
/* TODO: Don't use printf. */
|
||||
printf("LED:");
|
||||
for (int i = 0; i < msg->payload_size; i++) {
|
||||
printf("%02x ", msg->payload[i]);
|
||||
}
|
||||
for (int i = 0; i < msg->payload_size; i++) {
|
||||
printf("%c", msg->payload[i]);
|
||||
}
|
||||
printf("\n");
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
void ap2_set_IAP(void) { proto_tx(CMD_LED_IAP, NULL, 0, 3); }
|
||||
|
||||
void ap2_led_disable(void) { proto_tx(CMD_LED_OFF, NULL, 0, 3); }
|
||||
|
||||
void ap2_led_enable(void) { proto_tx(CMD_LED_ON, NULL, 0, 3); }
|
||||
|
||||
void ap2_led_set_profile(uint8_t prof) { proto_tx(CMD_LED_SET_PROFILE, &prof, sizeof(prof), 3); }
|
||||
|
||||
void ap2_led_get_status() { proto_tx(CMD_LED_GET_STATUS, NULL, 0, 3); }
|
||||
|
||||
void ap2_led_next_profile() { proto_tx(CMD_LED_NEXT_PROFILE, NULL, 0, 3); }
|
||||
|
||||
void ap2_led_next_intensity() { proto_tx(CMD_LED_NEXT_INTENSITY, NULL, 0, 3); }
|
||||
|
||||
void ap2_led_next_animation_speed() { proto_tx(CMD_LED_NEXT_ANIMATION_SPEED, NULL, 0, 3); }
|
||||
|
||||
void ap2_led_prev_profile() { proto_tx(CMD_LED_PREV_PROFILE, NULL, 0, 3); }
|
||||
|
||||
void ap2_led_mask_set_key(uint8_t row, uint8_t col, ap2_led_t color) {
|
||||
uint8_t payload[] = {row, col, color.p.blue, color.p.green, color.p.red, color.p.alpha};
|
||||
proto_tx(CMD_LED_MASK_SET_KEY, payload, sizeof(payload), 1);
|
||||
}
|
||||
|
||||
/* Push a whole local row to the shine */
|
||||
void ap2_led_mask_set_row(uint8_t row) {
|
||||
uint8_t payload[NUM_COLUMN * sizeof(ap2_led_t) + 1];
|
||||
payload[0] = row;
|
||||
memcpy(payload + 1, &led_mask[ROWCOL2IDX(row, 0)], sizeof(*led_mask) * NUM_COLUMN);
|
||||
proto_tx(CMD_LED_MASK_SET_ROW, payload, sizeof(payload), 1);
|
||||
}
|
||||
|
||||
/* Synchronize all rows */
|
||||
void ap2_led_mask_set_all(void) {
|
||||
for (int row = 0; row < 5; row++) ap2_led_mask_set_row(row);
|
||||
}
|
||||
|
||||
/* Set all keys to a given color */
|
||||
void ap2_led_mask_set_mono(const ap2_led_t color) { proto_tx(CMD_LED_MASK_SET_MONO, (uint8_t *)&color, sizeof(color), 1); }
|
||||
|
||||
void ap2_led_blink(uint8_t row, uint8_t col, ap2_led_t color, uint8_t count, uint8_t hundredths) {
|
||||
uint8_t payload[] = {row, col, color.p.blue, color.p.green, color.p.red, color.p.alpha, count, hundredths};
|
||||
proto_tx(CMD_LED_KEY_BLINK, payload, sizeof(payload), 1);
|
||||
}
|
||||
|
||||
void ap2_led_set_foreground_color(uint8_t red, uint8_t green, uint8_t blue) {
|
||||
ap2_led_t color = {.p.red = red, .p.green = green, .p.blue = blue, .p.alpha = 0xff};
|
||||
ap2_led_mask_set_mono(color);
|
||||
}
|
||||
|
||||
void ap2_led_reset_foreground_color() {
|
||||
ap2_led_t color = {
|
||||
.p.red = 0,
|
||||
.p.green = 0,
|
||||
.p.blue = 0,
|
||||
.p.alpha = 0,
|
||||
};
|
||||
ap2_led_mask_set_mono(color);
|
||||
}
|
||||
|
||||
/*
|
||||
* Currently keypresses are unified with other messages, still with single 1
|
||||
* byte payload. Transfer is normally fast enough for that to not be a problem -
|
||||
* especially with asynchronous message reading.
|
||||
*
|
||||
*
|
||||
* Previous description:
|
||||
* If enabled, this data is sent to LED MCU on every keypress.
|
||||
* In order to improve performance, both row and column values
|
||||
* are packed into a single byte.
|
||||
* Row range is [0, 4] and requires only 3 bits.
|
||||
* Column range is [0, 13] and requires 4 bits.
|
||||
*
|
||||
* In order to differentiate this command from regular commands,
|
||||
* the leftmost bit is set to 1 (0b10000000).
|
||||
* Following it are 3 bits of row and 4 bits of col.
|
||||
* 1 + 3 + 4 = 8 bits - only a single byte is sent for every keypress.
|
||||
*/
|
||||
void ap2_led_forward_keypress(uint8_t row, uint8_t col) {
|
||||
const uint8_t payload = row << 4 | col;
|
||||
proto_tx(CMD_LED_KEY_DOWN, &payload, 1, 1);
|
||||
}
|
||||
93
keyboards/annepro2/ap2_led.h
Normal file
93
keyboards/annepro2/ap2_led.h
Normal file
@@ -0,0 +1,93 @@
|
||||
/* Copyright 2021 OpenAnnePro community
|
||||
*
|
||||
* 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 "protocol.h"
|
||||
|
||||
// Struct defining an LED and its RGB color components
|
||||
// Compatible with Shine firmware.
|
||||
typedef union {
|
||||
struct {
|
||||
/* Little endian ordering to match uint32_t */
|
||||
uint8_t blue, green, red;
|
||||
/* Used in mask; nonzero means - use color from mask. */
|
||||
uint8_t alpha;
|
||||
} p; /* parts */
|
||||
/* Parts vector access: 0 - blue, 1 - green, 2 - red */
|
||||
uint8_t pv[4];
|
||||
/* 0xrgb in mem is b g r a */
|
||||
uint32_t rgb;
|
||||
} ap2_led_t;
|
||||
|
||||
#define ROWCOL2IDX(row, col) (NUM_COLUMN * (row) + (col))
|
||||
#define NUM_COLUMN 14
|
||||
#define NUM_ROW 5
|
||||
#define KEY_COUNT 70
|
||||
|
||||
/* Local copy of led_mask, used to override colors on the board */
|
||||
extern ap2_led_t led_mask[KEY_COUNT];
|
||||
extern uint8_t rgb_row_changed[NUM_ROW];
|
||||
|
||||
/* Handle incoming messages */
|
||||
extern void led_command_callback(const message_t *msg);
|
||||
|
||||
void ap2_set_IAP(void);
|
||||
void ap2_led_disable(void);
|
||||
void ap2_led_enable(void);
|
||||
void ap2_led_set_profile(uint8_t prof);
|
||||
void ap2_led_get_status(void);
|
||||
void ap2_led_next_profile(void);
|
||||
void ap2_led_prev_profile(void);
|
||||
void ap2_led_next_intensity(void);
|
||||
void ap2_led_next_animation_speed(void);
|
||||
void ap2_led_forward_keypress(uint8_t row, uint8_t col);
|
||||
|
||||
/* Set single key to a given color; alpha controls which is displayed */
|
||||
void ap2_led_mask_set_key(uint8_t row, uint8_t col, ap2_led_t color);
|
||||
/* Push a whole local row to the shine */
|
||||
void ap2_led_mask_set_row(uint8_t row);
|
||||
/* Synchronize all rows */
|
||||
void ap2_led_mask_set_all(void);
|
||||
|
||||
/* Set all keys to a given color */
|
||||
void ap2_led_mask_set_mono(ap2_led_t color);
|
||||
|
||||
/* Blink given key `count` times by masking it with a `color`. Blink takes `hundredths` of a second */
|
||||
void ap2_led_blink(uint8_t row, uint8_t col, ap2_led_t color, uint8_t count, uint8_t hundredths);
|
||||
|
||||
/* Kept for compatibility, but implemented using masks */
|
||||
void ap2_led_set_foreground_color(uint8_t red, uint8_t green, uint8_t blue);
|
||||
void ap2_led_reset_foreground_color(void);
|
||||
|
||||
typedef struct {
|
||||
uint8_t amount_of_profiles;
|
||||
uint8_t current_profile;
|
||||
uint8_t matrix_enabled;
|
||||
uint8_t is_reactive;
|
||||
uint8_t led_intensity;
|
||||
uint8_t errors;
|
||||
} ap2_led_status_t;
|
||||
|
||||
extern ap2_led_status_t ap2_led_status;
|
||||
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
/* RGB driver functions */
|
||||
void init(void);
|
||||
void flush(void);
|
||||
void set_color(int index, uint8_t r, uint8_t g, uint8_t b);
|
||||
void set_color_all(uint8_t r, uint8_t g, uint8_t b);
|
||||
#endif
|
||||
103
keyboards/annepro2/boards/ANNEPRO2_C15/board.c
Normal file
103
keyboards/annepro2/boards/ANNEPRO2_C15/board.c
Normal file
@@ -0,0 +1,103 @@
|
||||
/*
|
||||
Copyright (C) 2020 Yaotian Feng, Codetector<codetector@codetector.cn>
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
#include "hal.h"
|
||||
|
||||
/* ============ Private Defines ===================== */
|
||||
|
||||
/* ============ Function Prototypes ================== */
|
||||
|
||||
#define PBIT(PORT, LINE) ((PAL_PORT(LINE) == PORT) ? (1 << PAL_PAD(LINE)) : 0)
|
||||
#define PAFIO_L(PORT, LINE, AF) (((PAL_PORT(LINE) == PORT) && (PAL_PAD(LINE) < 8)) ? (AF << (PAL_PAD(LINE) << 2)) : 0)
|
||||
#define PAFIO_H(PORT, LINE, AF) (((PAL_PORT(LINE) == PORT) && (PAL_PAD(LINE) >= 8)) ? (AF << ((PAL_PAD(LINE) - 8) << 2)) : 0)
|
||||
#define PAFIO(PORT, N, LINE, AF) ((N) ? PAFIO_H(PORT, LINE, AF) : PAFIO_L(PORT, LINE, AF))
|
||||
|
||||
#define OUT_BITS(PORT) (PBIT(PORT, C2) | PBIT(PORT, C1) | PBIT(PORT, B5) | PBIT(PORT, B4) | PBIT(PORT, C3) | 0)
|
||||
|
||||
#define IN_BITS(PORT) (PBIT(PORT, C4) | PBIT(PORT, C5) | PBIT(PORT, B10) | PBIT(PORT, B11) | PBIT(PORT, C0) | PBIT(PORT, A15) | PBIT(PORT, A8) | PBIT(PORT, A10) | PBIT(PORT, A11) | PBIT(PORT, A12) | PBIT(PORT, A13) | PBIT(PORT, A14) | PBIT(PORT, B2) | PBIT(PORT, B3) | 0)
|
||||
|
||||
// Alternate Functions
|
||||
#define AF_BITS(PORT, N) (PAFIO(PORT, N, LINE_UART_RX, AFIO_USART) | PAFIO(PORT, N, LINE_UART_TX, AFIO_USART) | PAFIO(PORT, N, LINE_BT_UART_TX, AFIO_USART) | PAFIO(PORT, N, LINE_BT_UART_RX, AFIO_USART) | PAFIO(PORT, N, C2, AFIO_GPIO) | PAFIO(PORT, N, C1, AFIO_GPIO) | PAFIO(PORT, N, B5, AFIO_GPIO) | PAFIO(PORT, N, B4, AFIO_GPIO) | PAFIO(PORT, N, C3, AFIO_GPIO) | PAFIO(PORT, N, C4, AFIO_GPIO) | PAFIO(PORT, N, C5, AFIO_GPIO) | PAFIO(PORT, N, B10, AFIO_GPIO) | PAFIO(PORT, N, B11, AFIO_GPIO) | PAFIO(PORT, N, C0, AFIO_GPIO) | PAFIO(PORT, N, A15, AFIO_GPIO) | PAFIO(PORT, N, A8, AFIO_GPIO) | PAFIO(PORT, N, A10, AFIO_GPIO) | PAFIO(PORT, N, A11, AFIO_GPIO) | PAFIO(PORT, N, A12, AFIO_GPIO) | PAFIO(PORT, N, A13, AFIO_GPIO) | PAFIO(PORT, N, A14, AFIO_GPIO) | PAFIO(PORT, N, B2, AFIO_GPIO) | PAFIO(PORT, N, B3, AFIO_GPIO) | 0)
|
||||
|
||||
/**
|
||||
* @brief PAL setup.
|
||||
* @details Digital I/O ports static configuration as defined in @p board.h.
|
||||
* This variable is used by the HAL when initializing the PAL driver.
|
||||
*/
|
||||
const PALConfig pal_default_config = {
|
||||
// GPIO A
|
||||
.setup[0] =
|
||||
{
|
||||
.DIR = OUT_BITS(IOPORTA),
|
||||
.INE = IN_BITS(IOPORTA),
|
||||
.PU = IN_BITS(IOPORTA),
|
||||
.PD = 0x0000,
|
||||
.OD = 0x0000,
|
||||
.DRV = 0x0000,
|
||||
.LOCK = 0x0000,
|
||||
.OUT = 0x0000,
|
||||
.CFG[0] = AF_BITS(IOPORTA, 0),
|
||||
.CFG[1] = AF_BITS(IOPORTA, 1),
|
||||
},
|
||||
// GPIO B
|
||||
.setup[1] =
|
||||
{
|
||||
.DIR = OUT_BITS(IOPORTB),
|
||||
.INE = IN_BITS(IOPORTB),
|
||||
.PU = IN_BITS(IOPORTB),
|
||||
.PD = 0x0000,
|
||||
.OD = 0x0000,
|
||||
.DRV = 0x0000,
|
||||
.LOCK = 0x0000,
|
||||
.OUT = 0x0000,
|
||||
.CFG[0] = AF_BITS(IOPORTB, 0),
|
||||
.CFG[1] = AF_BITS(IOPORTB, 1),
|
||||
},
|
||||
// GPIO C
|
||||
.setup[2] =
|
||||
{
|
||||
.DIR = OUT_BITS(IOPORTC),
|
||||
.INE = IN_BITS(IOPORTC),
|
||||
.PU = IN_BITS(IOPORTC),
|
||||
.PD = 0x0000,
|
||||
.OD = 0x0000,
|
||||
.DRV = 0x0000,
|
||||
.LOCK = 0x0000,
|
||||
.OUT = 0x0000,
|
||||
.CFG[0] = AF_BITS(IOPORTC, 0),
|
||||
.CFG[1] = AF_BITS(IOPORTC, 1),
|
||||
},
|
||||
// GPIO D
|
||||
.setup[3] =
|
||||
{
|
||||
.DIR = OUT_BITS(IOPORTD),
|
||||
.INE = IN_BITS(IOPORTD),
|
||||
.PU = IN_BITS(IOPORTD),
|
||||
.PD = 0x0000,
|
||||
.OD = 0x0000,
|
||||
.DRV = 0x0000,
|
||||
.LOCK = 0x0000,
|
||||
.OUT = 0x0000,
|
||||
.CFG[0] = AF_BITS(IOPORTD, 0),
|
||||
.CFG[1] = AF_BITS(IOPORTD, 1),
|
||||
},
|
||||
.ESSR[0] = 0x00000000,
|
||||
.ESSR[1] = 0x00000000,
|
||||
};
|
||||
|
||||
void __early_init(void) { ht32_clock_init(); }
|
||||
|
||||
void boardInit(void) {}
|
||||
39
keyboards/annepro2/boards/ANNEPRO2_C15/board.h
Normal file
39
keyboards/annepro2/boards/ANNEPRO2_C15/board.h
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
ChibiOS - Copyright (C) 2020 Codetector <codetector@codetector.cn>
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
/*
|
||||
* Setup for Anne Pro 2 board.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Board identifier.
|
||||
*/
|
||||
#define BOARD_NAME "Anne Pro 2"
|
||||
|
||||
#define HT32F52342
|
||||
|
||||
#define FLASH_SIZE (0x10000 - 0x4000) // 64kB - 16kB
|
||||
|
||||
#if !defined(_FROM_ASM_)
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
void boardInit(void);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* _FROM_ASM_ */
|
||||
5
keyboards/annepro2/boards/ANNEPRO2_C15/board.mk
Normal file
5
keyboards/annepro2/boards/ANNEPRO2_C15/board.mk
Normal file
@@ -0,0 +1,5 @@
|
||||
# List of all the board related files.
|
||||
BOARDSRC = $(BOARD_PATH)/boards/ANNEPRO2_C15/board.c
|
||||
|
||||
# Required include directories
|
||||
BOARDINC = $(BOARD_PATH)/boards/ANNEPRO2_C15
|
||||
103
keyboards/annepro2/boards/ANNEPRO2_C18/board.c
Normal file
103
keyboards/annepro2/boards/ANNEPRO2_C18/board.c
Normal file
@@ -0,0 +1,103 @@
|
||||
/*
|
||||
Copyright (C) 2020 Yaotian Feng, Codetector<codetector@codetector.cn>
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
#include "hal.h"
|
||||
|
||||
/* ============ Private Defines ===================== */
|
||||
|
||||
/* ============ Function Prototypes ================== */
|
||||
|
||||
#define PBIT(PORT, LINE) ((PAL_PORT(LINE) == PORT) ? (1 << PAL_PAD(LINE)) : 0)
|
||||
#define PAFIO_L(PORT, LINE, AF) (((PAL_PORT(LINE) == PORT) && (PAL_PAD(LINE) < 8)) ? (AF << (PAL_PAD(LINE) << 2)) : 0)
|
||||
#define PAFIO_H(PORT, LINE, AF) (((PAL_PORT(LINE) == PORT) && (PAL_PAD(LINE) >= 8)) ? (AF << ((PAL_PAD(LINE) - 8) << 2)) : 0)
|
||||
#define PAFIO(PORT, N, LINE, AF) ((N) ? PAFIO_H(PORT, LINE, AF) : PAFIO_L(PORT, LINE, AF))
|
||||
|
||||
#define OUT_BITS(PORT) (PBIT(PORT, B5) | PBIT(PORT, B4) | PBIT(PORT, B3) | PBIT(PORT, B2) | PBIT(PORT, D1) | 0)
|
||||
|
||||
#define IN_BITS(PORT) (PBIT(PORT, C4) | PBIT(PORT, C5) | PBIT(PORT, D0) | PBIT(PORT, B15) | PBIT(PORT, C11) | PBIT(PORT, A15) | PBIT(PORT, C12) | PBIT(PORT, C13) | PBIT(PORT, A8) | PBIT(PORT, A10) | PBIT(PORT, A11) | PBIT(PORT, A14) | PBIT(PORT, D2) | PBIT(PORT, D3) | 0)
|
||||
|
||||
// Alternate Functions
|
||||
#define AF_BITS(PORT, N) (PAFIO(PORT, N, LINE_UART_RX, AFIO_USART) | PAFIO(PORT, N, LINE_UART_TX, AFIO_USART) | PAFIO(PORT, N, LINE_BT_UART_TX, AFIO_USART) | PAFIO(PORT, N, LINE_BT_UART_RX, AFIO_USART) | PAFIO(PORT, N, B5, AFIO_GPIO) | PAFIO(PORT, N, B4, AFIO_GPIO) | PAFIO(PORT, N, B3, AFIO_GPIO) | PAFIO(PORT, N, B2, AFIO_GPIO) | PAFIO(PORT, N, D1, AFIO_GPIO) | PAFIO(PORT, N, C4, AFIO_GPIO) | PAFIO(PORT, N, C5, AFIO_GPIO) | PAFIO(PORT, N, D0, AFIO_GPIO) | PAFIO(PORT, N, B15, AFIO_GPIO) | PAFIO(PORT, N, C11, AFIO_GPIO) | PAFIO(PORT, N, A15, AFIO_GPIO) | PAFIO(PORT, N, C12, AFIO_GPIO) | PAFIO(PORT, N, C13, AFIO_GPIO) | PAFIO(PORT, N, A8, AFIO_GPIO) | PAFIO(PORT, N, A10, AFIO_GPIO) | PAFIO(PORT, N, A11, AFIO_GPIO) | PAFIO(PORT, N, A14, AFIO_GPIO) | PAFIO(PORT, N, D2, AFIO_GPIO) | PAFIO(PORT, N, D3, AFIO_GPIO) | 0)
|
||||
|
||||
/**
|
||||
* @brief PAL setup.
|
||||
* @details Digital I/O ports static configuration as defined in @p board.h.
|
||||
* This variable is used by the HAL when initializing the PAL driver.
|
||||
*/
|
||||
const PALConfig pal_default_config = {
|
||||
// GPIO A
|
||||
.setup[0] =
|
||||
{
|
||||
.DIR = OUT_BITS(IOPORTA),
|
||||
.INE = IN_BITS(IOPORTA),
|
||||
.PU = IN_BITS(IOPORTA),
|
||||
.PD = 0x0000,
|
||||
.OD = 0x0000,
|
||||
.DRV = 0x0000,
|
||||
.LOCK = 0x0000,
|
||||
.OUT = 0x0000,
|
||||
.CFG[0] = AF_BITS(IOPORTA, 0),
|
||||
.CFG[1] = AF_BITS(IOPORTA, 1),
|
||||
},
|
||||
// GPIO B
|
||||
.setup[1] =
|
||||
{
|
||||
.DIR = OUT_BITS(IOPORTB),
|
||||
.INE = IN_BITS(IOPORTB),
|
||||
.PU = IN_BITS(IOPORTB),
|
||||
.PD = 0x0000,
|
||||
.OD = 0x0000,
|
||||
.DRV = 0x0000,
|
||||
.LOCK = 0x0000,
|
||||
.OUT = 0x0000,
|
||||
.CFG[0] = AF_BITS(IOPORTB, 0),
|
||||
.CFG[1] = AF_BITS(IOPORTB, 1),
|
||||
},
|
||||
// GPIO C
|
||||
.setup[2] =
|
||||
{
|
||||
.DIR = OUT_BITS(IOPORTC),
|
||||
.INE = IN_BITS(IOPORTC),
|
||||
.PU = IN_BITS(IOPORTC),
|
||||
.PD = 0x0000,
|
||||
.OD = 0x0000,
|
||||
.DRV = 0x0000,
|
||||
.LOCK = 0x0000,
|
||||
.OUT = 0x0000,
|
||||
.CFG[0] = AF_BITS(IOPORTC, 0),
|
||||
.CFG[1] = AF_BITS(IOPORTC, 1),
|
||||
},
|
||||
// GPIO D
|
||||
.setup[3] =
|
||||
{
|
||||
.DIR = OUT_BITS(IOPORTD),
|
||||
.INE = IN_BITS(IOPORTD),
|
||||
.PU = IN_BITS(IOPORTD),
|
||||
.PD = 0x0000,
|
||||
.OD = 0x0000,
|
||||
.DRV = 0x0000,
|
||||
.LOCK = 0x0000,
|
||||
.OUT = 0x0000,
|
||||
.CFG[0] = AF_BITS(IOPORTD, 0),
|
||||
.CFG[1] = AF_BITS(IOPORTD, 1),
|
||||
},
|
||||
.ESSR[0] = 0x00000000,
|
||||
.ESSR[1] = 0x00000000,
|
||||
};
|
||||
|
||||
void __early_init(void) { ht32_clock_init(); }
|
||||
|
||||
void boardInit(void) {}
|
||||
39
keyboards/annepro2/boards/ANNEPRO2_C18/board.h
Normal file
39
keyboards/annepro2/boards/ANNEPRO2_C18/board.h
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
ChibiOS - Copyright (C) 2020 Codetector <codetector@codetector.cn>
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
/*
|
||||
* Setup for Anne Pro 2 board.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Board identifier.
|
||||
*/
|
||||
#define BOARD_NAME "Anne Pro 2"
|
||||
|
||||
#define HT32F52342
|
||||
|
||||
#define FLASH_SIZE (0x10000 - 0x4000) // 64kB - 16kB
|
||||
|
||||
#if !defined(_FROM_ASM_)
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
void boardInit(void);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* _FROM_ASM_ */
|
||||
5
keyboards/annepro2/boards/ANNEPRO2_C18/board.mk
Normal file
5
keyboards/annepro2/boards/ANNEPRO2_C18/board.mk
Normal file
@@ -0,0 +1,5 @@
|
||||
# List of all the board related files.
|
||||
BOARDSRC = $(BOARD_PATH)/boards/ANNEPRO2_C18/board.c
|
||||
|
||||
# Required include directories
|
||||
BOARDINC = $(BOARD_PATH)/boards/ANNEPRO2_C18
|
||||
48
keyboards/annepro2/c15/config.h
Normal file
48
keyboards/annepro2/c15/config.h
Normal file
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Copyright (c) 2018 Charlie Waters
|
||||
*
|
||||
* 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 "pin_defs.h"
|
||||
#include "config_led.h"
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define VENDOR_ID 0xfeed
|
||||
#define PRODUCT_ID 0xac15
|
||||
#define DEVICE_VER 0x1337
|
||||
#define MANUFACTURER Obins
|
||||
#define PRODUCT Anne Pro 2 QMK
|
||||
// key matrix size
|
||||
#define MATRIX_ROWS 5
|
||||
#define MATRIX_COLS 14
|
||||
// layer size: MATRIX_ROWS * MATRIX_COLS * sizeof(uint16_t) = 140 bytes
|
||||
|
||||
#define LINE_UART_TX B0 // Master TX, LED RX
|
||||
#define LINE_UART_RX B1 // Master RX, LED TX
|
||||
|
||||
#define LINE_BT_UART_TX A4 // Master TX, BLE RX
|
||||
#define LINE_BT_UART_RX A5 // Master RX, BLE TX
|
||||
|
||||
// outputs (rows are pulled low)
|
||||
#define MATRIX_ROW_PINS \
|
||||
{ C2, C1, B5, B4, C3 }
|
||||
|
||||
// inputs (columns are sampled)
|
||||
// PORTA 12,13 conflict with SWD
|
||||
|
||||
#define MATRIX_COL_PINS \
|
||||
{ C4, C5, B10, B11, C0, A15, A8, A10, A11, A12, A13, A14, B2, B3 }
|
||||
1
keyboards/annepro2/c15/readme.md
Normal file
1
keyboards/annepro2/c15/readme.md
Normal file
@@ -0,0 +1 @@
|
||||
AnnePro2, ANSI C15 version.
|
||||
40
keyboards/annepro2/c15/rules.mk
Normal file
40
keyboards/annepro2/c15/rules.mk
Normal file
@@ -0,0 +1,40 @@
|
||||
# Anne Pro 2
|
||||
SRC = \
|
||||
matrix.c \
|
||||
annepro2_ble.c \
|
||||
ap2_led.c \
|
||||
protocol.c \
|
||||
rgb_driver.c \
|
||||
config_led.c
|
||||
|
||||
# MCU
|
||||
MCU = cortex-m0plus
|
||||
ARMV = 6
|
||||
USE_FPU = no
|
||||
MCU_FAMILY = HT32
|
||||
MCU_SERIES = HT32F523xx
|
||||
MCU_LDSCRIPT = HT32F52342_ANNEPRO2
|
||||
MCU_STARTUP = ht32f523xx
|
||||
|
||||
BOARD = ANNEPRO2_C15
|
||||
|
||||
# Options
|
||||
|
||||
# Keys
|
||||
CUSTOM_MATRIX = lite
|
||||
NKRO_ENABLE = no
|
||||
MOUSEKEY_ENABLE = no
|
||||
EXTRAKEY_ENABLE = yes
|
||||
KEY_LOCK_ENABLE = no
|
||||
LAYOUTS = 60_ansi
|
||||
|
||||
# Other featues
|
||||
BOOTMAGIC_ENABLE = no
|
||||
CONSOLE_ENABLE = no
|
||||
COMMAND_ENABLE = no
|
||||
RAW_ENABLE = no
|
||||
MIDI_ENABLE = no
|
||||
VIRTSER_ENABLE = no
|
||||
COMBO_ENABLE = no
|
||||
BOOTLOADER = custom
|
||||
PROGRAM_CMD = annepro2_tools --boot $(BUILD_DIR)/$(TARGET).bin
|
||||
46
keyboards/annepro2/c18/config.h
Normal file
46
keyboards/annepro2/c18/config.h
Normal file
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Copyright (c) 2018 Charlie Waters
|
||||
*
|
||||
* 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 "pin_defs.h"
|
||||
#include "config_led.h"
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define VENDOR_ID 0xfeed
|
||||
#define PRODUCT_ID 0xac18
|
||||
#define DEVICE_VER 0x1337
|
||||
#define MANUFACTURER Obins
|
||||
#define PRODUCT Anne Pro 2(c18)QMK
|
||||
// key matrix size
|
||||
#define MATRIX_ROWS 5
|
||||
#define MATRIX_COLS 14
|
||||
// layer size: MATRIX_ROWS * MATRIX_COLS * sizeof(uint16_t) = 140 bytes
|
||||
|
||||
#define LINE_UART_TX B0
|
||||
#define LINE_UART_RX B1
|
||||
|
||||
#define LINE_BT_UART_TX A4 // Master TX, BLE RX
|
||||
#define LINE_BT_UART_RX A5 // Master RX, BLE TX
|
||||
|
||||
// outputs (rows are pulled low)
|
||||
#define MATRIX_ROW_PINS \
|
||||
{ B5, B4, B3, B2, D1 }
|
||||
|
||||
// inputs (columns are sampled)
|
||||
#define MATRIX_COL_PINS \
|
||||
{ C4, C5, D0, B15, C11, A15, C12, C13, A8, A10, A11, A14, D2, D3 }
|
||||
1
keyboards/annepro2/c18/readme.md
Normal file
1
keyboards/annepro2/c18/readme.md
Normal file
@@ -0,0 +1 @@
|
||||
AnnePro2, ANSI C18 version.
|
||||
40
keyboards/annepro2/c18/rules.mk
Normal file
40
keyboards/annepro2/c18/rules.mk
Normal file
@@ -0,0 +1,40 @@
|
||||
# Anne Pro 2
|
||||
SRC = \
|
||||
matrix.c \
|
||||
annepro2_ble.c \
|
||||
ap2_led.c \
|
||||
protocol.c \
|
||||
rgb_driver.c \
|
||||
config_led.c
|
||||
|
||||
# MCU
|
||||
MCU = cortex-m0plus
|
||||
ARMV = 6
|
||||
USE_FPU = no
|
||||
MCU_FAMILY = HT32
|
||||
MCU_SERIES = HT32F523xx
|
||||
MCU_LDSCRIPT = HT32F52342_ANNEPRO2
|
||||
MCU_STARTUP = ht32f523xx
|
||||
|
||||
BOARD = ANNEPRO2_C18
|
||||
|
||||
# Options
|
||||
|
||||
# Keys
|
||||
CUSTOM_MATRIX = lite
|
||||
NKRO_ENABLE = no
|
||||
MOUSEKEY_ENABLE = no
|
||||
EXTRAKEY_ENABLE = yes
|
||||
KEY_LOCK_ENABLE = no
|
||||
LAYOUTS = 60_ansi
|
||||
|
||||
# Other featues
|
||||
BOOTMAGIC_ENABLE = yes
|
||||
CONSOLE_ENABLE = no
|
||||
COMMAND_ENABLE = no
|
||||
RAW_ENABLE = no
|
||||
MIDI_ENABLE = no
|
||||
VIRTSER_ENABLE = no
|
||||
COMBO_ENABLE = no
|
||||
BOOTLOADER = custom
|
||||
PROGRAM_CMD = annepro2_tools --boot $(BUILD_DIR)/$(TARGET).bin
|
||||
31
keyboards/annepro2/chconf.h
Normal file
31
keyboards/annepro2/chconf.h
Normal file
@@ -0,0 +1,31 @@
|
||||
/* Copyright 2020 QMK
|
||||
*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This file was auto-generated by:
|
||||
* `qmk chibios-confmigrate -i keyboards/annepro2/chconf.h -r platforms/chibios/common/configs/chconf.h`
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#define CH_CFG_ST_FREQUENCY 1000
|
||||
|
||||
#define CH_CFG_ST_TIMEDELTA 0
|
||||
|
||||
#define CH_CFG_TIME_QUANTUM 20
|
||||
|
||||
|
||||
#include_next <chconf.h>
|
||||
43
keyboards/annepro2/config_led.c
Normal file
43
keyboards/annepro2/config_led.c
Normal file
@@ -0,0 +1,43 @@
|
||||
/* Copyright 2022 Jose Pablo Ramirez <jp.ramangulo@gmail.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
|
||||
#include "rgb_matrix.h"
|
||||
#include "config_led.h"
|
||||
|
||||
#define NA NO_LED
|
||||
|
||||
led_config_t g_led_config = { {
|
||||
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 },
|
||||
{ 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27 },
|
||||
{ 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, NA },
|
||||
{ 41, NA, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, NA },
|
||||
{ 53, NA, 54, 55, NA, NA, 56, NA, NA, 57, 58, 59, 60, NA }
|
||||
}, {
|
||||
{ 0 , 0 }, { 16, 0 }, { 32, 0 }, { 48, 0 }, { 65, 0 }, { 81, 0 }, { 97 , 0 }, { 113, 0 }, { 129, 0 }, { 145, 0 }, { 161, 0 }, { 178, 0 }, { 194, 0 }, { 218, 0 },
|
||||
{ 4 , 16 }, { 24, 16 }, { 40, 16 }, { 57, 16 }, { 73, 16 }, { 89, 16 }, { 105, 16 }, { 121, 16 }, { 137, 16 }, { 153, 16 }, { 170, 16 }, { 186, 16 }, { 202, 16 }, { 222, 16 },
|
||||
{ 6 , 32 }, { 28, 32 }, { 44, 32 }, { 61, 32 }, { 77, 32 }, { 93, 32 }, { 109, 32 }, { 125, 32 }, { 141, 32 }, { 157, 32 }, { 174, 32 }, { 190, 32 }, { 216, 32 },
|
||||
{ 10, 48 }, { 36, 48 }, { 52, 48 }, { 69, 48 }, { 85, 48 }, { 101, 48 }, { 117, 48 }, { 133, 48 }, { 149, 48 }, { 165, 48 }, { 182, 48 }, { 212, 48 },
|
||||
{ 2 , 64 }, { 22, 64 }, { 42, 64 }, { 103, 64 }, { 163, 64 }, { 184, 64 }, { 204, 64 }, { 224, 64 },
|
||||
}, {
|
||||
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
|
||||
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
|
||||
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
|
||||
1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1,
|
||||
1, 1, 1, 4, 1, 1, 1, 1,
|
||||
} };
|
||||
#endif
|
||||
72
keyboards/annepro2/config_led.h
Normal file
72
keyboards/annepro2/config_led.h
Normal file
@@ -0,0 +1,72 @@
|
||||
/* Copyright 2022 Jose Pablo Ramirez <jp.ramangulo@gmail.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
|
||||
#define DRIVER_LED_TOTAL 61
|
||||
|
||||
/* Limit animations to 62.5 FPS to avoid tearing. (1/.016 = 62.5 FPS). */
|
||||
#define RGB_MATRIX_LED_FLUSH_LIMIT 16
|
||||
|
||||
#define RGB_MATRIX_FRAMEBUFFER_EFFECTS
|
||||
#define RGB_MATRIX_KEYPRESSES
|
||||
#define ENABLE_RGB_MATRIX_ALPHAS_MODS
|
||||
#define ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN
|
||||
#define ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT
|
||||
#define ENABLE_RGB_MATRIX_BREATHING
|
||||
#define ENABLE_RGB_MATRIX_BAND_SAT
|
||||
#define ENABLE_RGB_MATRIX_BAND_VAL
|
||||
#define ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT
|
||||
#define ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL
|
||||
#define ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT
|
||||
#define ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL
|
||||
#define ENABLE_RGB_MATRIX_CYCLE_ALL
|
||||
#define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT
|
||||
#define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN
|
||||
#define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON
|
||||
#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN
|
||||
#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL
|
||||
#define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL
|
||||
#define ENABLE_RGB_MATRIX_CYCLE_SPIRAL
|
||||
#define ENABLE_RGB_MATRIX_DUAL_BEACON
|
||||
#define ENABLE_RGB_MATRIX_RAINBOW_BEACON
|
||||
#define ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS
|
||||
#define ENABLE_RGB_MATRIX_RAINDROPS
|
||||
#define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS
|
||||
#define ENABLE_RGB_MATRIX_HUE_BREATHING
|
||||
#define ENABLE_RGB_MATRIX_HUE_PENDULUM
|
||||
#define ENABLE_RGB_MATRIX_HUE_WAVE
|
||||
#define ENABLE_RGB_MATRIX_PIXEL_FRACTAL
|
||||
#define ENABLE_RGB_MATRIX_PIXEL_FLOW
|
||||
#define ENABLE_RGB_MATRIX_PIXEL_RAIN
|
||||
#define ENABLE_RGB_MATRIX_TYPING_HEATMAP
|
||||
#define ENABLE_RGB_MATRIX_DIGITAL_RAIN
|
||||
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE
|
||||
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE
|
||||
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE
|
||||
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE
|
||||
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS
|
||||
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS
|
||||
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS
|
||||
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS
|
||||
#define ENABLE_RGB_MATRIX_SPLASH
|
||||
#define ENABLE_RGB_MATRIX_MULTISPLASH
|
||||
#define ENABLE_RGB_MATRIX_SOLID_SPLASH
|
||||
#define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH
|
||||
|
||||
#endif
|
||||
28
keyboards/annepro2/halconf.h
Normal file
28
keyboards/annepro2/halconf.h
Normal file
@@ -0,0 +1,28 @@
|
||||
/* Copyright 2020 QMK
|
||||
*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This file was auto-generated by:
|
||||
* `qmk chibios-confmigrate -i keyboards/annepro2/halconf.h -r platforms/chibios/common/configs/halconf.h`
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#define HAL_USE_SERIAL TRUE
|
||||
|
||||
#define SERIAL_USB_BUFFERS_SIZE 256
|
||||
|
||||
#include_next <halconf.h>
|
||||
330
keyboards/annepro2/info.json
Normal file
330
keyboards/annepro2/info.json
Normal file
@@ -0,0 +1,330 @@
|
||||
{
|
||||
"keyboard_name": "Anne Pro 2",
|
||||
"url": "https://openannepro.github.io/",
|
||||
"maintainer": "community",
|
||||
"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
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
20
keyboards/annepro2/keymaps/default-full-caps/config.h
Normal file
20
keyboards/annepro2/keymaps/default-full-caps/config.h
Normal file
@@ -0,0 +1,20 @@
|
||||
/* Copyright 2021 OpenAnnePro community
|
||||
*
|
||||
* 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
|
||||
|
||||
// Obins stock firmware has something similar to this already enabled, but disabled by default in QMK
|
||||
#define PERMISSIVE_HOLD
|
||||
118
keyboards/annepro2/keymaps/default-full-caps/keymap.c
Normal file
118
keyboards/annepro2/keymaps/default-full-caps/keymap.c
Normal file
@@ -0,0 +1,118 @@
|
||||
/* Copyright 2021 OpenAnnePro community
|
||||
*
|
||||
* 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 anne_pro_layers {
|
||||
BASE,
|
||||
FN1,
|
||||
FN2,
|
||||
};
|
||||
|
||||
// clang-format off
|
||||
// Key symbols are based on QMK. Use them to remap your keyboard
|
||||
/*
|
||||
* Layer BASE
|
||||
* ,-----------------------------------------------------------------------------------------.
|
||||
* | esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Bksp |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | Tab | q | w | e | r | t | y | u | i | o | p | [ | ] | \ |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | Caps | a | s | d | f | g | h | j | k | l | ; | ' | Enter |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | Shift | z | x | c | v | b | n | m | , | . | / | Shift |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | Ctrl | L1 | Alt | space | Alt | FN1 | FN2 | Ctrl |
|
||||
* \-----------------------------------------------------------------------------------------/
|
||||
* Layer TAP in BASE
|
||||
* ,-----------------------------------------------------------------------------------------.
|
||||
* | | | | | | | | | | | | | | |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | | | | | | | | | | | | | | |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | | | | | | | | | | | | | |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | | | | | | | | | | | | UP |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | | | | | | LEFT | DOWN | RIGHT |
|
||||
* \-----------------------------------------------------------------------------------------/
|
||||
*/
|
||||
const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[BASE] = LAYOUT_60_ansi( /* Base */
|
||||
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_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,
|
||||
LT(FN1, 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, RSFT_T(KC_UP),
|
||||
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, LT(FN1, KC_LEFT), LT(FN2, KC_DOWN), RCTL_T(KC_RGHT)
|
||||
),
|
||||
/*
|
||||
* Layer FN1
|
||||
* ,-----------------------------------------------------------------------------------------.
|
||||
* | ` | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | DELETE |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | Tab | q | UP | e | r | t | y | u | i | o | PS | HOME | END | \ |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | Esc |LEFT |DOWN |RIGHT| f | g | h | j | k | l | PGUP|PGDN | Enter |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | Shift |V-UP |V-DWN|MUTE | v | b | n | m | , |INSRT| DEL | Shift |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | Ctrl | L1 | Alt | space | Alt | FN1 | FN2 | Ctrl |
|
||||
* \-----------------------------------------------------------------------------------------/
|
||||
*
|
||||
*/
|
||||
[FN1] = LAYOUT_60_ansi( /* FN1 */
|
||||
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,
|
||||
_______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_HOME, KC_END, _______,
|
||||
_______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, KC_PGUP, KC_PGDN, _______,
|
||||
_______, KC_VOLU, KC_VOLD, KC_MUTE, _______, _______, _______, _______, _______, KC_INS, KC_DEL, _______,
|
||||
_______, _______, _______, _______, _______, _______, MO(FN2), _______
|
||||
),
|
||||
/*
|
||||
* Layer FN2
|
||||
* ,-----------------------------------------------------------------------------------------.
|
||||
* | ~ | BT1 | BT2 | BT3 | BT4 | F5 | F6 | F7 |LEDOF|LEDON| F10 | F11 | F12 | Bksp |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | Tab | q | UP | e | r | t | y | u | i | o | PS | HOME | END | \ |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | Esc |LEFT |DOWN |RIGHT| f | g | h | j | k | l | PGUP|PGDN | Enter |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | Shift | z | x | c | v | b | n | m | , |INSRT| DEL | Shift |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | Ctrl | L1 | Alt | space | Alt | FN1 | FN2 | Ctrl |
|
||||
* \-----------------------------------------------------------------------------------------/
|
||||
*
|
||||
*/
|
||||
[FN2] = LAYOUT_60_ansi( /* FN2 */
|
||||
_______, KC_AP2_BT1, KC_AP2_BT2, KC_AP2_BT3, KC_AP2_BT4, _______, _______, _______, KC_AP_LED_OFF, KC_AP_LED_ON, _______, _______, _______, _______,
|
||||
MO(FN2), _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_HOME, KC_END, _______,
|
||||
_______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, KC_PGUP, KC_PGDN, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, KC_DEL, _______,
|
||||
_______, _______, _______, _______, _______, MO(FN1), MO(FN2), _______
|
||||
),
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
// The function to handle the caps lock logic
|
||||
bool led_update_user(led_t leds) {
|
||||
if (leds.caps_lock) {
|
||||
// Set the leds to red
|
||||
ap2_led_set_foreground_color(0xFF, 0x00, 0x00);
|
||||
} else {
|
||||
ap2_led_reset_foreground_color();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
20
keyboards/annepro2/keymaps/default-layer-indicators/config.h
Normal file
20
keyboards/annepro2/keymaps/default-layer-indicators/config.h
Normal file
@@ -0,0 +1,20 @@
|
||||
/* Copyright 2021 OpenAnnePro community
|
||||
*
|
||||
* 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
|
||||
|
||||
// Obins stock firmware has something similar to this already enabled, but disabled by default in QMK
|
||||
#define PERMISSIVE_HOLD
|
||||
145
keyboards/annepro2/keymaps/default-layer-indicators/keymap.c
Normal file
145
keyboards/annepro2/keymaps/default-layer-indicators/keymap.c
Normal file
@@ -0,0 +1,145 @@
|
||||
/* Copyright 2021 OpenAnnePro community
|
||||
*
|
||||
* 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 anne_pro_layers {
|
||||
BASE,
|
||||
FN1,
|
||||
FN2,
|
||||
};
|
||||
|
||||
// clang-format off
|
||||
// Key symbols are based on QMK. Use them to remap your keyboard
|
||||
/*
|
||||
* Layer BASE
|
||||
* ,-----------------------------------------------------------------------------------------.
|
||||
* | esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Bksp |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | Tab | q | w | e | r | t | y | u | i | o | p | [ | ] | \ |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | Caps | a | s | d | f | g | h | j | k | l | ; | ' | Enter |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | Shift | z | x | c | v | b | n | m | , | . | / | Shift |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | Ctrl | L1 | Alt | space | Alt | FN1 | FN2 | Ctrl |
|
||||
* \-----------------------------------------------------------------------------------------/
|
||||
* Layer TAP in BASE
|
||||
* ,-----------------------------------------------------------------------------------------.
|
||||
* | | | | | | | | | | | | | | |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | | | | | | | | | | | | | | |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | | | | | | | | | | | | | |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | | | | | | | | | | | | UP |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | | | | | | LEFT | DOWN | RIGHT |
|
||||
* \-----------------------------------------------------------------------------------------/
|
||||
*/
|
||||
const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[BASE] = LAYOUT_60_ansi( /* Base */
|
||||
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_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,
|
||||
LT(FN1, 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, RSFT_T(KC_UP),
|
||||
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, LT(FN1, KC_LEFT), LT(FN2, KC_DOWN), RCTL_T(KC_RGHT)
|
||||
),
|
||||
/*
|
||||
* Layer FN1
|
||||
* ,-----------------------------------------------------------------------------------------.
|
||||
* | ` | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | DELETE |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | Tab | q | UP | e | r | t | y | u | i | o | PS | HOME | END | \ |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | Esc |LEFT |DOWN |RIGHT| f | g | h | j | k | l | PGUP|PGDN | Enter |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | Shift |V-UP |V-DWN|MUTE | v | b | n | m | , |INSRT| DEL | Shift |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | Ctrl | L1 | Alt | space | Alt | FN1 | FN2 | Ctrl |
|
||||
* \-----------------------------------------------------------------------------------------/
|
||||
*
|
||||
*/
|
||||
[FN1] = LAYOUT_60_ansi( /* FN1 */
|
||||
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,
|
||||
_______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_HOME, KC_END, _______,
|
||||
_______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, KC_PGUP, KC_PGDN, _______,
|
||||
_______, KC_VOLU, KC_VOLD, KC_MUTE, _______, _______, _______, _______, _______, KC_INS, KC_DEL, _______,
|
||||
_______, _______, _______, _______, _______, _______, MO(FN2), _______
|
||||
),
|
||||
/*
|
||||
* Layer FN2
|
||||
* ,-----------------------------------------------------------------------------------------.
|
||||
* | ~ | BT1 | BT2 | BT3 | BT4 | F5 | F6 | F7 |LEDOF|LEDON| F10 | F11 | F12 | Bksp |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | Tab | q | UP | e | r | t | y | u | i | o | PS | HOME | END | \ |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | Esc |LEFT |DOWN |RIGHT| f | g | h | j | k | l | PGUP|PGDN | Enter |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | Shift | z | x | c | v | b | n | m | , |INSRT| DEL | Shift |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | Ctrl | L1 | Alt | space | Alt | FN1 | FN2 | Ctrl |
|
||||
* \-----------------------------------------------------------------------------------------/
|
||||
*
|
||||
*/
|
||||
[FN2] = LAYOUT_60_ansi( /* FN2 */
|
||||
_______, KC_AP2_BT1, KC_AP2_BT2, KC_AP2_BT3, KC_AP2_BT4, _______, _______, _______, KC_AP_LED_OFF, KC_AP_LED_ON, _______, _______, _______, _______,
|
||||
MO(FN2), _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_HOME, KC_END, _______,
|
||||
_______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, KC_PGUP, KC_PGDN, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, KC_DEL, _______,
|
||||
_______, _______, _______, _______, _______, MO(FN1), MO(FN2), _______
|
||||
),
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||
switch (get_highest_layer(state)) {
|
||||
case FN1:
|
||||
// Set the leds to green
|
||||
ap2_led_set_foreground_color(0x00, 0xFF, 0x00);
|
||||
break;
|
||||
case FN2:
|
||||
// Set the leds to blue
|
||||
ap2_led_set_foreground_color(0x00, 0x00, 0xFF);
|
||||
break;
|
||||
default:
|
||||
// Reset back to the current profile
|
||||
ap2_led_reset_foreground_color();
|
||||
break;
|
||||
}
|
||||
return state;
|
||||
}
|
||||
|
||||
// The function to handle the caps lock logic
|
||||
// It's called after the capslock changes state or after entering layers 1 and 2.
|
||||
bool led_update_user(led_t leds) {
|
||||
if (leds.caps_lock) {
|
||||
// Set the caps-lock to red
|
||||
const ap2_led_t color = {.p.red = 0xff, .p.green = 0x00, .p.blue = 0x00, .p.alpha = 0xff};
|
||||
|
||||
ap2_led_mask_set_key(2, 0, color);
|
||||
/* NOTE: Instead of colouring the capslock only, you can change the whole
|
||||
keyboard with ap2_led_set_foreground_color */
|
||||
} else {
|
||||
// Reset the capslock if there is no layer active
|
||||
if (!layer_state_is(FN1) && !layer_state_is(FN2)) {
|
||||
const ap2_led_t color = {.p.red = 0xff, .p.green = 0x00, .p.blue = 0x00, .p.alpha = 0x00};
|
||||
ap2_led_mask_set_key(2, 0, color);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
20
keyboards/annepro2/keymaps/default/config.h
Normal file
20
keyboards/annepro2/keymaps/default/config.h
Normal file
@@ -0,0 +1,20 @@
|
||||
/* Copyright 2021 OpenAnnePro community
|
||||
*
|
||||
* 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
|
||||
|
||||
// Obins stock firmware has something similar to this already enabled, but disabled by default in QMK
|
||||
#define PERMISSIVE_HOLD
|
||||
106
keyboards/annepro2/keymaps/default/keymap.c
Normal file
106
keyboards/annepro2/keymaps/default/keymap.c
Normal file
@@ -0,0 +1,106 @@
|
||||
/* Copyright 2021 OpenAnnePro community
|
||||
*
|
||||
* 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 anne_pro_layers {
|
||||
BASE,
|
||||
FN1,
|
||||
FN2,
|
||||
};
|
||||
|
||||
// clang-format off
|
||||
// Key symbols are based on QMK. Use them to remap your keyboard
|
||||
/*
|
||||
* Layer BASE
|
||||
* ,-----------------------------------------------------------------------------------------.
|
||||
* | esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Bksp |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | Tab | q | w | e | r | t | y | u | i | o | p | [ | ] | \ |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | Caps | a | s | d | f | g | h | j | k | l | ; | ' | Enter |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | Shift | z | x | c | v | b | n | m | , | . | / | Shift |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | Ctrl | L1 | Alt | space | Alt | FN1 | FN2 | Ctrl |
|
||||
* \-----------------------------------------------------------------------------------------/
|
||||
* Layer TAP in BASE
|
||||
* ,-----------------------------------------------------------------------------------------.
|
||||
* | | | | | | | | | | | | | | |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | | | | | | | | | | | | | | |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | | | | | | | | | | | | | |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | | | | | | | | | | | | UP |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | | | | | | LEFT | DOWN | RIGHT |
|
||||
* \-----------------------------------------------------------------------------------------/
|
||||
*/
|
||||
const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[BASE] = LAYOUT_60_ansi( /* Base */
|
||||
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_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,
|
||||
LT(FN1, 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, RSFT_T(KC_UP),
|
||||
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, LT(FN1, KC_LEFT), LT(FN2, KC_DOWN), RCTL_T(KC_RGHT)
|
||||
),
|
||||
/*
|
||||
* Layer FN1
|
||||
* ,-----------------------------------------------------------------------------------------.
|
||||
* | ` | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | DELETE |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | Tab | q | UP | e | r | t | y | u | i | o | PS | HOME | END | \ |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | Esc |LEFT |DOWN |RIGHT| f | g | h | j | k | l | PGUP|PGDN | Enter |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | Shift |V-UP |V-DWN|MUTE | v | b | n | m | , |INSRT| DEL | Shift |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | Ctrl | L1 | Alt | space | Alt | FN1 | FN2 | Ctrl |
|
||||
* \-----------------------------------------------------------------------------------------/
|
||||
*
|
||||
*/
|
||||
[FN1] = LAYOUT_60_ansi( /* FN1 */
|
||||
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,
|
||||
_______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_HOME, KC_END, _______,
|
||||
_______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, KC_PGUP, KC_PGDN, _______,
|
||||
_______, KC_VOLU, KC_VOLD, KC_MUTE, _______, _______, _______, _______, _______, KC_INS, KC_DEL, _______,
|
||||
_______, _______, _______, _______, _______, _______, MO(FN2), _______
|
||||
),
|
||||
/*
|
||||
* Layer FN2
|
||||
* ,-----------------------------------------------------------------------------------------.
|
||||
* | ~ | BT1 | BT2 | BT3 | BT4 | F5 | F6 | HUE | SAT | BRI | SPD | MOD | TOG | Bksp |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | Tab | q | UP | e | r | t | y | u | i | o | PS | HOME | END | \ |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | Esc |LEFT |DOWN |RIGHT| f | g | h | j | k | l | PGUP|PGDN | Enter |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | Shift | z | x | c | v | b | n | m | , |INSRT| DEL | Shift |
|
||||
* |-----------------------------------------------------------------------------------------+
|
||||
* | Ctrl | L1 | Alt | space | Alt | FN1 | FN2 | Ctrl |
|
||||
* \-----------------------------------------------------------------------------------------/
|
||||
*
|
||||
*/
|
||||
[FN2] = LAYOUT_60_ansi( /* FN2 */
|
||||
_______, KC_AP2_BT1, KC_AP2_BT2, KC_AP2_BT3, KC_AP2_BT4, _______, _______, RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI, RGB_MOD, RGB_TOG, _______,
|
||||
MO(FN2), _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_HOME, KC_END, _______,
|
||||
_______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, KC_PGUP, KC_PGDN, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, KC_DEL, _______,
|
||||
_______, _______, _______, _______, _______, MO(FN1), MO(FN2), _______
|
||||
),
|
||||
};
|
||||
// clang-format on
|
||||
3
keyboards/annepro2/keymaps/default/rules.mk
Normal file
3
keyboards/annepro2/keymaps/default/rules.mk
Normal file
@@ -0,0 +1,3 @@
|
||||
# Custom RGB matrix handling
|
||||
RGB_MATRIX_ENABLE = yes
|
||||
RGB_MATRIX_DRIVER = custom
|
||||
91
keyboards/annepro2/ld/HT32F52342_ANNEPRO2.ld
Normal file
91
keyboards/annepro2/ld/HT32F52342_ANNEPRO2.ld
Normal file
@@ -0,0 +1,91 @@
|
||||
/*
|
||||
* Copyright (c) 2013-2016 Fabio UJonathan A. Kollaschtzig, http://fabioutzig.com
|
||||
* (c) 2020 Yaotian Feng (Codetector) <codetector@codetector.cn>
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* HT32F52342 w/ Anne Pro 2 bootloader memory setup.
|
||||
*/
|
||||
MEMORY {
|
||||
flash0 : org = 0x00004000, len = 64k - 16k /* firmware */
|
||||
flash1 : org = 0x00000000, len = 0
|
||||
flash2 : org = 0x00000000, len = 0
|
||||
flash3 : org = 0x00000000, len = 0
|
||||
flash4 : org = 0x00000000, len = 0
|
||||
flash5 : org = 0x00000000, len = 0
|
||||
flash6 : org = 0x00000000, len = 0
|
||||
flash7 : org = 0x00000000, len = 0
|
||||
ram0 : org = 0x20000000, len = 8k - 4 /* RAM */
|
||||
ram1 : org = 0x00000000, len = 0
|
||||
ram2 : org = 0x00000000, len = 0
|
||||
ram3 : org = 0x00000000, len = 0
|
||||
ram4 : org = 0x00000000, len = 0
|
||||
ram5 : org = 0x00000000, len = 0
|
||||
ram6 : org = 0x00000000, len = 0
|
||||
ram7 : org = 0x00000000, len = 0
|
||||
}
|
||||
|
||||
/* For each data/text section two region are defined, a virtual region
|
||||
and a load region (_LMA suffix).*/
|
||||
|
||||
/* Flash region to be used for exception vectors.*/
|
||||
REGION_ALIAS("VECTORS_FLASH", flash0);
|
||||
REGION_ALIAS("VECTORS_FLASH_LMA", flash0);
|
||||
|
||||
/* Flash region to be used for constructors and destructors.*/
|
||||
REGION_ALIAS("XTORS_FLASH", flash0);
|
||||
REGION_ALIAS("XTORS_FLASH_LMA", flash0);
|
||||
|
||||
/* Flash region to be used for code text.*/
|
||||
REGION_ALIAS("TEXT_FLASH", flash0);
|
||||
REGION_ALIAS("TEXT_FLASH_LMA", flash0);
|
||||
|
||||
/* Flash region to be used for read only data.*/
|
||||
REGION_ALIAS("RODATA_FLASH", flash0);
|
||||
REGION_ALIAS("RODATA_FLASH_LMA", flash0);
|
||||
|
||||
/* Flash region to be used for various.*/
|
||||
REGION_ALIAS("VARIOUS_FLASH", flash0);
|
||||
REGION_ALIAS("VARIOUS_FLASH_LMA", flash0);
|
||||
|
||||
/* Flash region to be used for RAM(n) initialization data.*/
|
||||
REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0);
|
||||
|
||||
/* RAM region to be used for Main stack. This stack accommodates the processing
|
||||
of all exceptions and interrupts.*/
|
||||
REGION_ALIAS("MAIN_STACK_RAM", ram0);
|
||||
|
||||
/* RAM region to be used for the process stack. This is the stack used by
|
||||
the main() function.*/
|
||||
REGION_ALIAS("PROCESS_STACK_RAM", ram0);
|
||||
|
||||
/* RAM region to be used for data segment.*/
|
||||
REGION_ALIAS("DATA_RAM", ram0);
|
||||
REGION_ALIAS("DATA_RAM_LMA", flash0);
|
||||
|
||||
/* RAM region to be used for BSS segment.*/
|
||||
REGION_ALIAS("BSS_RAM", ram0);
|
||||
|
||||
/* RAM region to be used for the default heap.*/
|
||||
REGION_ALIAS("HEAP_RAM", ram0);
|
||||
|
||||
/* Generic rules inclusion.*/
|
||||
INCLUDE rules.ld
|
||||
63
keyboards/annepro2/matrix.c
Normal file
63
keyboards/annepro2/matrix.c
Normal file
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* Copyright (c) 2018 Charlie Waters
|
||||
*
|
||||
* 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>
|
||||
#include <hal.h>
|
||||
#include "timer.h"
|
||||
#include "wait.h"
|
||||
#include "print.h"
|
||||
#include "matrix.h"
|
||||
#include "annepro2.h"
|
||||
|
||||
pin_t row_list[MATRIX_ROWS] = MATRIX_ROW_PINS;
|
||||
pin_t col_list[MATRIX_COLS] = MATRIX_COL_PINS;
|
||||
|
||||
bool matrix_scan_custom(matrix_row_t current_matrix[]) {
|
||||
bool matrix_has_changed = false;
|
||||
// cache of input ports for columns
|
||||
static uint16_t port_cache[4];
|
||||
// scan each row
|
||||
for (int row = 0; row < MATRIX_ROWS; row++) {
|
||||
palClearLine(row_list[row]);
|
||||
__NOP();
|
||||
__NOP();
|
||||
__NOP();
|
||||
__NOP();
|
||||
// read i/o ports
|
||||
port_cache[0] = palReadPort(IOPORTA);
|
||||
port_cache[1] = palReadPort(IOPORTB);
|
||||
port_cache[2] = palReadPort(IOPORTC);
|
||||
port_cache[3] = palReadPort(IOPORTD);
|
||||
palSetLine(row_list[row]);
|
||||
|
||||
// get columns from ports
|
||||
matrix_row_t data = 0;
|
||||
for (int col = 0; col < MATRIX_COLS; ++col) {
|
||||
pin_t line = col_list[col];
|
||||
uint16_t port = port_cache[HT32_PAL_IDX(PAL_PORT(line))];
|
||||
data |= (((port & (1 << PAL_PAD(line))) ? 0 : 1) << col);
|
||||
}
|
||||
|
||||
if (current_matrix[row] != data) {
|
||||
current_matrix[row] = data;
|
||||
matrix_has_changed = true;
|
||||
}
|
||||
}
|
||||
return matrix_has_changed;
|
||||
}
|
||||
62
keyboards/annepro2/mcuconf.h
Normal file
62
keyboards/annepro2/mcuconf.h
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "nvic.h"
|
||||
|
||||
#define HT32F52342_MCUCONF
|
||||
|
||||
/*
|
||||
* HAL driver system settings.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Clock configuration.
|
||||
*/
|
||||
|
||||
// This configuration:
|
||||
// 8 MHz HSE crystal
|
||||
// PLL multiplies HSE to 48 MHz core and peripheral clock
|
||||
// 48 MHz to UART
|
||||
// 48 MHz to USB
|
||||
|
||||
#define HT32_CK_HSE_FREQUENCY 8000000UL // 8 MHz
|
||||
#define HT32_CKCU_SW CKCU_GCCR_SW_PLL
|
||||
#define HT32_PLL_USE_HSE TRUE
|
||||
#define HT32_PLL_FBDIV 6 // 8 MHz -> 48 MHz
|
||||
#define HT32_PLL_OTDIV 0
|
||||
#define HT32_AHB_PRESCALER 1 // 48 MHz -> 48 MHz
|
||||
#define HT32_USART_PRESCALER 1 // 48 MHz
|
||||
#define HT32_USB_PRESCALER 1 // 48 MHz -> 48 MHz
|
||||
// SysTick uses processor clock at 48MHz
|
||||
#define HT32_ST_USE_HCLK TRUE
|
||||
|
||||
/*
|
||||
* Peripheral driver settings
|
||||
*/
|
||||
|
||||
#define HT32_SERIAL_USE_USART0 TRUE
|
||||
#define HT32_USART0_IRQ_PRIORITY 6
|
||||
|
||||
#define HT32_SERIAL_USE_USART1 TRUE
|
||||
#define HT32_USART1_IRQ_PRIORITY 7
|
||||
|
||||
/*
|
||||
* USB driver settings
|
||||
*/
|
||||
|
||||
#define HT32_USB_USE_USB0 TRUE
|
||||
#define HT32_USB_USB0_IRQ_PRIORITY 5
|
||||
116
keyboards/annepro2/protocol.c
Normal file
116
keyboards/annepro2/protocol.c
Normal file
@@ -0,0 +1,116 @@
|
||||
/*
|
||||
* (c) 2021 by Tomasz bla Fortuna
|
||||
* License: GPLv2
|
||||
*
|
||||
* This file is shared with the Shine firmware. Keep it in sync (and in the
|
||||
* shine's clang formatting).
|
||||
*
|
||||
* Implementation of a robust serial protocol which can handle single dropped
|
||||
* characters during transit without locking.
|
||||
*
|
||||
* At 115200, transmitting the shortest message takes 0.043ms, at 9600 - 0.52ms.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "protocol.h"
|
||||
#include "board.h"
|
||||
#include "ch.h"
|
||||
#include "hal.h"
|
||||
|
||||
/* UART communication protocol state */
|
||||
protocol_t proto;
|
||||
|
||||
void proto_init(protocol_t *proto, void (*callback)(const message_t *)) {
|
||||
proto->previous_id = 0;
|
||||
proto->callback = callback;
|
||||
proto->state = STATE_SYNC_1;
|
||||
proto->errors = 0;
|
||||
}
|
||||
|
||||
static uint8_t msg_id = 0;
|
||||
void proto_tx(uint8_t cmd, const unsigned char *buf, int payload_size, int retries) {
|
||||
chDbgCheck(payload_size <= MAX_PAYLOAD_SIZE);
|
||||
|
||||
const uint8_t header[5] = {
|
||||
0x7A, 0x1D, cmd, ++msg_id, payload_size,
|
||||
};
|
||||
|
||||
/* We don't implement ACKs, yet some messages should not be lost. */
|
||||
for (int i = 0; i < retries; i++) {
|
||||
sdWrite(&PROTOCOL_SD, header, sizeof(header));
|
||||
if (payload_size) sdWrite(&PROTOCOL_SD, buf, payload_size);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void messageReceived(protocol_t *proto) {
|
||||
if (proto->buffer.msg_id != proto->previous_id) {
|
||||
/* It's not a resend / duplicate */
|
||||
proto->callback(&proto->buffer);
|
||||
proto->previous_id = proto->buffer.msg_id;
|
||||
}
|
||||
proto->state = STATE_SYNC_1;
|
||||
}
|
||||
|
||||
void proto_consume(protocol_t *proto, uint8_t byte) {
|
||||
switch (proto->state) {
|
||||
case STATE_SYNC_1:
|
||||
if (byte == 0x7A) {
|
||||
proto->state = STATE_SYNC_2;
|
||||
} else {
|
||||
proto->errors++;
|
||||
}
|
||||
return;
|
||||
|
||||
case STATE_SYNC_2:
|
||||
if (byte == 0x1D) {
|
||||
proto->state = STATE_CMD;
|
||||
} else {
|
||||
proto->state = STATE_SYNC_1;
|
||||
proto->errors++;
|
||||
}
|
||||
return;
|
||||
|
||||
case STATE_CMD:
|
||||
proto->buffer.command = byte;
|
||||
proto->state = STATE_ID;
|
||||
return;
|
||||
|
||||
case STATE_ID:
|
||||
proto->buffer.msg_id = byte;
|
||||
proto->state = STATE_PAYLOAD_SIZE;
|
||||
return;
|
||||
|
||||
case STATE_PAYLOAD_SIZE:
|
||||
proto->buffer.payload_size = byte;
|
||||
if (proto->buffer.payload_size > MAX_PAYLOAD_SIZE) {
|
||||
proto->buffer.payload_size = MAX_PAYLOAD_SIZE;
|
||||
proto->errors++;
|
||||
}
|
||||
proto->payload_position = 0;
|
||||
if (proto->buffer.payload_size == 0) {
|
||||
/* No payload - whole message received */
|
||||
messageReceived(proto);
|
||||
} else {
|
||||
proto->state = STATE_PAYLOAD;
|
||||
}
|
||||
return;
|
||||
|
||||
case STATE_PAYLOAD:
|
||||
/* NOTE: This could be read with sdReadTimeout probably, but that breaks
|
||||
* abstraction */
|
||||
proto->buffer.payload[proto->payload_position] = byte;
|
||||
proto->payload_position++;
|
||||
if (proto->payload_position == proto->buffer.payload_size) {
|
||||
/* Payload read - message received */
|
||||
messageReceived(proto);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void proto_silence(protocol_t *proto) {
|
||||
if (proto->state != STATE_SYNC_1) {
|
||||
proto->state = STATE_SYNC_1;
|
||||
proto->errors++;
|
||||
}
|
||||
}
|
||||
111
keyboards/annepro2/protocol.h
Normal file
111
keyboards/annepro2/protocol.h
Normal file
@@ -0,0 +1,111 @@
|
||||
/*
|
||||
* (c) 2021 by Tomasz bla Fortuna
|
||||
* License: GPLv2
|
||||
*
|
||||
* This file is shared with the Shine firmware. Keep it in sync (and in the
|
||||
* shine's clang formatting).
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include <stdint.h>
|
||||
|
||||
#define PROTOCOL_SD SD0
|
||||
|
||||
enum {
|
||||
/*
|
||||
* Main -> LED
|
||||
*/
|
||||
/* Basic config */
|
||||
CMD_LED_ON = 0x01,
|
||||
CMD_LED_OFF = 0x02,
|
||||
|
||||
CMD_LED_SET_PROFILE = 0x03,
|
||||
CMD_LED_NEXT_PROFILE = 0x04,
|
||||
CMD_LED_PREV_PROFILE = 0x05,
|
||||
|
||||
CMD_LED_NEXT_INTENSITY = 0x06,
|
||||
CMD_LED_NEXT_ANIMATION_SPEED = 0x07,
|
||||
|
||||
/* Masks */
|
||||
/* Override a key color, eg. capslock */
|
||||
CMD_LED_MASK_SET_KEY = 0x10,
|
||||
/* Override all keys in a row with configurable colors */
|
||||
CMD_LED_MASK_SET_ROW = 0x11,
|
||||
|
||||
/* Override all keys with single color (eg. foreground color) */
|
||||
CMD_LED_MASK_SET_MONO = 0x12,
|
||||
|
||||
/* Reactive / status */
|
||||
CMD_LED_GET_STATUS = 0x20,
|
||||
CMD_LED_KEY_BLINK = 0x21,
|
||||
CMD_LED_KEY_DOWN = 0x22,
|
||||
CMD_LED_KEY_UP = 0x23, /* TODO */
|
||||
CMD_LED_IAP = 0x24,
|
||||
|
||||
/* LED -> Main */
|
||||
/* Payload with data to send over HID */
|
||||
CMD_LED_DEBUG = 0x40,
|
||||
|
||||
/* Number of profiles, current profile, on/off state,
|
||||
reactive flag, brightness, errors */
|
||||
CMD_LED_STATUS = 0x41,
|
||||
};
|
||||
|
||||
/* 1 ROW * 14 COLS * 4B (RGBX) = 56 + header prefix. */
|
||||
#define MAX_PAYLOAD_SIZE 64
|
||||
|
||||
/** Enum of the states used for the serial protocol finite-state automaton */
|
||||
enum proto_state {
|
||||
/* 2-byte initial start-of-message sync */
|
||||
STATE_SYNC_1,
|
||||
STATE_SYNC_2,
|
||||
/* Waiting for command byte */
|
||||
STATE_CMD,
|
||||
/* Waiting for ID byte */
|
||||
STATE_ID,
|
||||
/* Waiting for payload size */
|
||||
STATE_PAYLOAD_SIZE,
|
||||
/* Reading payload until payload_position == payload_size */
|
||||
STATE_PAYLOAD,
|
||||
};
|
||||
|
||||
/* Buffer holding a single message */
|
||||
typedef struct {
|
||||
uint8_t command;
|
||||
uint8_t msg_id;
|
||||
uint8_t payload_size;
|
||||
uint8_t payload[MAX_PAYLOAD_SIZE];
|
||||
} message_t;
|
||||
|
||||
/* Internal protocol state */
|
||||
typedef struct {
|
||||
/* Callback to call upon receiving a valid message */
|
||||
void (*callback)(const message_t *);
|
||||
|
||||
/* Number of read payload bytes */
|
||||
uint8_t payload_position;
|
||||
|
||||
/* Current finite-state-automata state */
|
||||
enum proto_state state;
|
||||
|
||||
uint8_t previous_id;
|
||||
uint8_t errors;
|
||||
|
||||
/* Currently received message */
|
||||
message_t buffer;
|
||||
} protocol_t;
|
||||
|
||||
/* NOTE: This didn't work when defined on stack */
|
||||
extern protocol_t proto;
|
||||
|
||||
/* Init state */
|
||||
extern void proto_init(protocol_t *proto, void (*callback)(const message_t *));
|
||||
|
||||
/* Consume one byte and push state forward - might call the callback */
|
||||
extern void proto_consume(protocol_t *proto, uint8_t byte);
|
||||
|
||||
/* Prolonged silence - reset state */
|
||||
extern void proto_silence(protocol_t *proto);
|
||||
|
||||
/* Transmit message */
|
||||
extern void proto_tx(uint8_t cmd, const unsigned char *buf, int payload_size, int retries);
|
||||
50
keyboards/annepro2/readme.md
Normal file
50
keyboards/annepro2/readme.md
Normal file
@@ -0,0 +1,50 @@
|
||||
# Anne Pro 2 rev. C15 and C18 QMK firmware
|
||||
|
||||
## Introduction
|
||||
|
||||
This is the QMK firmware repository for the Anne Pro 2 rev. C15 and C18 keyboard.
|
||||
|
||||
## Layouts
|
||||
|
||||
Keyboard has 60% ANSI standard layout.
|
||||
|
||||
## How to compile
|
||||
|
||||
After setting up your build environment, you can compile the Anne Pro 2 C18 default keymap by using:
|
||||
|
||||
make annepro2/c18:default
|
||||
|
||||
If you want to compile the Anne Pro 2 C15 default keymap use:
|
||||
|
||||
make annepro2/c15:default
|
||||
|
||||
## Installing
|
||||
|
||||
### Get AnnePro2 Tools
|
||||
|
||||
If you want the executable instead of compiling it yourself, [download it here](https://ci.codetector.org/job/OpenAnnePro/job/AnnePro2-Tools/job/master/).
|
||||
Windows and Linux versions are available. Otherwise, follow the steps below:
|
||||
|
||||
0. Install the latest stable `rust` toolchain using [rustup](https://rustup.rs/)
|
||||
0. Also install [Visual Studio Community edition](https://visualstudio.microsoft.com/downloads/)
|
||||
including the C/C++ module to prevent errors while compiling
|
||||
0. Download or Clone the [AnnePro2-Tools](https://github.com/OpenAnnePro/AnnePro2-Tools) project.
|
||||
0. Compile the tool using
|
||||
```bash
|
||||
cargo build --release
|
||||
```
|
||||
0. The compiled tool should be in `./target/release/annepro2_tools` (In later I will refer to this as `annepro2_tools`)
|
||||
|
||||
### Flashing the firmware
|
||||
0. Put the keyboard into DFU/IAP mode by unplugging the keyboard, then holding ESC while plugging it back in.
|
||||
0. Run annepro2_tools with the firmware you just built.
|
||||
|
||||
**Please substitute with the correct paths and correct bin file if you chose another keymap profile**
|
||||
```bash
|
||||
annepro2_tools annepro2_c15_default.bin
|
||||
```
|
||||
|
||||
If the tool can't find the keyboard please double check you have the keyboard in IAP mode.
|
||||
|
||||
|
||||
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).
|
||||
66
keyboards/annepro2/rgb_driver.c
Normal file
66
keyboards/annepro2/rgb_driver.c
Normal file
@@ -0,0 +1,66 @@
|
||||
/* Copyright 2022 Jose Pablo Ramirez <jp.ramangulo@gmail.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
|
||||
#include "rgb_matrix.h"
|
||||
#include "ap2_led.h"
|
||||
|
||||
uint8_t led_pos[DRIVER_LED_TOTAL];
|
||||
|
||||
void init(void) {
|
||||
unsigned int i = 0;
|
||||
for (unsigned int y = 0; y < NUM_ROW; y++) {
|
||||
for (unsigned int x = 0; x < NUM_COLUMN; x++) {
|
||||
if (g_led_config.matrix_co[y][x] != NO_LED) {
|
||||
led_pos[g_led_config.matrix_co[y][x]] = i;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void flush(void) {}
|
||||
|
||||
void set_color(int index, uint8_t r, uint8_t g, uint8_t b) {
|
||||
if (r != led_mask[led_pos[index]].p.red ||
|
||||
g != led_mask[led_pos[index]].p.green ||
|
||||
b != led_mask[led_pos[index]].p.blue)
|
||||
{
|
||||
led_mask[led_pos[index]] = (ap2_led_t){
|
||||
.p.blue = b,
|
||||
.p.red = r,
|
||||
.p.green = g,
|
||||
.p.alpha = 0xff,
|
||||
};
|
||||
int row = led_pos[index] / NUM_COLUMN;
|
||||
rgb_row_changed[row] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
void set_color_all(uint8_t r, uint8_t g, uint8_t b) {
|
||||
for (int i=0; i<DRIVER_LED_TOTAL; i++)
|
||||
set_color(i, r, g, b);
|
||||
}
|
||||
|
||||
const rgb_matrix_driver_t rgb_matrix_driver = {
|
||||
.init = init,
|
||||
.flush = flush,
|
||||
.set_color = set_color,
|
||||
.set_color_all = set_color_all,
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -40,8 +40,8 @@ led_config_t g_led_config = { {
|
||||
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
|
||||
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
|
||||
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8,
|
||||
4, 4, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1,
|
||||
4, 4, 4, 1, 1, 4, 1, 1, 1,
|
||||
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
|
||||
4, 4, 4, 4, 4, 4, 4, 4, 4,
|
||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
|
||||
} };
|
||||
#endif
|
||||
@@ -52,9 +52,30 @@ bool encoder_update_kb(uint8_t index, bool clockwise) {
|
||||
return false;
|
||||
}
|
||||
if (clockwise) {
|
||||
tap_code(KC_VOLD);
|
||||
} else {
|
||||
tap_code(KC_VOLU);
|
||||
switch (get_highest_layer(layer_state)) {
|
||||
case 0:
|
||||
tap_code(KC_VOLU);
|
||||
break;
|
||||
case 1:
|
||||
rgb_matrix_step();
|
||||
break;
|
||||
default:
|
||||
tap_code(KC_VOLU);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
switch (get_highest_layer(layer_state)) {
|
||||
case 0:
|
||||
tap_code(KC_VOLD);
|
||||
break;
|
||||
case 1:
|
||||
rgb_matrix_step_reverse();
|
||||
break;
|
||||
default:
|
||||
tap_code(KC_VOLD);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
#pragma once
|
||||
#include "quantum.h"
|
||||
#include "encoder_actions.h"
|
||||
|
||||
#define LAYOUT( \
|
||||
K000, K001, K002, K003, K004, K005, K006, K007, K008, K010, K011, K012, K013, K014, \
|
||||
|
||||
@@ -35,12 +35,12 @@
|
||||
#define UNUSED_PINS
|
||||
|
||||
/* Encoder pins */
|
||||
#define ENCODERS_PAD_A { B0 }
|
||||
#define ENCODERS_PAD_B { E6 }
|
||||
#define ENCODERS_PAD_A { E6 }
|
||||
#define ENCODERS_PAD_B { B0 }
|
||||
#define ENCODER_RESOLUTION 4
|
||||
#define ENCODERS 1
|
||||
#define ENCODERS_CCW_KEY { { 3, 5 } } // Note: array is { col, row )
|
||||
#define ENCODERS_CW_KEY { { 4, 5 } } // Note: array is { col, row )
|
||||
#define ENCODERS_CCW_KEY { { 4, 5 } } // Note: array is { col, row )
|
||||
#define ENCODERS_CW_KEY { { 3, 5 } } // Note: array is { col, row )
|
||||
|
||||
/* LED pins */
|
||||
#define LED_CAPS_LOCK_PIN D4
|
||||
|
||||
@@ -58,9 +58,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
),
|
||||
|
||||
[_MOUSE] = LAYOUT_charybdis_3x5(
|
||||
_______, _______, _______, S_D_MOD, DPI_MOD, KC_WH_U, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, KC_WH_U, DPI_RMOD,DPI_MOD, S_D_RMOD,S_D_MOD,
|
||||
_______, _______, _______, _______, _______, KC_WH_D, KC_BTN1, KC_BTN3, KC_BTN2, KC_BTN6,
|
||||
_______, _______, _______, S_D_RMOD,DPI_RMOD, KC_BTN7, KC_BTN4, KC_BTN5, KC_BTN8, _______,
|
||||
_______, _______, _______, _______, _______, KC_BTN7, KC_BTN4, KC_BTN5, KC_BTN8, _______,
|
||||
_______, SNIPING, _______, _______, _______
|
||||
),
|
||||
[_LOWER] = LAYOUT_charybdis_3x5_wrapper(
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
#undef STM32_I2C_USE_I2C1
|
||||
#define STM32_I2C_USE_I2C1 TRUE
|
||||
|
||||
#undef STM32_I2C_I2C1_RX_DMA_STREAM
|
||||
#define STM32_I2C_I2C1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 0)
|
||||
// #undef STM32_I2C_I2C1_RX_DMA_STREAM
|
||||
// #define STM32_I2C_I2C1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 0)
|
||||
#undef STM32_I2C_I2C1_TX_DMA_STREAM
|
||||
#define STM32_I2C_I2C1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 1)
|
||||
|
||||
@@ -35,19 +35,9 @@
|
||||
#undef STM32_SPI_USE_SPI1
|
||||
#define STM32_SPI_USE_SPI1 TRUE
|
||||
|
||||
#undef STM32_SPI_SPI1_RX_DMA_STREAM
|
||||
#define STM32_SPI_SPI1_RX_DMA_STREAM STM32_DMA_STREAM_ID(2, 0)
|
||||
#undef STM32_SPI_SPI1_TX_DMA_STREAM
|
||||
#define STM32_SPI_SPI1_TX_DMA_STREAM STM32_DMA_STREAM_ID(2, 3)
|
||||
|
||||
#undef STM32_SERIAL_USE_USART2
|
||||
#define STM32_SERIAL_USE_USART2 TRUE
|
||||
|
||||
#undef STM32_UART_USART2_RX_DMA_STREAM
|
||||
#define STM32_UART_USART2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 5)
|
||||
#undef STM32_UART_USART2_TX_DMA_STREAM
|
||||
#define STM32_UART_USART2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 6)
|
||||
|
||||
#undef STM32_GPT_USE_TIM4
|
||||
#define STM32_GPT_USE_TIM4 TRUE
|
||||
|
||||
|
||||
@@ -2,7 +2,10 @@
|
||||
MCU = STM32F411
|
||||
|
||||
# Bootloader selection
|
||||
BOOTLOADER = stm32-dfu
|
||||
# BOOTLOADER = stm32-dfu
|
||||
BOOTLOADER := tinyuf2
|
||||
|
||||
LTO_ENABLE := no
|
||||
|
||||
BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite
|
||||
KEYBOARD_SHARED_EP = yes
|
||||
@@ -20,3 +23,5 @@ NKRO_ENABLE = yes
|
||||
CONSOLE_ENABLE = yes
|
||||
|
||||
AUTOCORRECTION_ENABLE = yes
|
||||
|
||||
DEBOUNCE_TYPE = asym_eager_defer_pk
|
||||
|
||||
38
keyboards/bastardkb/charybdis/4x6/keymaps/drashna/chconf.h
Normal file
38
keyboards/bastardkb/charybdis/4x6/keymaps/drashna/chconf.h
Normal file
@@ -0,0 +1,38 @@
|
||||
/* Copyright 2020 QMK
|
||||
*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This file was auto-generated by:
|
||||
* `qmk chibios-confmigrate -i keyboards/handwired/onekey/blackpill_f411/chconf.h -r platforms/chibios/common/configs/chconf.h`
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#define CH_CFG_ST_FREQUENCY 10000
|
||||
|
||||
#define CH_CFG_FACTORY_OBJECTS_REGISTRY TRUE
|
||||
|
||||
#define CH_CFG_FACTORY_GENERIC_BUFFERS TRUE
|
||||
|
||||
#define CH_CFG_FACTORY_SEMAPHORES TRUE
|
||||
|
||||
#define CH_CFG_FACTORY_MAILBOXES TRUE
|
||||
|
||||
#define CH_CFG_FACTORY_OBJ_FIFOS TRUE
|
||||
|
||||
#define CH_CFG_FACTORY_PIPES TRUE
|
||||
|
||||
#include_next <chconf.h>
|
||||
91
keyboards/bastardkb/charybdis/4x6/keymaps/drashna/config.h
Normal file
91
keyboards/bastardkb/charybdis/4x6/keymaps/drashna/config.h
Normal file
@@ -0,0 +1,91 @@
|
||||
/**
|
||||
* Copyright 2021 Charly Delay <charly@codesink.dev> (@0xcharly)
|
||||
*
|
||||
* 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
|
||||
|
||||
#undef MATRIX_COL_PINS
|
||||
#define MATRIX_COL_PINS \
|
||||
{ B0, B1, B10, B3, B4, B5 }
|
||||
#undef MATRIX_COL_PINS_RIGHT
|
||||
#define MATRIX_COL_PINS_RIGHT \
|
||||
{ B0, B1, B10, B3, B4, B5 }
|
||||
|
||||
#undef MATRIX_ROW_PINS
|
||||
#define MATRIX_ROW_PINS \
|
||||
{ B15, A2, B8, A8, B9 }
|
||||
#undef MATRIX_ROW_PINS_RIGHT
|
||||
#define MATRIX_ROW_PINS_RIGHT \
|
||||
{ B15, A2, B8, A8, B9 }
|
||||
|
||||
#define DIODE_DIRECTION ROW2COL
|
||||
#define SPLIT_HAND_PIN A3
|
||||
|
||||
#undef RGB_DI_PIN
|
||||
#define RGB_DI_PIN A1
|
||||
#define WS2812_EXTERNAL_PULLUP
|
||||
#define WS2812_PWM_DRIVER PWMD2
|
||||
#define WS2812_PWM_CHANNEL 2
|
||||
#define WS2812_PWM_PAL_MODE 1
|
||||
#define WS2812_EXTERNAL_PULLUP
|
||||
#define WS2812_DMA_STREAM STM32_DMA1_STREAM1
|
||||
#define WS2812_DMA_CHANNEL 3
|
||||
#define WS2812_PWM_TARGET_PERIOD 800000
|
||||
|
||||
#define DEBUG_LED_PIN C13
|
||||
|
||||
#undef SOFT_SERIAL_PIN
|
||||
// #define SERIAL_USART_FULL_DUPLEX // Enable full duplex operation mode.
|
||||
#define SERIAL_USART_TX_PIN A9
|
||||
// #define SERIAL_USART_RX_PIN A3
|
||||
// #define SERIAL_USART_DRIVER SD2
|
||||
// #define SERIAL_USART_TX_PAL_MODE 7 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 7
|
||||
// #define SERIAL_USART_RX_PAL_MODE 7 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 7
|
||||
// #define SERIAL_USART_TIMEOUT 100 // USART driver timeout. default 100
|
||||
// // #define SERIAL_USART_PIN_SWAP // swap RX and TX pins on master
|
||||
// // To use the highest possible baudrate (3.75Mbit/s) uncomment the following
|
||||
// // line, this can result in dropped communications so lower the speed if there
|
||||
// // are many timeouts.
|
||||
// // #define SERIAL_USART_SPEED (STM32_PCLK2 >> 4)
|
||||
|
||||
#define CRC8_USE_TABLE
|
||||
#define CRC8_OPTIMIZE_SPEED
|
||||
|
||||
/* spi config for eeprom and pmw3360 sensor */
|
||||
#define SPI_DRIVER SPID1
|
||||
#define SPI_SCK_PIN A5
|
||||
#define SPI_SCK_PAL_MODE 5
|
||||
#define SPI_MOSI_PIN A7
|
||||
#define SPI_MOSI_PAL_MODE 5
|
||||
#define SPI_MISO_PIN A6
|
||||
#define SPI_MISO_PAL_MODE 5
|
||||
|
||||
#define EXTERNAL_EEPROM_SPI_SLAVE_SELECT_PIN A4
|
||||
#define EXTERNAL_EEPROM_SPI_CLOCK_DIVISOR 64
|
||||
|
||||
#undef PMW3360_CS_PIN
|
||||
#define PMW3360_CS_PIN B14
|
||||
#define PMW3360_CS_MODE 3
|
||||
#define PMW3360_CS_DIVISOR 64
|
||||
|
||||
#define CHARYBDIS_MINIMUM_DEFAULT_DPI 1200
|
||||
#define CHARYBDIS_DEFAULT_DPI_CONFIG_STEP 400
|
||||
#define CHARYBDIS_MINIMUM_SNIPING_DPI 200
|
||||
#define CHARYBDIS_SNIPING_DPI_CONFIG_STEP 100
|
||||
|
||||
/* RGB Matrix. */
|
||||
|
||||
#undef RGB_MATRIX_MAXIMUM_BRIGHTNESS
|
||||
#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 150
|
||||
26
keyboards/bastardkb/charybdis/4x6/keymaps/drashna/halconf.h
Normal file
26
keyboards/bastardkb/charybdis/4x6/keymaps/drashna/halconf.h
Normal file
@@ -0,0 +1,26 @@
|
||||
/* Copyright 2020 Nick Brassel (tzarc)
|
||||
*
|
||||
* 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 3 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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#define HAL_USE_PWM TRUE
|
||||
#define HAL_USE_SERIAL TRUE
|
||||
// #define HAL_USE_I2C TRUE
|
||||
#define HAL_USE_SPI TRUE
|
||||
#define SPI_USE_WAIT TRUE
|
||||
#define SPI_SELECT_MODE SPI_SELECT_MODE_PAD
|
||||
// #define HAL_USE_GPT TRUE
|
||||
|
||||
#include_next <halconf.h>
|
||||
132
keyboards/bastardkb/charybdis/4x6/keymaps/drashna/keymap.c
Normal file
132
keyboards/bastardkb/charybdis/4x6/keymaps/drashna/keymap.c
Normal file
@@ -0,0 +1,132 @@
|
||||
/**
|
||||
* Copyright 2021 Charly Delay <charly@codesink.dev> (@0xcharly)
|
||||
*
|
||||
* 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 "drashna.h"
|
||||
|
||||
#define LAYOUT_charybdis_4x6_wrapper(...) LAYOUT_charybdis_4x6(__VA_ARGS__)
|
||||
#define LAYOUT_charybdis_4x6_base( \
|
||||
K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \
|
||||
K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, \
|
||||
K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \
|
||||
) \
|
||||
LAYOUT_charybdis_4x6_wrapper( \
|
||||
KC_ESC, ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, UC_CLUE, \
|
||||
SH_TT, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, SH_TT, \
|
||||
LALT_T(KC_TAB), K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, RALT_T(K1B), \
|
||||
OS_LSFT, CTL_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, RCTL_T(K2A), OS_RSFT, \
|
||||
KC_GRV, OS_LALT, OS_LGUI, TT(_MOUSE), KC_ENT, \
|
||||
KC_SPC, BK_LWER, DL_RAIS \
|
||||
)
|
||||
|
||||
#define LAYOUT_base_wrapper(...) LAYOUT_charybdis_4x6_base(__VA_ARGS__)
|
||||
|
||||
// clang-format off
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[_DEFAULT_LAYER_1] = LAYOUT_base_wrapper(
|
||||
_________________QWERTY_L1_________________, _________________QWERTY_R1_________________,
|
||||
_________________QWERTY_L2_________________, _________________QWERTY_R2_________________,
|
||||
_________________QWERTY_L3_________________, _________________QWERTY_R3_________________
|
||||
),
|
||||
|
||||
[_DEFAULT_LAYER_2] = LAYOUT_base_wrapper(
|
||||
______________COLEMAK_MOD_DH_L1____________, ______________COLEMAK_MOD_DH_R1____________,
|
||||
______________COLEMAK_MOD_DH_L2____________, ______________COLEMAK_MOD_DH_R2____________,
|
||||
______________COLEMAK_MOD_DH_L3____________, ______________COLEMAK_MOD_DH_R3____________
|
||||
),
|
||||
[_DEFAULT_LAYER_3] = LAYOUT_base_wrapper(
|
||||
_________________COLEMAK_L1________________, _________________COLEMAK_R1________________,
|
||||
_________________COLEMAK_L2________________, _________________COLEMAK_R2________________,
|
||||
_________________COLEMAK_L3________________, _________________COLEMAK_R3________________
|
||||
),
|
||||
|
||||
[_DEFAULT_LAYER_4] = LAYOUT_base_wrapper(
|
||||
_________________DVORAK_L1_________________, _________________DVORAK_R1_________________,
|
||||
_________________DVORAK_L2_________________, _________________DVORAK_R2_________________,
|
||||
_________________DVORAK_L3_________________, _________________DVORAK_R3_________________
|
||||
),
|
||||
|
||||
|
||||
|
||||
[_MOUSE] = LAYOUT_charybdis_4x6(
|
||||
_______, _______, _______, _______, _______, _______, DRGSCRL, DPI_RMOD,DPI_MOD, S_D_RMOD,S_D_MOD, SNP_TOG,
|
||||
_______, _______, _______, _______, _______, _______, KC_WH_U, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, KC_WH_D, KC_BTN1, KC_BTN3, KC_BTN2, KC_BTN6, SNIPING,
|
||||
_______, _______, _______, _______, _______, _______, KC_BTN7, KC_BTN4, KC_BTN5, KC_BTN8, _______, _______,
|
||||
_______, _______, _______, _______, _______,
|
||||
_______, _______, _______
|
||||
),
|
||||
[_GAMEPAD] = LAYOUT_charybdis_4x6(
|
||||
KC_ESC, KC_NO, KC_1, KC_2, KC_3, KC_4, _______, _______, _______, _______, _______, _______,
|
||||
KC_F1, KC_K, KC_Q, KC_W, KC_E, KC_R, _______, _______, _______, _______, _______, _______,
|
||||
KC_TAB, KC_G, KC_A, KC_S, KC_D, KC_F, _______, _______, _______, _______, _______, _______,
|
||||
KC_LCTL, KC_LSFT, KC_Z, KC_X, KC_C, KC_H, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______,
|
||||
_______, _______, _______
|
||||
),
|
||||
[_DIABLO] = LAYOUT_charybdis_4x6(
|
||||
KC_ESC, KC_V, KC_D, KC_LALT, KC_NO, KC_NO, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_NO,
|
||||
KC_TAB, KC_S, KC_I, KC_F, KC_M, KC_T, _______, _______, _______, _______, _______, _______,
|
||||
KC_Q, KC_1, KC_2, KC_3, KC_4, KC_G, _______, _______, _______, _______, _______, _______,
|
||||
KC_LCTL, KC_D3_1, KC_D3_2, KC_D3_3, KC_D3_4, KC_Z, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______,
|
||||
_______, _______, _______
|
||||
),
|
||||
[_DIABLOII] = LAYOUT_charybdis_4x6(
|
||||
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_GRV, _______, _______, _______, _______, _______, _______,
|
||||
KC_TAB, KC_A, KC_T, KC_Q, KC_I, KC_M, _______, _______, _______, _______, _______, _______,
|
||||
KC_S, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, _______, _______, _______, _______,
|
||||
KC_LCTL, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______,
|
||||
_______, _______, _______
|
||||
),
|
||||
|
||||
[_LOWER] = LAYOUT_charybdis_4x6_wrapper(
|
||||
KC_F12, _________________FUNC_LEFT_________________, _________________FUNC_RIGHT________________, KC_F11,
|
||||
_______, _________________LOWER_L1__________________, _________________LOWER_R1__________________, _______,
|
||||
_______, _________________LOWER_L2__________________, _________________LOWER_R2__________________, KC_PIPE,
|
||||
_______, _________________LOWER_L3__________________, _________________LOWER_R3__________________, _______,
|
||||
_______, _______, _______, _______, _______,
|
||||
_______, _______, _______
|
||||
),
|
||||
|
||||
[_RAISE] = LAYOUT_charybdis_4x6_wrapper(
|
||||
KC_F12, _________________FUNC_LEFT_________________, _________________FUNC_RIGHT________________, KC_F11,
|
||||
KC_GRV, _________________RAISE_L1__________________, _________________RAISE_R1__________________, _______,
|
||||
_______, _________________RAISE_L2__________________, _________________RAISE_R2__________________, KC_BSLS,
|
||||
_______, _________________RAISE_L3__________________, _________________RAISE_R3__________________, _______,
|
||||
_______, _______, _______, _______, _______,
|
||||
_______, _______, _______
|
||||
)
|
||||
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
|
||||
void matrix_init_keyemap(void) { setPinInputHigh(A0); }
|
||||
|
||||
void matrix_scan_keymap(void) {
|
||||
if (!readPin(A0)) {
|
||||
reset_keyboard();
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef USB_VBUS_PIN
|
||||
bool usb_vbus_state(void) {
|
||||
setPinInputLow(USB_VBUS_PIN);
|
||||
wait_us(5);
|
||||
return readPin(USB_VBUS_PIN);
|
||||
}
|
||||
#endif
|
||||
44
keyboards/bastardkb/charybdis/4x6/keymaps/drashna/mcuconf.h
Normal file
44
keyboards/bastardkb/charybdis/4x6/keymaps/drashna/mcuconf.h
Normal file
@@ -0,0 +1,44 @@
|
||||
/* Copyright 2020 Nick Brassel (tzarc)
|
||||
*
|
||||
* 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 3 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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include_next "mcuconf.h"
|
||||
#undef STM32_I2C_USE_I2C1
|
||||
#define STM32_I2C_USE_I2C1 TRUE
|
||||
|
||||
// #undef STM32_I2C_I2C1_RX_DMA_STREAM
|
||||
// #define STM32_I2C_I2C1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 0)
|
||||
#undef STM32_I2C_I2C1_TX_DMA_STREAM
|
||||
#define STM32_I2C_I2C1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 1)
|
||||
|
||||
#undef STM32_PWM_USE_TIM2
|
||||
#define STM32_PWM_USE_TIM2 TRUE
|
||||
|
||||
#undef STM32_PWM_USE_TIM3
|
||||
#define STM32_PWM_USE_TIM3 TRUE
|
||||
|
||||
#undef STM32_SPI_USE_SPI1
|
||||
#define STM32_SPI_USE_SPI1 TRUE
|
||||
|
||||
#undef STM32_SERIAL_USE_USART1
|
||||
#define STM32_SERIAL_USE_USART1 TRUE
|
||||
|
||||
#undef STM32_GPT_USE_TIM4
|
||||
#define STM32_GPT_USE_TIM4 TRUE
|
||||
|
||||
#undef STM32_ST_USE_TIMER
|
||||
#define STM32_ST_USE_TIMER 5
|
||||
24
keyboards/bastardkb/charybdis/4x6/keymaps/drashna/rules.mk
Normal file
24
keyboards/bastardkb/charybdis/4x6/keymaps/drashna/rules.mk
Normal file
@@ -0,0 +1,24 @@
|
||||
# MCU name
|
||||
MCU = STM32F411
|
||||
|
||||
# Bootloader selection
|
||||
BOOTLOADER = stm32-dfu
|
||||
# BOOTLOADER := tinyuf2
|
||||
|
||||
LTO_ENABLE := no
|
||||
|
||||
BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite
|
||||
KEYBOARD_SHARED_EP = yes
|
||||
MOUSE_SHARED_EP = yes
|
||||
|
||||
EEPROM_DRIVER = spi
|
||||
WS2812_DRIVER = pwm
|
||||
SERIAL_DRIVER = usart
|
||||
|
||||
MOUSEKEY_ENABLE = yes
|
||||
NKRO_ENABLE = yes
|
||||
CONSOLE_ENABLE = yes
|
||||
|
||||
AUTOCORRECTION_ENABLE = yes
|
||||
|
||||
DEBOUNCE_TYPE = asym_eager_defer_pk
|
||||
@@ -245,15 +245,3 @@ void matrix_print(void)
|
||||
print("\n");
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t matrix_key_count(void)
|
||||
{
|
||||
uint8_t count = 0;
|
||||
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
|
||||
for (uint8_t j = 0; j < MATRIX_COLS; j++) {
|
||||
if (matrix_is_on(i, j))
|
||||
count++;
|
||||
}
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
@@ -132,14 +132,6 @@ void matrix_print(void) {
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t matrix_key_count(void) {
|
||||
uint8_t count = 0;
|
||||
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
|
||||
count += bitpop32(matrix[i]);
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
static uint8_t read_rows(void) {
|
||||
return
|
||||
(PINC&(1<<7) ? 0 : (1<<0)) |
|
||||
|
||||
@@ -132,15 +132,6 @@ void matrix_print(void)
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t matrix_key_count(void)
|
||||
{
|
||||
uint8_t count = 0;
|
||||
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
|
||||
count += bitpop16(matrix[i]);
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
static matrix_row_t read_cols(void)
|
||||
{
|
||||
return
|
||||
|
||||
@@ -111,15 +111,6 @@ void matrix_print(void)
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t matrix_key_count(void)
|
||||
{
|
||||
uint8_t count = 0;
|
||||
for (uint8_t i = 0; i < matrix_rows(); i++) {
|
||||
count += bitpop16(matrix_get_row(i));
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
static matrix_row_t read_cols(void)
|
||||
{
|
||||
return
|
||||
|
||||
@@ -146,10 +146,3 @@ void matrix_print(void) {
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
uint8_t matrix_key_count(void) {
|
||||
uint8_t count = 0;
|
||||
for (uint8_t row = 0; row < MATRIX_ROWS; row++)
|
||||
count += bitpop32(matrix[row]);
|
||||
return count;
|
||||
}
|
||||
|
||||
@@ -147,10 +147,3 @@ void matrix_print(void) {
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
uint8_t matrix_key_count(void) {
|
||||
uint8_t count = 0;
|
||||
for (uint8_t row = 0; row < MATRIX_ROWS; row++)
|
||||
count += bitpop32(matrix[row]);
|
||||
return count;
|
||||
}
|
||||
|
||||
74
keyboards/checkerboards/quark_plus/config.h
Normal file
74
keyboards/checkerboards/quark_plus/config.h
Normal file
@@ -0,0 +1,74 @@
|
||||
/* Copyright 2022 Nathan Spears
|
||||
*
|
||||
* 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 0x7070
|
||||
#define PRODUCT_ID 0x5344
|
||||
#define DEVICE_VER 0x0001
|
||||
#define MANUFACTURER Nasp
|
||||
#define PRODUCT QUARK_PlUS
|
||||
|
||||
/* key matrix size */
|
||||
#define MATRIX_ROWS 8
|
||||
#define MATRIX_COLS 6
|
||||
|
||||
/* key matrix pins */
|
||||
#define MATRIX_ROW_PINS { B4, B1, C2, D0, D6, B0, B6, B5 }
|
||||
#define MATRIX_COL_PINS { C6, D1, D5, D4, D3, D2 }
|
||||
#define UNUSED_PINS
|
||||
|
||||
/* COL2ROW or ROW2COL */
|
||||
#define DIODE_DIRECTION COL2ROW
|
||||
|
||||
/* Set 0 if debouncing isn't needed */
|
||||
#define DEBOUNCE 5
|
||||
|
||||
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
||||
#define LOCKING_SUPPORT_ENABLE
|
||||
|
||||
/* Locking resynchronize hack */
|
||||
#define LOCKING_RESYNC_ENABLE
|
||||
|
||||
/* Switch LED Backlighting */
|
||||
#define BACKLIGHT_PIN C4
|
||||
#define BACKLIGHT_LEVELS 6
|
||||
#define BACKLIGHT_BREATHING
|
||||
#define BREATHING_PERIOD 6
|
||||
|
||||
// ws2812 options
|
||||
#define RGB_DI_PIN C5 // pin the DI on the ws2812 is hooked-up to
|
||||
#define RGBLIGHT_EFFECT_BREATHING
|
||||
#define RGBLIGHT_EFFECT_RAINBOW_MOOD
|
||||
#define RGBLIGHT_EFFECT_RAINBOW_SWIRL
|
||||
#define RGBLIGHT_EFFECT_SNAKE
|
||||
#define RGBLIGHT_EFFECT_KNIGHT
|
||||
#define RGBLIGHT_EFFECT_CHRISTMAS
|
||||
#define RGBLIGHT_EFFECT_STATIC_GRADIENT
|
||||
#define RGBLIGHT_EFFECT_RGB_TEST
|
||||
#define RGBLIGHT_EFFECT_ALTERNATING
|
||||
#define RGBLIGHT_EFFECT_TWINKLE
|
||||
#define RGBLED_NUM 14 // number of LEDs
|
||||
#define RGBLIGHT_HUE_STEP 12 // units to step when in/decreasing hue
|
||||
#define RGBLIGHT_SAT_STEP 12 // units to step when in/decresing saturation
|
||||
#define RGBLIGHT_VAL_STEP 12 // units to step when in/decreasing value (brightness)
|
||||
|
||||
#define ENCODERS_PAD_A { C7, B7, B3, B2}
|
||||
#define ENCODERS_PAD_B { B7, C7, B2, B3}
|
||||
#define ENCODER_RESOLUTION 4
|
||||
23
keyboards/checkerboards/quark_plus/info.json
Normal file
23
keyboards/checkerboards/quark_plus/info.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"keyboard_name": "Quark_Plus",
|
||||
"url": "https://www.github.com/qmk/qmk_firmware/tree/master/keyboards/checkerboards/quark_plus",
|
||||
"maintainer": "nasp",
|
||||
"layouts": {
|
||||
"LAYOUT_grid": {
|
||||
"layout":
|
||||
[{"label":"Tab", "x":0, "y":0}, {"label":"Q", "x":1, "y":0}, {"label":"W", "x":2, "y":0}, {"label":"E", "x":3, "y":0}, {"label":"R", "x":4, "y":0}, {"label":"T", "x":5, "y":0}, {"label":"Y", "x":6, "y":0}, {"label":"U", "x":7, "y":0}, {"label":"I", "x":8, "y":0}, {"label":"O", "x":9, "y":0}, {"label":"P", "x":10, "y":0}, {"label":"Back Space", "x":11, "y":0}, {"label":"Esc", "x":0, "y":1}, {"label":"A", "x":1, "y":1}, {"label":"S", "x":2, "y":1}, {"label":"D", "x":3, "y":1}, {"label":"F", "x":4, "y":1}, {"label":"G", "x":5, "y":1}, {"label":"H", "x":6, "y":1}, {"label":"J", "x":7, "y":1}, {"label":"K", "x":8, "y":1}, {"label":"L", "x":9, "y":1}, {"label":";", "x":10, "y":1}, {"label":"'", "x":11, "y":1}, {"label":"Shift", "x":0, "y":2}, {"label":"Z", "x":1, "y":2}, {"label":"X", "x":2, "y":2}, {"label":"C", "x":3, "y":2}, {"label":"V", "x":4, "y":2}, {"label":"B", "x":5, "y":2}, {"label":"N", "x":6, "y":2}, {"label":"M", "x":7, "y":2}, {"label":",", "x":8, "y":2}, {"label":".", "x":9, "y":2}, {"label":"/", "x":10, "y":2}, {"label":"Return", "x":11, "y":2}, {"label":"CTRL", "x":0, "y":3}, {"label":"WIN", "x":1, "y":3}, {"label":"MENU", "x":2, "y":3}, {"label":"ALT", "x":3, "y":3}, {"label":"⇓", "x":4, "y":3}, {"x":5, "y":3}, {"x":6, "y":3}, {"label":"⇑", "x":7, "y":3}, {"label":"LEFT", "x":8, "y":3}, {"label":"DOWN", "x":9, "y":3}, {"label":"UP", "x":10, "y":3}, {"label":"RIGHT", "x":11, "y":3}]
|
||||
},
|
||||
"LAYOUT_2u": {
|
||||
"layout":
|
||||
[{"label":"Tab", "x":0, "y":0}, {"label":"Q", "x":1, "y":0}, {"label":"W", "x":2, "y":0}, {"label":"E", "x":3, "y":0}, {"label":"R", "x":4, "y":0}, {"label":"T", "x":5, "y":0}, {"label":"Y", "x":6, "y":0}, {"label":"U", "x":7, "y":0}, {"label":"I", "x":8, "y":0}, {"label":"O", "x":9, "y":0}, {"label":"P", "x":10, "y":0}, {"label":"Back Space", "x":11, "y":0}, {"label":"Esc", "x":0, "y":1}, {"label":"A", "x":1, "y":1}, {"label":"S", "x":2, "y":1}, {"label":"D", "x":3, "y":1}, {"label":"F", "x":4, "y":1}, {"label":"G", "x":5, "y":1}, {"label":"H", "x":6, "y":1}, {"label":"J", "x":7, "y":1}, {"label":"K", "x":8, "y":1}, {"label":"L", "x":9, "y":1}, {"label":";", "x":10, "y":1}, {"label":"'", "x":11, "y":1}, {"label":"Shift", "x":0, "y":2}, {"label":"Z", "x":1, "y":2}, {"label":"X", "x":2, "y":2}, {"label":"C", "x":3, "y":2}, {"label":"V", "x":4, "y":2}, {"label":"B", "x":5, "y":2}, {"label":"N", "x":6, "y":2}, {"label":"M", "x":7, "y":2}, {"label":",", "x":8, "y":2}, {"label":".", "x":9, "y":2}, {"label":"/", "x":10, "y":2}, {"label":"Return", "x":11, "y":2}, {"label":"CTRL", "x":0, "y":3}, {"label":"WIN", "x":1, "y":3}, {"label":"MENU", "x":2, "y":3}, {"label":"ALT", "x":3, "y":3}, {"label":"⇓", "x":4, "y":3}, {"x":5, "y":3, "w":2}, {"label":"⇑", "x":7, "y":3}, {"label":"LEFT", "x":8, "y":3}, {"label":"DOWN", "x":9, "y":3}, {"label":"UP", "x":10, "y":3}, {"label":"RIGHT", "x":11, "y":3}]
|
||||
},
|
||||
"LAYOUT_2x225u": {
|
||||
"layout":
|
||||
[{"label":"Tab", "x":0, "y":0}, {"label":"Q", "x":1, "y":0}, {"label":"W", "x":2, "y":0}, {"label":"E", "x":3, "y":0}, {"label":"R", "x":4, "y":0}, {"label":"T", "x":5, "y":0}, {"label":"Y", "x":6, "y":0}, {"label":"U", "x":7, "y":0}, {"label":"I", "x":8, "y":0}, {"label":"O", "x":9, "y":0}, {"label":"P", "x":10, "y":0}, {"label":"Back Space", "x":11, "y":0}, {"label":"Esc", "x":0, "y":1}, {"label":"A", "x":1, "y":1}, {"label":"S", "x":2, "y":1}, {"label":"D", "x":3, "y":1}, {"label":"F", "x":4, "y":1}, {"label":"G", "x":5, "y":1}, {"label":"H", "x":6, "y":1}, {"label":"J", "x":7, "y":1}, {"label":"K", "x":8, "y":1}, {"label":"L", "x":9, "y":1}, {"label":";", "x":10, "y":1}, {"label":"'", "x":11, "y":1}, {"label":"Shift", "x":0, "y":2}, {"label":"Z", "x":1, "y":2}, {"label":"X", "x":2, "y":2}, {"label":"C", "x":3, "y":2}, {"label":"V", "x":4, "y":2}, {"label":"B", "x":5, "y":2}, {"label":"N", "x":6, "y":2}, {"label":"M", "x":7, "y":2}, {"label":",", "x":8, "y":2}, {"label":".", "x":9, "y":2}, {"label":"/", "x":10, "y":2}, {"label":"Return", "x":11, "y":2}, {"label":"CTRL", "x":0, "y":3, "w":1.25}, {"label":"WIN", "x":1.25, "y":3, "w":1.25}, {"label":"ALT", "x":2.5, "y":3, "w":1.25}, {"x":3.75, "y":3, "w":2.25}, {"x":6, "y":3, "w":2.25}, {"label":"ALT", "x":8.25, "y":3, "w":1.25}, {"label":"MENU", "x":9.5, "y":3, "w":1.25}, {"label":"CTRL", "x":10.75, "y":3, "w":1.25}]
|
||||
},
|
||||
"LAYOUT_2x3u": {
|
||||
"layout":
|
||||
[{"label":"Tab", "x":0, "y":0}, {"label":"Q", "x":1, "y":0}, {"label":"W", "x":2, "y":0}, {"label":"E", "x":3, "y":0}, {"label":"R", "x":4, "y":0}, {"label":"T", "x":5, "y":0}, {"label":"Y", "x":6, "y":0}, {"label":"U", "x":7, "y":0}, {"label":"I", "x":8, "y":0}, {"label":"O", "x":9, "y":0}, {"label":"P", "x":10, "y":0}, {"label":"Back Space", "x":11, "y":0}, {"label":"Esc", "x":0, "y":1}, {"label":"A", "x":1, "y":1}, {"label":"S", "x":2, "y":1}, {"label":"D", "x":3, "y":1}, {"label":"F", "x":4, "y":1}, {"label":"G", "x":5, "y":1}, {"label":"H", "x":6, "y":1}, {"label":"J", "x":7, "y":1}, {"label":"K", "x":8, "y":1}, {"label":"L", "x":9, "y":1}, {"label":";", "x":10, "y":1}, {"label":"'", "x":11, "y":1}, {"label":"Shift", "x":0, "y":2}, {"label":"Z", "x":1, "y":2}, {"label":"X", "x":2, "y":2}, {"label":"C", "x":3, "y":2}, {"label":"V", "x":4, "y":2}, {"label":"B", "x":5, "y":2}, {"label":"N", "x":6, "y":2}, {"label":"M", "x":7, "y":2}, {"label":",", "x":8, "y":2}, {"label":".", "x":9, "y":2}, {"label":"/", "x":10, "y":2}, {"label":"Return", "x":11, "y":2}, {"label":"CTRL", "x":0, "y":3}, {"label":"WIN", "x":1, "y":3}, {"label":"ALT", "x":2, "y":3}, {"x":3, "y":3, "w":3}, {"x":6, "y":3, "w":3}, {"label":"ALT", "x":9, "y":3}, {"label":"MENU", "x":10, "y":3}, {"label":"CTRL", "x":11, "y":3}]
|
||||
}
|
||||
}
|
||||
}
|
||||
1
keyboards/checkerboards/quark_plus/keymaps/2u/config.h
Normal file
1
keyboards/checkerboards/quark_plus/keymaps/2u/config.h
Normal file
@@ -0,0 +1 @@
|
||||
#define TAPPING_TOGGLE 2
|
||||
82
keyboards/checkerboards/quark_plus/keymaps/2u/keymap.c
Normal file
82
keyboards/checkerboards/quark_plus/keymaps/2u/keymap.c
Normal file
@@ -0,0 +1,82 @@
|
||||
/* Copyright 2022 Nathan Spears
|
||||
*
|
||||
* 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 for task manager and such
|
||||
#define CALTDEL LCTL(LALT(KC_DEL))
|
||||
#define TSKMGR LCTL(LSFT(KC_ESC))
|
||||
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
/* [0]
|
||||
* ,-----------------------------------------------------------------------------------------.
|
||||
* |------------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | TAB | Q | W | E | R | T | Y | U | I | O | P | DEL |
|
||||
* |------------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | CTRL&ESC | A | S | D | F | G | H | J | K | L | ; | " |
|
||||
* |------------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | SHIFT | Z | X | C | V | B | N | M | , | . | / | ENTER |
|
||||
* |-------+-------+-------+-------+-------+-------+------+------+------+------+------+------|
|
||||
* | PRINT | Ctrl | ALT | GUI |LOWER | SPACE |RAISE | LEFT | DOWN | UP |RIGHT |
|
||||
* `-----------------------------------------------------------------------------------------'
|
||||
*/
|
||||
[0] = LAYOUT_2u(
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL,
|
||||
CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT,
|
||||
KC_PSCR, KC_LCTL, KC_LALT, KC_LGUI, TT(1), KC_SPC, TT(2), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
|
||||
),
|
||||
|
||||
/* [1]
|
||||
* ,---------------------------------------------------------------------------------------.
|
||||
* |------------+------+------+------+------+------+------+------+------+------+------+----|
|
||||
* | ~ | ! | @ | # | $ | % | | ^ | & | * | ( | ) | BCKSPC |
|
||||
* |------------+------+------+------+------+-------------+------+------+------+------+----|
|
||||
* | \ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | / |
|
||||
* |------------+------+------+------+------+------|------+------+------+------+------+----|
|
||||
* | | | | | | | | + | = | | | |
|
||||
* |-------+-------+-------+-------+-------+-------+------+------+------+------+------+----|
|
||||
* | | | ESC |CTRL-ALT-DEL|TASK| | | | | '|' | ` | |
|
||||
* `---------------------------------------------------------------------------------------'
|
||||
*/
|
||||
[1] = LAYOUT_2u(
|
||||
KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC,
|
||||
KC_SLSH, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PPLS, KC_EQL, _______, _______, _______,
|
||||
_______, KC_ESC, CALTDEL, TSKMGR, _______, _______, _______, _______, KC_NUBS, KC_GRV, _______
|
||||
),
|
||||
|
||||
/* [2]
|
||||
* ,---------------------------------------------------------------------------------------.
|
||||
* |------------+------+------+------+------+------+------+------+------+------+------+---|
|
||||
* | | | | UP | | | | _ | | [ | ] | |
|
||||
* |------------+------+------+------+------+-------------+------+------+------+------+---|
|
||||
* | | | LEFT | DOWN | RIGHT | | | - | | [ | ] | |
|
||||
* |------------+------+------+------+------+-----+-----+------+------+------+------+-----|
|
||||
* | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 |
|
||||
* |-------+-------+-------+-------+-------+-------+------+------+------+------+------+---|
|
||||
* |RESET | | | | | | | | | | |
|
||||
* `---------------------------------------------------------------------------------------'
|
||||
*/
|
||||
[2] = LAYOUT_2u(
|
||||
_______, _______, _______, KC_UP, _______, _______, _______, KC_UNDS, _______, KC_LBRC, KC_RBRC, _______,
|
||||
_______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, KC_MINS, _______, KC_LCBR, KC_RCBR, _______,
|
||||
KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,
|
||||
RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
),
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
#define TAPPING_TOGGLE 2
|
||||
82
keyboards/checkerboards/quark_plus/keymaps/2x225u/keymap.c
Normal file
82
keyboards/checkerboards/quark_plus/keymaps/2x225u/keymap.c
Normal file
@@ -0,0 +1,82 @@
|
||||
/* Copyright 2015-2017 Jack Humbert
|
||||
* Modified by Nasp for the Quark
|
||||
* 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 for task manager and such
|
||||
#define CALTDEL LCTL(LALT(KC_DEL))
|
||||
#define TSKMGR LCTL(LSFT(KC_ESC))
|
||||
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
/* [0]
|
||||
* ,-----------------------------------------------------------------------------------------.
|
||||
* |------------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | Tab | Q | W | E | R | T | Y | U | I | O | P | Del |
|
||||
* |------------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | CTL & ESC | A | S | D | F | G | H | J | K | L | ; | " |
|
||||
* |------------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | Shift | Z | X | C | V | B | N | M | , | . | / |Enter |
|
||||
* |-------+-------+-------+-------+-------+-------+------+------+------+------+------+------|
|
||||
* | PRINT | OS | Alt | Layer | Space & Layer | [ | ] | CAPS |
|
||||
* `-----------------------------------------------------------------------------------------'
|
||||
*/
|
||||
[0] = LAYOUT_2x225u(
|
||||
KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC,
|
||||
CTL_T(KC_ESC), KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT,
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT,
|
||||
KC_PSCR, KC_LGUI, KC_LALT, TT(1), LT(2, KC_SPC), KC_LBRC, KC_RBRC, KC_CAPS
|
||||
),
|
||||
|
||||
/* [1]
|
||||
* ,---------------------------------------------------------------------------------------.
|
||||
* |------------+------+------+------+------+------+------+------+------+------+------+----|
|
||||
* | ~ | ! | @ | # | $ | % | | ^ | & | * | ( | ) | BCKSPC |
|
||||
* |------------+------+------+------+------+-------------+------+------+------+------+----|
|
||||
* | \ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | / |
|
||||
* |------------+------+------+------+------+------|------+------+------+------+------+----|
|
||||
* | | | | | | | | + | = | | | |
|
||||
* |-------+-------+-------+-------+-------+-------+------+------+------+------+------+----|
|
||||
* | ESC | CTRL-ALT-DEL | TASK | | | '|' | ` | |
|
||||
* `---------------------------------------------------------------------------------------'
|
||||
*/
|
||||
[1] = LAYOUT_2x225u(
|
||||
KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC,
|
||||
KC_SLSH, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PPLS, KC_EQL, _______, _______, _______,
|
||||
KC_ESC, CALTDEL, TSKMGR, _______, _______, KC_NUBS, KC_GRV, _______
|
||||
),
|
||||
|
||||
/* [2]
|
||||
* ,---------------------------------------------------------------------------------------.
|
||||
* |------------+------+------+------+------+------+------+------+------+------+------+---|
|
||||
* | | | | UP | | | | _ | | [ | ] | |
|
||||
* |------------+------+------+------+------+-------------+------+------+------+------+---|
|
||||
* | | | LEFT | DOWN | RIGHT | | | - | | [ | ] | |
|
||||
* |------------+------+------+------+------+-----+-----+------+------+------+------+-----|
|
||||
* | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 |
|
||||
* |-------+-------+-------+-------+-------+-------+------+------+------+------+------+---|
|
||||
* | RESET | | | | | | | |
|
||||
* `---------------------------------------------------------------------------------------'
|
||||
*/
|
||||
[2] = LAYOUT_2x225u(
|
||||
_______, _______, _______, KC_UP, _______, _______, _______, KC_UNDS, _______, KC_LBRC, KC_RBRC, _______,
|
||||
_______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, KC_MINS, _______, KC_LCBR, KC_RCBR, _______,
|
||||
KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,
|
||||
RESET, _______, _______, _______, _______, _______, _______, _______
|
||||
),
|
||||
};
|
||||
1
keyboards/checkerboards/quark_plus/keymaps/2x3u/config.h
Normal file
1
keyboards/checkerboards/quark_plus/keymaps/2x3u/config.h
Normal file
@@ -0,0 +1 @@
|
||||
#define TAPPING_TOGGLE 2
|
||||
82
keyboards/checkerboards/quark_plus/keymaps/2x3u/keymap.c
Normal file
82
keyboards/checkerboards/quark_plus/keymaps/2x3u/keymap.c
Normal file
@@ -0,0 +1,82 @@
|
||||
/* Copyright 2015-2017 Jack Humbert
|
||||
* Modified by Nasp for the Quark
|
||||
* 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 for task manager and such
|
||||
#define CALTDEL LCTL(LALT(KC_DEL))
|
||||
#define TSKMGR LCTL(LSFT(KC_ESC))
|
||||
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
/* [0]
|
||||
* ,-----------------------------------------------------------------------------------------.
|
||||
* |------------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | Tab | Q | W | E | R | T | Y | U | I | O | P | Del |
|
||||
* |------------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | CTL & ESC | A | S | D | F | G | H | J | K | L | ; | " |
|
||||
* |------------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | Shift | Z | X | C | V | B | N | M | , | . | / |Enter |
|
||||
* |-------+-------+-------+-------+-------+-------+------+------+------+------+------+------|
|
||||
* | PRINT | OS | Alt | Layer | Space & Layer | [ | ] | CAPS |
|
||||
* `-----------------------------------------------------------------------------------------'
|
||||
*/
|
||||
[0] = LAYOUT_2x3u(
|
||||
KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC,
|
||||
CTL_T(KC_ESC), KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT,
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT,
|
||||
KC_PSCR, KC_LGUI, KC_LALT, TT(1), LT(2, KC_SPC), KC_LBRC, KC_RBRC, KC_CAPS
|
||||
),
|
||||
|
||||
/* [1]
|
||||
* ,---------------------------------------------------------------------------------------.
|
||||
* |------------+------+------+------+------+------+------+------+------+------+------+----|
|
||||
* | ~ | ! | @ | # | $ | % | | ^ | & | * | ( | ) | BCKSPC |
|
||||
* |------------+------+------+------+------+-------------+------+------+------+------+----|
|
||||
* | \ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | / |
|
||||
* |------------+------+------+------+------+------|------+------+------+------+------+----|
|
||||
* | | | | | | | | + | = | | | |
|
||||
* |-------+-------+-------+-------+-------+-------+------+------+------+------+------+----|
|
||||
* | ESC | CTRL-ALT-DEL | TASK | | | '|' | ` | |
|
||||
* `---------------------------------------------------------------------------------------'
|
||||
*/
|
||||
[1] = LAYOUT_2x3u(
|
||||
KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC,
|
||||
KC_SLSH, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PPLS, KC_EQL, _______, _______, _______,
|
||||
KC_ESC, CALTDEL, TSKMGR, _______, _______, KC_NUBS, KC_GRV, _______
|
||||
),
|
||||
|
||||
/* [2]
|
||||
* ,---------------------------------------------------------------------------------------.
|
||||
* |------------+------+------+------+------+------+------+------+------+------+------+---|
|
||||
* | | | | UP | | | | _ | | [ | ] | |
|
||||
* |------------+------+------+------+------+-------------+------+------+------+------+---|
|
||||
* | | | LEFT | DOWN | RIGHT | | | - | | [ | ] | |
|
||||
* |------------+------+------+------+------+-----+-----+------+------+------+------+-----|
|
||||
* | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 |
|
||||
* |-------+-------+-------+-------+-------+-------+------+------+------+------+------+---|
|
||||
* | RESET | | | | | | | |
|
||||
* `---------------------------------------------------------------------------------------'
|
||||
*/
|
||||
[2] = LAYOUT_2x3u(
|
||||
_______, _______, _______, KC_UP, _______, _______, _______, KC_UNDS, _______, KC_LBRC, KC_RBRC, _______,
|
||||
_______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, KC_MINS, _______, KC_LCBR, KC_RCBR, _______,
|
||||
KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,
|
||||
RESET, _______, _______, _______, _______, _______, _______, _______
|
||||
),
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
#define TAPPING_TOGGLE 2
|
||||
82
keyboards/checkerboards/quark_plus/keymaps/default/keymap.c
Normal file
82
keyboards/checkerboards/quark_plus/keymaps/default/keymap.c
Normal file
@@ -0,0 +1,82 @@
|
||||
/* Copyright 2022 Nathan Spears
|
||||
*
|
||||
* 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 for task manager and such
|
||||
#define CALTDEL LCTL(LALT(KC_DEL))
|
||||
#define TSKMGR LCTL(LSFT(KC_ESC))
|
||||
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
/* [0]
|
||||
* ,-----------------------------------------------------------------------------------------.
|
||||
* |------------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | TAB | Q | W | E | R | T | Y | U | I | O | P | DEL |
|
||||
* |------------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | CTRL&ESC | A | S | D | F | G | H | J | K | L | ; | " |
|
||||
* |------------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | SHIFT | Z | X | C | V | B | N | M | , | . | / | ENTER |
|
||||
* |-------+-------+-------+-------+-------+-------+------+------+------+------+------+------|
|
||||
* | PRINT | Ctrl | ALT | GUI |LOWER |SPACE |SPACE|RAISE | LEFT | DOWN | UP |RIGHT |
|
||||
* `-----------------------------------------------------------------------------------------'
|
||||
*/
|
||||
[0] = LAYOUT_grid(
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL,
|
||||
CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT,
|
||||
KC_PSCR, KC_LCTL, KC_LALT, KC_LGUI, TT(1), KC_SPC, KC_SPC, TT(2), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
|
||||
),
|
||||
|
||||
/* [1]
|
||||
* ,---------------------------------------------------------------------------------------.
|
||||
* |------------+------+------+------+------+------+------+------+------+------+------+----|
|
||||
* | ~ | ! | @ | # | $ | % | | ^ | & | * | ( | ) | BCKSPC |
|
||||
* |------------+------+------+------+------+-------------+------+------+------+------+----|
|
||||
* | \ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | / |
|
||||
* |------------+------+------+------+------+------|------+------+------+------+------+----|
|
||||
* | | | | | | | | + | = | | | |
|
||||
* |-------+-------+-------+-------+-------+-------+------+------+------+------+------+----|
|
||||
* | | | ESC |CTRL-ALT-DEL|TASK| | | | | | '|' | ` | |
|
||||
* `---------------------------------------------------------------------------------------'
|
||||
*/
|
||||
[1] = LAYOUT_grid(
|
||||
KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC,
|
||||
KC_SLSH, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PPLS, KC_EQL, _______, _______, _______,
|
||||
_______, KC_ESC, CALTDEL, TSKMGR, _______, _______, _______, _______, _______, KC_NUBS, KC_GRV, _______
|
||||
),
|
||||
|
||||
/* [2]
|
||||
* ,---------------------------------------------------------------------------------------.
|
||||
* |------------+------+------+------+------+------+------+------+------+------+------+---|
|
||||
* | | | | UP | | | | _ | | [ | ] | |
|
||||
* |------------+------+------+------+------+-------------+------+------+------+------+---|
|
||||
* | | | LEFT | DOWN | RIGHT | | | - | | [ | ] | |
|
||||
* |------------+------+------+------+------+-----+-----+------+------+------+------+-----|
|
||||
* | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 |
|
||||
* |-------+-------+-------+-------+-------+-------+------+------+------+------+------+---|
|
||||
* |RESET | | | | | | | | | | | |
|
||||
* `---------------------------------------------------------------------------------------'
|
||||
*/
|
||||
[2] = LAYOUT_grid(
|
||||
_______, _______, _______, KC_UP, _______, _______, _______, KC_UNDS, _______, KC_LBRC, KC_RBRC, _______,
|
||||
_______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, KC_MINS, _______, KC_LCBR, KC_RCBR, _______,
|
||||
KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,
|
||||
RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
),
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
The Default Quark_Plus Layout
|
||||
89
keyboards/checkerboards/quark_plus/keymaps/via/keymap.c
Normal file
89
keyboards/checkerboards/quark_plus/keymaps/via/keymap.c
Normal file
@@ -0,0 +1,89 @@
|
||||
/* Copyright 2022 Nathan Spears
|
||||
*
|
||||
* 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 for task manager and such
|
||||
#define CALTDEL LCTL(LALT(KC_DEL))
|
||||
#define TSKMGR LCTL(LSFT(KC_ESC))
|
||||
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
/* [0]
|
||||
* ,-----------------------------------------------------------------------------------------.
|
||||
* |------------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | TAB | Q | W | E | R | T | Y | U | I | O | P | DEL |
|
||||
* |------------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | CTRL&ESC | A | S | D | F | G | H | J | K | L | ; | " |
|
||||
* |------------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | SHIFT | Z | X | C | V | B | N | M | , | . | / | ENTER |
|
||||
* |-------+-------+-------+-------+-------+-------+------+------+------+------+------+------|
|
||||
* | PRINT | Ctrl | ALT | GUI |LOWER |SPACE |SPACE|RAISE | LEFT | DOWN | UP |RIGHT |
|
||||
* `-----------------------------------------------------------------------------------------'
|
||||
*/
|
||||
[0] = LAYOUT_grid(
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL,
|
||||
CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT,
|
||||
KC_PSCR, KC_LCTL, KC_LALT, KC_LGUI, TT(1), KC_SPC, KC_SPC, TT(2), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
|
||||
),
|
||||
|
||||
/* [1]
|
||||
* ,---------------------------------------------------------------------------------------.
|
||||
* |------------+------+------+------+------+------+------+------+------+------+------+----|
|
||||
* | ~ | ! | @ | # | $ | % | | ^ | & | * | ( | ) | BCKSPC |
|
||||
* |------------+------+------+------+------+-------------+------+------+------+------+----|
|
||||
* | \ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | / |
|
||||
* |------------+------+------+------+------+------|------+------+------+------+------+----|
|
||||
* | | | | | | | | + | = | | | |
|
||||
* |-------+-------+-------+-------+-------+-------+------+------+------+------+------+----|
|
||||
* | | | ESC |CTRL-ALT-DEL|TASK| | | | | | '|' | ` | |
|
||||
* `---------------------------------------------------------------------------------------'
|
||||
*/
|
||||
[1] = LAYOUT_grid(
|
||||
KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC,
|
||||
KC_SLSH, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PPLS, KC_EQL, _______, _______, _______,
|
||||
_______, KC_ESC, CALTDEL, TSKMGR, _______, _______, _______, _______, _______, KC_NUBS, KC_GRV, _______
|
||||
),
|
||||
|
||||
/* [2]
|
||||
* ,---------------------------------------------------------------------------------------.
|
||||
* |------------+------+------+------+------+------+------+------+------+------+------+---|
|
||||
* | | | | UP | | | | _ | | [ | ] | |
|
||||
* |------------+------+------+------+------+-------------+------+------+------+------+---|
|
||||
* | | | LEFT | DOWN | RIGHT | | | - | | [ | ] | |
|
||||
* |------------+------+------+------+------+-----+-----+------+------+------+------+-----|
|
||||
* | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 |
|
||||
* |-------+-------+-------+-------+-------+-------+------+------+------+------+------+---|
|
||||
* |RESET | | | | | | | | | | | |
|
||||
* `---------------------------------------------------------------------------------------'
|
||||
*/
|
||||
[2] = LAYOUT_grid(
|
||||
_______, _______, _______, KC_UP, _______, _______, _______, KC_UNDS, _______, KC_LBRC, KC_RBRC, _______,
|
||||
_______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, KC_MINS, _______, KC_LCBR, KC_RCBR, _______,
|
||||
KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,
|
||||
RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
),
|
||||
|
||||
[3] = LAYOUT_grid(
|
||||
_______, _______, _______, KC_UP, _______, _______, _______, KC_UNDS, _______, KC_LBRC, KC_RBRC, _______,
|
||||
_______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, KC_MINS, _______, KC_LCBR, KC_RCBR, _______,
|
||||
KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,
|
||||
RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
),
|
||||
};
|
||||
35
keyboards/checkerboards/quark_plus/quark_plus.c
Normal file
35
keyboards/checkerboards/quark_plus/quark_plus.c
Normal file
@@ -0,0 +1,35 @@
|
||||
/* Copyright 2022 Nathan Spears
|
||||
*
|
||||
* 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 "quark_plus.h"
|
||||
|
||||
bool encoder_update_kb(uint8_t index, bool clockwise) {
|
||||
if (!encoder_update_kb(index, clockwise)) { return false; }
|
||||
if (index == 1) { /* left encoder*/
|
||||
if (clockwise){
|
||||
tap_code(KC_WH_U);
|
||||
} else {
|
||||
tap_code(KC_WH_D);
|
||||
}
|
||||
} else if (index == 0) { /* right encoder */
|
||||
if (clockwise){
|
||||
tap_code(KC_VOLU);
|
||||
} else {
|
||||
tap_code(KC_VOLD);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
82
keyboards/checkerboards/quark_plus/quark_plus.h
Normal file
82
keyboards/checkerboards/quark_plus/quark_plus.h
Normal file
@@ -0,0 +1,82 @@
|
||||
/* Copyright 2022 Nathan Spears
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "quantum.h"
|
||||
|
||||
#define XXX KC_NO
|
||||
|
||||
#define LAYOUT_grid( \
|
||||
k00, k10, k11, k01, k02, k12, k13, k03, k04, k14, k15, k05, \
|
||||
k20, k30, k31, k21, k22, k32, k33, k23, k24, k34, k35, k25, \
|
||||
k40, k50, k51, k41, k42, k52, k53, k43, k44, k54, k55, k45, \
|
||||
k60, k70, k71, k61, k62, k72, k73, k63, k64, k74, k75, k65 \
|
||||
) { \
|
||||
{ k00, k01, k02, k03, k04, k05 }, \
|
||||
{ k10, k11, k12, k13, k14, k15 }, \
|
||||
{ k20, k21, k22, k23, k24, k25 }, \
|
||||
{ k30, k31, k32, k33, k34, k35 }, \
|
||||
{ k40, k41, k42, k43, k44, k45 }, \
|
||||
{ k50, k51, k52, k53, k54, k55 }, \
|
||||
{ k60, k61, k62, k63, k64, k65 }, \
|
||||
{ k70, k71, k72, k73, k74, k75 } \
|
||||
}
|
||||
#define LAYOUT_2u( \
|
||||
k00, k10, k11, k01, k02, k12, k13, k03, k04, k14, k15, k05, \
|
||||
k20, k30, k31, k21, k22, k32, k33, k23, k24, k34, k35, k25, \
|
||||
k40, k50, k51, k41, k42, k52, k53, k43, k44, k54, k55, k45, \
|
||||
k60, k70, k71, k61, k62, k73, k63, k64, k74, k75, k65 \
|
||||
) { \
|
||||
{ k00, k01, k02, k03, k04, k05 }, \
|
||||
{ k10, k11, k12, k13, k14, k15 }, \
|
||||
{ k20, k21, k22, k23, k24, k25 }, \
|
||||
{ k30, k31, k32, k33, k34, k35 }, \
|
||||
{ k40, k41, k42, k43, k44, k45 }, \
|
||||
{ k50, k51, k52, k53, k54, k55 }, \
|
||||
{ k60, k61, k62, XXX, k64, k65 }, \
|
||||
{ k70, k71, XXX, k73, k74, k75 } \
|
||||
}
|
||||
#define LAYOUT_2x225u( \
|
||||
k00, k10, k11, k01, k02, k12, k13, k03, k04, k14, k15, k05, \
|
||||
k20, k30, k31, k21, k22, k32, k33, k23, k24, k34, k35, k25, \
|
||||
k40, k50, k51, k41, k42, k52, k53, k43, k44, k54, k55, k45, \
|
||||
k60, k70, k61, k62, k63, k64, k75, k65 \
|
||||
) { \
|
||||
{ k00, k01, k02, k03, k04, k05 }, \
|
||||
{ k10, k11, k12, k13, k14, k15 }, \
|
||||
{ k20, k21, k22, k23, k24, k25 }, \
|
||||
{ k30, k31, k32, k33, k34, k35 }, \
|
||||
{ k40, k41, k42, k43, k44, k45 }, \
|
||||
{ k50, k51, k52, k53, k54, k55 }, \
|
||||
{ k60, k61, k62, k63, k64, k65 }, \
|
||||
{ k70, XXX, XXX, XXX, XXX, k75 } \
|
||||
}
|
||||
#define LAYOUT_2x3u( \
|
||||
k00, k10, k11, k01, k02, k12, k13, k03, k04, k14, k15, k05, \
|
||||
k20, k30, k31, k21, k22, k32, k33, k23, k24, k34, k35, k25, \
|
||||
k40, k50, k51, k41, k42, k52, k53, k43, k44, k54, k55, k45, \
|
||||
k60, k70, k71, k62, k63, k74, k75, k65 \
|
||||
) { \
|
||||
{ k00, k01, k02, k03, k04, k05 }, \
|
||||
{ k10, k11, k12, k13, k14, k15 }, \
|
||||
{ k20, k21, k22, k23, k24, k25 }, \
|
||||
{ k30, k31, k32, k33, k34, k35 }, \
|
||||
{ k40, k41, k42, k43, k44, k45 }, \
|
||||
{ k50, k51, k52, k53, k54, k55 }, \
|
||||
{ k60, XXX, k62, k63, XXX, k65 }, \
|
||||
{ k70, k71, XXX, XXX, k74, k75 } \
|
||||
}
|
||||
17
keyboards/checkerboards/quark_plus/readme.md
Normal file
17
keyboards/checkerboards/quark_plus/readme.md
Normal file
@@ -0,0 +1,17 @@
|
||||
# Quark_Plus
|
||||
|
||||

|
||||
|
||||
The Quark Plus is a premium Quark for those that want more features of the original. It features support for 4 rotary encoders (it is recommended to use 1 per left and right side), LED backlighting, RGB underglow, JST connector, and compatibility for earlier revisions of your favorite ortholinear keyboard.
|
||||
|
||||
* Keyboard Maintainer: [Nasp](https://github.com/npspears)
|
||||
* Hardware Supported: Quark_Plus
|
||||
* Hardware Availability: https://www.checkerboards.xyz
|
||||
|
||||
Make example for this keyboard (after setting up your build environment):
|
||||
|
||||
make checkerboards/quark_plus:default
|
||||
|
||||
To enter the bootloader, press the hardware button on the back of the PCB just to the left of the USB connector.
|
||||
|
||||
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).
|
||||
20
keyboards/checkerboards/quark_plus/rules.mk
Normal file
20
keyboards/checkerboards/quark_plus/rules.mk
Normal file
@@ -0,0 +1,20 @@
|
||||
# MCU name
|
||||
MCU = atmega32u2
|
||||
|
||||
# Bootloader selection
|
||||
BOOTLOADER = atmel-dfu
|
||||
|
||||
# Build Options
|
||||
# change yes to no to disable
|
||||
#
|
||||
BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite
|
||||
MOUSEKEY_ENABLE = yes # Mouse keys
|
||||
EXTRAKEY_ENABLE = yes # Audio control and System control
|
||||
CONSOLE_ENABLE = no # Console for debug
|
||||
COMMAND_ENABLE = no # Commands for debug and configuration
|
||||
NKRO_ENABLE = no # Enable N-Key Rollover
|
||||
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
|
||||
BACKLIGHT_DRIVER = pwm # Valid driver values are pwm, software, custom or no
|
||||
RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
|
||||
AUDIO_ENABLE = no # Audio output
|
||||
ENCODER_ENABLE = yes # Enable rotary encoder
|
||||
@@ -27,7 +27,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row))
|
||||
#define print_matrix_header() print("\nr/c 01234567\n")
|
||||
#define matrix_bitpop(i) bitpop(matrix[i])
|
||||
#define ROW_SHIFTER ((uint8_t)1)
|
||||
|
||||
|
||||
|
||||
@@ -379,12 +379,3 @@ void matrix_print(void)
|
||||
print("\n");
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t matrix_key_count(void)
|
||||
{
|
||||
uint8_t count = 0;
|
||||
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
|
||||
count += bitpop(matrix[i]);
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
@@ -179,12 +179,3 @@ void matrix_print(void)
|
||||
print("\n");
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t matrix_key_count(void)
|
||||
{
|
||||
uint8_t count = 0;
|
||||
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
|
||||
count += bitpop(matrix[i]);
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
@@ -225,18 +225,6 @@ extern "C"
|
||||
return row_bits;
|
||||
}
|
||||
|
||||
uint8_t matrix_key_count(void) {
|
||||
uint8_t count = 0;
|
||||
|
||||
count += bitpop(local_keyboard_report.mods);
|
||||
for (uint8_t i = 0; i < KEYBOARD_REPORT_KEYS; i++) {
|
||||
if (IS_ANY(local_keyboard_report.keys[i])) {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
void matrix_print(void) {
|
||||
print("\nr/c 0123456789ABCDEF\n");
|
||||
for (uint8_t row = 0; row < matrix_rows(); row++) {
|
||||
|
||||
24
keyboards/crkbd/keymaps/jpe230/config.h
Normal file
24
keyboards/crkbd/keymaps/jpe230/config.h
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
This is the c configuration file for the keymap
|
||||
|
||||
Copyright 2012 Jun Wako <wakojun@gmail.com>
|
||||
Copyright 2015 Jack Humbert
|
||||
Copyright 2022 Jose Pablo Ramirez <jp.ramangulo@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#define SPLIT_WPM_ENABLE
|
||||
399
keyboards/crkbd/keymaps/jpe230/keymap.c
Normal file
399
keyboards/crkbd/keymaps/jpe230/keymap.c
Normal file
@@ -0,0 +1,399 @@
|
||||
/*
|
||||
Copyright 2019 @foostan
|
||||
Copyright 2020 Drashna Jaelre <@drashna>
|
||||
Copyright 2022 Jose Pablo Ramirez <jp.ramangulo@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
#ifdef VIA_ENABLE
|
||||
#define USER_START USER00
|
||||
#else
|
||||
#define USER_START SAFE_RANGE
|
||||
#endif
|
||||
|
||||
// Keycode to toggle Sarcasm Mode
|
||||
enum custom_keycodes {
|
||||
KC_SCASM = USER_START
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[0] = LAYOUT_split_3x6_3(
|
||||
//,-----------------------------------------------------. ,-----------------------------------------------------.
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
|
||||
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
|
||||
KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
|
||||
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ESC,
|
||||
//|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
|
||||
KC_LGUI, MO(1), KC_ENT, KC_SPC, MO(2), KC_RALT
|
||||
//`--------------------------' `--------------------------'
|
||||
|
||||
),
|
||||
|
||||
[1] = LAYOUT_split_3x6_3(
|
||||
//,-----------------------------------------------------. ,-----------------------------------------------------.
|
||||
KC_TAB, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,
|
||||
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
|
||||
KC_CAPS, _______, _______, _______, _______, _______, _______, KC_UP, _______, _______, _______, _______,
|
||||
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
|
||||
KC_LSFT, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN,KC_RIGHT, _______, _______, _______,
|
||||
//|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
|
||||
KC_LGUI, _______, _______, _______, MO(3), KC_RALT
|
||||
//`--------------------------' `--------------------------'
|
||||
),
|
||||
|
||||
[2] = LAYOUT_split_3x6_3(
|
||||
//,-----------------------------------------------------. ,-----------------------------------------------------.
|
||||
KC_TAB, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC,
|
||||
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
|
||||
KC_CAPS, _______, _______, _______, _______, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, KC_GRV,
|
||||
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
|
||||
KC_LSFT, _______, _______, _______, _______, _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, KC_TILD,
|
||||
//|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
|
||||
KC_LGUI, MO(3), _______, TG(3), _______, KC_RALT
|
||||
//`--------------------------' `--------------------------'
|
||||
),
|
||||
|
||||
[3] = LAYOUT_split_3x6_3(
|
||||
//,-----------------------------------------------------. ,-----------------------------------------------------.
|
||||
KC_MUTE, KC_WBAK, KC_WFWD, KC_F7, KC_F8, KC_F9, _______, KC_7, KC_8, KC_9, _______, RESET,
|
||||
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
|
||||
KC_VOLU, _______, KC_MNXT, KC_F6, KC_F5, KC_F6, _______, KC_6, KC_5, KC_4, _______, _______,
|
||||
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
|
||||
KC_VOLD, KC_MPRV, KC_MNXT, KC_F1, KC_F2, KC_F3, _______, KC_1, KC_2, KC_3, _______, _______,
|
||||
//|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------|
|
||||
KC_LGUI, _______,KC_SCASM, TG(3), _______, KC_RALT
|
||||
//`--------------------------' `--------------------------'
|
||||
)
|
||||
};
|
||||
|
||||
#ifdef OLED_ENABLE
|
||||
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
||||
return rotation;
|
||||
}
|
||||
|
||||
#define L_BASE 0
|
||||
#define L_LOWER 2
|
||||
#define L_RAISE 4
|
||||
#define L_ADJUST 8
|
||||
|
||||
void oled_render_layer_state(void) {
|
||||
oled_write_P(PSTR("Layer: "), false);
|
||||
switch (layer_state) {
|
||||
case L_BASE:
|
||||
oled_write_ln_P(PSTR("Default"), false);
|
||||
break;
|
||||
case L_LOWER:
|
||||
oled_write_ln_P(PSTR("Lower"), false);
|
||||
break;
|
||||
case L_RAISE:
|
||||
oled_write_ln_P(PSTR("Raise"), false);
|
||||
break;
|
||||
case L_ADJUST:
|
||||
case L_ADJUST|L_LOWER:
|
||||
case L_ADJUST|L_RAISE:
|
||||
case L_ADJUST|L_LOWER|L_RAISE:
|
||||
oled_write_ln_P(PSTR("Adjust"), false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static char logged_char = ' ';
|
||||
static uint8_t logged_row = 0, logged_col = 0;
|
||||
static uint16_t logged_keycode = 0;
|
||||
|
||||
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) {
|
||||
if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) ||
|
||||
(keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX)) { keycode = keycode & 0xFF; }
|
||||
if (keycode < 60) {
|
||||
logged_char = code_to_name[keycode];
|
||||
}
|
||||
|
||||
// update keylog
|
||||
logged_row = record->event.key.row;
|
||||
logged_col = record->event.key.col;
|
||||
logged_keycode = keycode;
|
||||
}
|
||||
|
||||
void oled_render_keylog(void) {
|
||||
oled_write(get_u8_str(logged_row, '0'), false);
|
||||
oled_write_P(PSTR(":"), false);
|
||||
oled_write(get_u8_str(logged_col, '0'), false);
|
||||
oled_write_P(PSTR(", "), false);
|
||||
oled_write(get_u16_str(logged_keycode, ' '), false);
|
||||
oled_write_P(PSTR(" : "), false);
|
||||
oled_write((const char *)&logged_char, false);
|
||||
}
|
||||
|
||||
void render_bootmagic_status(bool status) {
|
||||
/* Show Ctrl-Gui Swap options */
|
||||
static const char PROGMEM logo[][2][3] = {
|
||||
{{0x97, 0x98, 0}, {0xb7, 0xb8, 0}},
|
||||
{{0x95, 0x96, 0}, {0xb5, 0xb6, 0}},
|
||||
};
|
||||
if (status) {
|
||||
oled_write_ln_P(logo[0][0], false);
|
||||
oled_write_ln_P(logo[0][1], false);
|
||||
} else {
|
||||
oled_write_ln_P(logo[1][0], false);
|
||||
oled_write_ln_P(logo[1][1], false);
|
||||
}
|
||||
}
|
||||
|
||||
// frame 0, 128x32px
|
||||
const char PROGMEM cat_frame_0 [] PROGMEM = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0xc0, 0xc0,
|
||||
0x60, 0x60, 0x60, 0x60, 0x40, 0x40, 0xc0, 0xc0, 0xc0, 0x70, 0x38, 0x18, 0xec, 0x3c, 0x02, 0x02,
|
||||
0x7a, 0x7a, 0xf2, 0xf2, 0x06, 0x04, 0x04, 0x0c, 0x0e, 0x0a, 0x1f, 0xfd, 0xf9, 0x39, 0x0f, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0xff, 0xff, 0x03, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xfc, 0xff, 0x01, 0x08, 0x3c, 0x00,
|
||||
0x00, 0x18, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x83, 0x7e, 0x00, 0x00,
|
||||
0x00, 0x00, 0xc0, 0xe0, 0xf0, 0xf8, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0xf0, 0xff, 0xff, 0x80, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x87, 0x83, 0xc0, 0x80, 0x88,
|
||||
0x1e, 0x1e, 0x0f, 0x00, 0x80, 0x80, 0x80, 0x40, 0x40, 0xc0, 0xe0, 0xfe, 0x87, 0xbe, 0xf0, 0x00,
|
||||
0x00, 0x00, 0x00, 0x01, 0x03, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x07, 0x0f,
|
||||
0x12, 0x34, 0x34, 0x34, 0x34, 0x1e, 0x0e, 0x06, 0x03, 0x03, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
};
|
||||
// frame 1, 128x32px
|
||||
const char PROGMEM cat_frame_1 [] PROGMEM = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xc0, 0xc0, 0x60,
|
||||
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x60, 0x60, 0xe0, 0xf0, 0x90,
|
||||
0x18, 0x08, 0x08, 0x88, 0x88, 0x98, 0x10, 0x10, 0x30, 0x30, 0x70, 0xf8, 0x08, 0x88, 0xf8, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x07, 0xff, 0xff, 0x01, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xe0, 0x04, 0x06, 0x07, 0x03, 0x01,
|
||||
0xc0, 0x00, 0x00, 0x87, 0x87, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x1f, 0xf0, 0x00,
|
||||
0x00, 0x00, 0xc0, 0xe0, 0xf0, 0xf0, 0xf0, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0xf8, 0xff, 0xff, 0xc0, 0x80,
|
||||
0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x07, 0x10, 0x30, 0xf0, 0xe0, 0x00,
|
||||
0x01, 0x00, 0x60, 0xf0, 0xf0, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xe0, 0xfc, 0xc7, 0x00,
|
||||
0x00, 0x00, 0x00, 0x01, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x03, 0x02, 0x06,
|
||||
0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x06, 0x02, 0x02, 0x07, 0x07, 0x07, 0x04, 0x07, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
};
|
||||
// frame 2, 128x32px
|
||||
const char PROGMEM cat_frame_2 [] PROGMEM = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xc0, 0x60, 0x30,
|
||||
0x38, 0x18, 0x18, 0x18, 0x18, 0x30, 0x30, 0x30, 0x78, 0x48, 0x78, 0xc0, 0x80, 0xc0, 0x40, 0x40,
|
||||
0x40, 0x40, 0xc0, 0xc0, 0x80, 0x80, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0x03, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x20, 0xf0, 0x80, 0x80, 0x60, 0x18, 0x00, 0x00, 0x00, 0x01, 0x00, 0x1c, 0x3c,
|
||||
0x7c, 0x38, 0x00, 0x00, 0x00, 0x01, 0x01, 0x07, 0x06, 0x3c, 0xff, 0xc3, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0xe0, 0xe0, 0xf0, 0xf0, 0xf0, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0xff, 0xff, 0xf0, 0x80, 0x00,
|
||||
0x00, 0x80, 0x80, 0x80, 0x00, 0x01, 0x00, 0x1e, 0x7f, 0xc0, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x0c,
|
||||
0x8c, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x7f, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x01, 0x03, 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
|
||||
0x01, 0x01, 0x00, 0x01, 0x01, 0x0f, 0x18, 0x10, 0x18, 0x0f, 0x0e, 0x18, 0x10, 0x30, 0x27, 0x2f,
|
||||
0x2f, 0x27, 0x20, 0x30, 0x10, 0x10, 0x10, 0x30, 0x3c, 0x2d, 0x27, 0x3c, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
};
|
||||
|
||||
const char* cat_frames[3] = {
|
||||
cat_frame_0,
|
||||
cat_frame_1,
|
||||
cat_frame_2
|
||||
};
|
||||
|
||||
#define FRAME_SIZE 528
|
||||
|
||||
static int current_frame = 0;
|
||||
static uint32_t frame_timer = 0;
|
||||
static uint32_t anim_sleep = 0;
|
||||
static uint8_t anim_speed = 120;
|
||||
|
||||
void oled_render_logo(void) {
|
||||
|
||||
if(get_current_wpm() != 000) {
|
||||
oled_on();
|
||||
int8_t wpm_speed = (int8_t)(get_current_wpm() / 2);
|
||||
if(wpm_speed < 100)
|
||||
{
|
||||
anim_speed = 120 - wpm_speed;
|
||||
}
|
||||
if(timer_elapsed32(frame_timer) > anim_speed) {
|
||||
frame_timer = timer_read32(); // resets timer
|
||||
current_frame = (current_frame + 1) % 3;
|
||||
}
|
||||
oled_write_raw_P(cat_frames[current_frame], FRAME_SIZE);
|
||||
anim_sleep = timer_read32();
|
||||
} else {
|
||||
anim_speed = 150;
|
||||
if(timer_elapsed32(anim_sleep) > OLED_TIMEOUT) {
|
||||
oled_off();
|
||||
} else {
|
||||
if(timer_elapsed32(frame_timer) > anim_speed) {
|
||||
frame_timer = timer_read32(); // resets timer
|
||||
current_frame = (current_frame + 1) % 3;
|
||||
}
|
||||
oled_write_raw_P(cat_frames[current_frame], FRAME_SIZE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool oled_task_user(void) {
|
||||
if (is_keyboard_master()) {
|
||||
oled_render_layer_state();
|
||||
oled_render_keylog();
|
||||
} else {
|
||||
oled_render_logo();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif // OLED_ENABLE
|
||||
|
||||
// saRcASm MOde
|
||||
bool tog_sarcasm = false;
|
||||
bool uppercase = false;
|
||||
uint8_t prev_upper = 0;
|
||||
uint8_t prev_lower = 0;
|
||||
|
||||
bool process_record_sarcasm(uint16_t keycode, keyrecord_t *record) {
|
||||
if (keycode == KC_ENTER && record->event.pressed) {
|
||||
uppercase = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (uppercase == false && record->event.pressed) { // Dont start with an uppercase letter on new line
|
||||
uppercase = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
if((KC_A <= keycode) && (keycode <= KC_Z)) {
|
||||
if ( record->event.pressed ) {
|
||||
bool press = rand() % 2;
|
||||
|
||||
if (prev_upper > 2) { // if more than 3 lower's in a row print upper
|
||||
prev_upper = 0;
|
||||
press = false;
|
||||
} else if (prev_lower > 2) { // if more than 3 upper's in a row print lower
|
||||
prev_lower = 0;
|
||||
press = true;
|
||||
}
|
||||
if (press) {
|
||||
prev_upper++;
|
||||
tap_code16(S(keycode));
|
||||
clear_mods();
|
||||
} else {
|
||||
prev_lower++;
|
||||
tap_code16(keycode);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
|
||||
#ifdef OLED_ENABLE
|
||||
if (record->event.pressed) {
|
||||
set_keylog(keycode, record);
|
||||
}
|
||||
#endif
|
||||
|
||||
switch (keycode) {
|
||||
case KC_SCASM:
|
||||
if (record->event.pressed) {
|
||||
tog_sarcasm = !tog_sarcasm;
|
||||
|
||||
if (tog_sarcasm)
|
||||
dprint("Enabling saRCaSm ModE\n");
|
||||
else
|
||||
dprint("Disabling saRCaSm ModE\n");
|
||||
|
||||
uppercase = false;
|
||||
prev_upper = 0;
|
||||
prev_lower = 0;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
if (tog_sarcasm) {
|
||||
return process_record_sarcasm(keycode, record);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
15
keyboards/crkbd/keymaps/jpe230/readme.md
Normal file
15
keyboards/crkbd/keymaps/jpe230/readme.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# Jpe230's CRKBD Layout
|
||||
|
||||
## Layers
|
||||
The four layers:
|
||||
- BASE Layer: QWERTY
|
||||
- LOWER Layer: Numbers + Arrows
|
||||
- RAISE Layer: Symbols
|
||||
- ADJUST Layer: Numpad + Media Keys + Fn keys
|
||||
|
||||
## OLED
|
||||
-Master: Renders layer state + keylog
|
||||
-Slave : Renders an animation of a cat that varies its animation speed based on the current WPM
|
||||
|
||||
## Flashing
|
||||
Flash using `qmk compile -kb crkbd -km jpe230` for Pro Micro
|
||||
6
keyboards/crkbd/keymaps/jpe230/rules.mk
Normal file
6
keyboards/crkbd/keymaps/jpe230/rules.mk
Normal file
@@ -0,0 +1,6 @@
|
||||
MOUSEKEY_ENABLE = yes
|
||||
OLED_ENABLE = yes
|
||||
OLED_DRIVER = SSD1306
|
||||
LTO_ENABLE = yes
|
||||
WPM_ENABLE = yes
|
||||
VIA_ENABLE = yes
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright 2020 Koobaczech
|
||||
Copyright 2022 Cutie Club
|
||||
|
||||
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
|
||||
@@ -20,11 +20,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#include "config_common.h"
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define VENDOR_ID 0x6963
|
||||
#define PRODUCT_ID 0x6963
|
||||
#define DEVICE_VER 0x0002
|
||||
#define MANUFACTURER Koobaczech
|
||||
#define PRODUCT Pandora
|
||||
#define VENDOR_ID 0xFB9C
|
||||
#define PRODUCT_ID 0x3F42
|
||||
#define DEVICE_VER 0x0001
|
||||
#define MANUFACTURER Cutie Club
|
||||
#define PRODUCT Novus
|
||||
|
||||
/* key matrix size */
|
||||
#define MATRIX_ROWS 5
|
||||
@@ -40,44 +40,17 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
|
||||
*
|
||||
*/
|
||||
#define MATRIX_ROW_PINS { B4, D7, D6, B3, B0 }
|
||||
#define MATRIX_COL_PINS { D2, D1, D0, D3, D5, B5, B6, B7, D4, C6, C7, F0, F1, F4, F7 }
|
||||
#define MATRIX_ROW_PINS { F0, F1, F4, F5, F6 }
|
||||
#define MATRIX_COL_PINS { B6, C6, C7, B2, B3, D0, D1, D2, D3, D7, B4, B5, D5, D4, D6 }
|
||||
#define UNUSED_PINS
|
||||
|
||||
/* COL2ROW, ROW2COL*/
|
||||
/* COL2ROW, ROW2COL */
|
||||
#define DIODE_DIRECTION COL2ROW
|
||||
|
||||
#define LED_CAPS_LOCK_PIN E6
|
||||
#define LED_PIN_ON_STATE 0
|
||||
|
||||
/* Encoder Function */
|
||||
#define ENCODERS_PAD_A { F6 }
|
||||
#define ENCODERS_PAD_B { F5 }
|
||||
//#define ENCODER_DIRECTION_FLIP
|
||||
#define ENCODER_RESOLUTION 1
|
||||
#define DIP_SWITCH_PINS { B2, B5 }
|
||||
|
||||
//#define BACKLIGHT_PIN
|
||||
//#define BACKLIGHT_LEVELS 5
|
||||
// #define BACKLIGHT_BREATHING
|
||||
|
||||
/*== all animations enabled ==*/
|
||||
/* If RGBLIGHT_SLEEP defined, the RGB lighting will be switched off when the host goes to sleep */
|
||||
#define RGB_DI_PIN B1
|
||||
#ifdef RGB_DI_PIN
|
||||
# define RGBLIGHT_ANIMATIONS
|
||||
# define RGBLED_NUM 12
|
||||
# define RGBLIGHT_HUE_STEP 8
|
||||
# define RGBLIGHT_SAT_STEP 8
|
||||
# define RGBLIGHT_VAL_STEP 8
|
||||
# define RGBLIGHT_SLEEP
|
||||
#endif
|
||||
|
||||
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
|
||||
#define DEBOUNCE 0
|
||||
#define DEBOUNCE 5
|
||||
|
||||
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
||||
#define LOCKING_SUPPORT_ENABLE
|
||||
|
||||
/* Locking resynchronize hack */
|
||||
#define LOCKING_RESYNC_ENABLE
|
||||
277
keyboards/cutie_club/novus/info.json
Normal file
277
keyboards/cutie_club/novus/info.json
Normal file
@@ -0,0 +1,277 @@
|
||||
{
|
||||
"keyboard_name": "Novus",
|
||||
"url": "",
|
||||
"maintainer": "Cutie Club",
|
||||
"layouts": {
|
||||
"LAYOUT_all": {
|
||||
"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": 0,
|
||||
"y": 1,
|
||||
"w": 1.5
|
||||
},
|
||||
{
|
||||
"x": 1.5,
|
||||
"y": 1
|
||||
},
|
||||
{
|
||||
"x": 2.5,
|
||||
"y": 1
|
||||
},
|
||||
{
|
||||
"x": 3.5,
|
||||
"y": 1
|
||||
},
|
||||
{
|
||||
"x": 4.5,
|
||||
"y": 1
|
||||
},
|
||||
{
|
||||
"x": 5.5,
|
||||
"y": 1
|
||||
},
|
||||
{
|
||||
"x": 6.5,
|
||||
"y": 1
|
||||
},
|
||||
{
|
||||
"x": 7.5,
|
||||
"y": 1
|
||||
},
|
||||
{
|
||||
"x": 8.5,
|
||||
"y": 1
|
||||
},
|
||||
{
|
||||
"x": 9.5,
|
||||
"y": 1
|
||||
},
|
||||
{
|
||||
"x": 10.5,
|
||||
"y": 1
|
||||
},
|
||||
{
|
||||
"x": 11.5,
|
||||
"y": 1
|
||||
},
|
||||
{
|
||||
"x": 12.5,
|
||||
"y": 1
|
||||
},
|
||||
{
|
||||
"x": 13.5,
|
||||
"y": 1,
|
||||
"w": 1.5
|
||||
},
|
||||
{
|
||||
"x": 0,
|
||||
"y": 2,
|
||||
"w": 1.75
|
||||
},
|
||||
{
|
||||
"x": 1.75,
|
||||
"y": 2
|
||||
},
|
||||
{
|
||||
"x": 2.75,
|
||||
"y": 2
|
||||
},
|
||||
{
|
||||
"x": 3.75,
|
||||
"y": 2
|
||||
},
|
||||
{
|
||||
"x": 4.75,
|
||||
"y": 2
|
||||
},
|
||||
{
|
||||
"x": 5.75,
|
||||
"y": 2
|
||||
},
|
||||
{
|
||||
"x": 6.75,
|
||||
"y": 2
|
||||
},
|
||||
{
|
||||
"x": 7.75,
|
||||
"y": 2
|
||||
},
|
||||
{
|
||||
"x": 8.75,
|
||||
"y": 2
|
||||
},
|
||||
{
|
||||
"x": 9.75,
|
||||
"y": 2
|
||||
},
|
||||
{
|
||||
"x": 10.75,
|
||||
"y": 2
|
||||
},
|
||||
{
|
||||
"x": 11.75,
|
||||
"y": 2
|
||||
},
|
||||
{
|
||||
"x": 12.75,
|
||||
"y": 2,
|
||||
"w": 2.25
|
||||
},
|
||||
{
|
||||
"x": 0,
|
||||
"y": 3,
|
||||
"w": 2.25
|
||||
},
|
||||
{
|
||||
"x": 2.25,
|
||||
"y": 3
|
||||
},
|
||||
{
|
||||
"x": 3.25,
|
||||
"y": 3
|
||||
},
|
||||
{
|
||||
"x": 4.25,
|
||||
"y": 3
|
||||
},
|
||||
{
|
||||
"x": 5.25,
|
||||
"y": 3
|
||||
},
|
||||
{
|
||||
"x": 6.25,
|
||||
"y": 3
|
||||
},
|
||||
{
|
||||
"x": 7.25,
|
||||
"y": 3
|
||||
},
|
||||
{
|
||||
"x": 8.25,
|
||||
"y": 3
|
||||
},
|
||||
{
|
||||
"x": 9.25,
|
||||
"y": 3
|
||||
},
|
||||
{
|
||||
"x": 10.25,
|
||||
"y": 3
|
||||
},
|
||||
{
|
||||
"x": 11.25,
|
||||
"y": 3
|
||||
},
|
||||
{
|
||||
"x": 12.25,
|
||||
"y": 3,
|
||||
"w": 1.75
|
||||
},
|
||||
{
|
||||
"x": 14,
|
||||
"y": 3
|
||||
},
|
||||
{
|
||||
"x": 0,
|
||||
"y": 4,
|
||||
"w": 1.25
|
||||
},
|
||||
{
|
||||
"x": 1.25,
|
||||
"y": 4,
|
||||
"w": 1.25
|
||||
},
|
||||
{
|
||||
"x": 2.5,
|
||||
"y": 4,
|
||||
"w": 1.25
|
||||
},
|
||||
{
|
||||
"x": 3.75,
|
||||
"y": 4,
|
||||
"w": 6.25
|
||||
},
|
||||
{
|
||||
"x": 10,
|
||||
"y": 4,
|
||||
"w": 1.25
|
||||
},
|
||||
{
|
||||
"x": 11.25,
|
||||
"y": 4,
|
||||
"w": 1.25
|
||||
},
|
||||
{
|
||||
"x": 12.5,
|
||||
"y": 4,
|
||||
"w": 1.25
|
||||
},
|
||||
{
|
||||
"x": 13.75,
|
||||
"y": 4,
|
||||
"w": 1.25
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
33
keyboards/cutie_club/novus/keymaps/default/keymap.c
Normal file
33
keyboards/cutie_club/novus/keymaps/default/keymap.c
Normal file
@@ -0,0 +1,33 @@
|
||||
/* Copyright 2022 Cutie Club
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[0] = LAYOUT_all(
|
||||
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, 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, MO(1),
|
||||
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTRL
|
||||
),
|
||||
[1] = LAYOUT_all(
|
||||
KC_GRV, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______
|
||||
)
|
||||
};
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user