Compare commits
27 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0a7efccdc6 | ||
|
|
63f5473792 | ||
|
|
4987042369 | ||
|
|
0cc94ca264 | ||
|
|
fed08eb772 | ||
|
|
9a2a79bac8 | ||
|
|
3e7b4a15af | ||
|
|
d16568eca9 | ||
|
|
beaf774a81 | ||
|
|
e0f94480d1 | ||
|
|
65fef7ef92 | ||
|
|
53f13eda42 | ||
|
|
ba4a599f13 | ||
|
|
973e3a7849 | ||
|
|
738efb2529 | ||
|
|
dcdc2e4924 | ||
|
|
44370bc35b | ||
|
|
f8c07e05c2 | ||
|
|
255173f379 | ||
|
|
faab245ed4 | ||
|
|
60433d71a1 | ||
|
|
45f1fccd3b | ||
|
|
d9ef323f8a | ||
|
|
57b21c037c | ||
|
|
fd3c1aa909 | ||
|
|
3d50a2867b | ||
|
|
0836e47e33 |
@@ -13,9 +13,9 @@ Note: These programs are not provided by or endorsed by QMK.
|
||||
* [Keyboard Tester](http://www.keyboardtester.com) (Web Based)
|
||||
* [Keyboard Checker](http://keyboardchecker.com) (Web Based)
|
||||
|
||||
## Debugging
|
||||
## Debugging With QMK Toolbox
|
||||
|
||||
Your keyboard will output debug information if you have `CONSOLE_ENABLE = yes` in your `rules.mk`. By default the output is very limited, but you can turn on debug mode to increase the amount of debug output. Use the `DEBUG` keycode in your keymap, use the [Command](feature_command.md) feature to enable debug mode, or add the following code to your keymap.
|
||||
[QMK Toolbox](https://github.com/qmk/qmk_toolbox) will show messages from your keyboard if you have `CONSOLE_ENABLE = yes` in your `rules.mk`. By default the output is very limited, but you can turn on debug mode to increase the amount of debug output. Use the `DEBUG` keycode in your keymap, use the [Command](feature_command.md) feature to enable debug mode, or add the following code to your keymap.
|
||||
|
||||
```c
|
||||
void keyboard_post_init_user(void) {
|
||||
@@ -27,14 +27,6 @@ void keyboard_post_init_user(void) {
|
||||
}
|
||||
```
|
||||
|
||||
### Debugging With QMK Toolbox
|
||||
|
||||
For compatible platforms, [QMK Toolbox](https://github.com/qmk/qmk_toolbox) can be used to display debug messages from your keyboard.
|
||||
|
||||
### Debugging With hid_listen
|
||||
|
||||
Prefer a terminal based solution? [hid_listen](https://www.pjrc.com/teensy/hid_listen.html), provided by PJRC, can also be used to display debug messages. Prebuilt binaries for Windows,Linux,and MacOS are available.
|
||||
|
||||
<!-- FIXME: Describe the debugging messages here. -->
|
||||
|
||||
## Sending Your Own Debug Messages
|
||||
@@ -49,51 +41,3 @@ After that you can use a few different print functions:
|
||||
* `uprintf("%s string", var)`: Print a formatted string
|
||||
* `dprint("string")` Print a simple string, but only when debug mode is enabled
|
||||
* `dprintf("%s string", var)`: Print a formatted string, but only when debug mode is enabled
|
||||
|
||||
## Debug Examples
|
||||
|
||||
Below is a collection of real world debugging examples. For additional information, refer to [Debugging/Troubleshooting QMK](faq_debug.md).
|
||||
|
||||
### Which matrix position is this keypress?
|
||||
|
||||
When porting, or when attempting to diagnose pcb issues, it can be useful to know if a keypress is scanned correctly. To enable logging for this scenario, add the following code to your keymaps `keymap.c`
|
||||
|
||||
```c
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
// If console is enabled, it will print the matrix position and status of each key pressed
|
||||
#ifdef CONSOLE_ENABLE
|
||||
uprintf("KL: kc: %u, col: %u, row: %u, pressed: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed);
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
```
|
||||
|
||||
Example output
|
||||
```text
|
||||
Waiting for device:.......
|
||||
Listening:
|
||||
KL: kc: 169, col: 0, row: 0, pressed: 1
|
||||
KL: kc: 169, col: 0, row: 0, pressed: 0
|
||||
KL: kc: 174, col: 1, row: 0, pressed: 1
|
||||
KL: kc: 174, col: 1, row: 0, pressed: 0
|
||||
KL: kc: 172, col: 2, row: 0, pressed: 1
|
||||
KL: kc: 172, col: 2, row: 0, pressed: 0
|
||||
```
|
||||
|
||||
### How long did it take to scan for a keypress?
|
||||
|
||||
When testing performance issues, it can be useful to know the frequency at which the switch matrix is being scanned. To enable logging for this scenario, add the following code to your keymaps `config.h`
|
||||
|
||||
```c
|
||||
#define DEBUG_MATRIX_SCAN_RATE
|
||||
```
|
||||
|
||||
Example output
|
||||
```text
|
||||
> matrix scan frequency: 315
|
||||
> matrix scan frequency: 313
|
||||
> matrix scan frequency: 316
|
||||
> matrix scan frequency: 316
|
||||
> matrix scan frequency: 316
|
||||
> matrix scan frequency: 316
|
||||
```
|
||||
|
||||
@@ -92,6 +92,10 @@ i2c_status_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16
|
||||
return chibios_to_qmk(&status);
|
||||
}
|
||||
|
||||
i2c_status_t i2c_transmit_receive(uint8_t address, uint8_t * tx_body, uint16_t tx_length, uint8_t * rx_body, uint16_t rx_length) {
|
||||
return i2cMasterTransmitTimeout(&I2C_DRIVER, address/2, tx_body, tx_length, rx_body, rx_length, MS2ST(100));
|
||||
}
|
||||
|
||||
i2c_status_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, const uint8_t* data, uint16_t length, uint16_t timeout)
|
||||
{
|
||||
i2c_address = devaddr;
|
||||
|
||||
@@ -386,31 +386,4 @@
|
||||
{ k40, k41, KC_NO, k43, KC_NO, KC_NO, k46, KC_NO, KC_NO, KC_NO, KC_NO, k4b, KC_NO, k4d, k4e } \
|
||||
}
|
||||
|
||||
/* LAYOUT_60_iso_split_space_bs_rshift
|
||||
* ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐
|
||||
* │00 │01 │02 │03 │04 │05 │06 │07 │08 │09 │0a │0b │0c │0d │0e │
|
||||
* ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤
|
||||
* │10 │12 │13 │14 │15 │16 │17 │18 │19 │1a │1b │1c │1d │ │
|
||||
* ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐2d │
|
||||
* │20 │22 │23 │24 │25 │26 │27 │28 │29 │2a │2b │2c │1e │ │
|
||||
* ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴┬───┤
|
||||
* │30 |31 │32 │33 │34 │35 │36 │37 │38 │39 │3a │3b │3d │3e │
|
||||
* ├────┼───┴┬──┴─┬─┴───┴──┬┴───┼───┴───┴──┬┴───┼───┴┬────┬┴───┤
|
||||
* │40 │41 │43 │44 │46 │48 │4a │4b │4d │4e │
|
||||
* └────┴────┴────┴────────┴────┴──────────┴────┴────┴────┴────┘
|
||||
*/
|
||||
#define LAYOUT_60_iso_split_space_bs_rshift( \
|
||||
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, \
|
||||
k10, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, \
|
||||
k20, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k1e, k2d, \
|
||||
k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3d, k3e, \
|
||||
k40, k41, k43, k44, k46, k48, k4a, k4b, k4c, k4d, k4e \
|
||||
) { \
|
||||
{ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e }, \
|
||||
{ k10, KC_NO, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e }, \
|
||||
{ k20, KC_NO, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, KC_NO }, \
|
||||
{ k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, KC_NO,k3d, k3e }, \
|
||||
{ k40, k41, KC_NO, k43, k44, KC_NO, k46, KC_NO, k48, KC_NO, k4a, k4b, k4c, k4d, k4e } \
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -60,10 +60,6 @@
|
||||
"LAYOUT_60_tsangan_hhkb": {
|
||||
"key_count": 62,
|
||||
"layout": [{"label":"Esc", "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":"|", "x":13, "y":0}, {"label":"~", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Backspace", "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":1.75}, {"label":"Fn", "x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.5}, {"label":"Win", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"label":"Win", "x":11, "y":4, "w":1.5}, {"label":"Menu", "x":12.5, "y":4}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}]
|
||||
},
|
||||
"LAYOUT_60_iso_split_space_bs_rshift": {
|
||||
"key_count": 66,
|
||||
"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":"Del", "x":13, "y":0, "w":1}, {"label":"Backspace", "x":14, "y":0, "w":1}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"CapsLock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"@", "x":11.75, "y":2}, {"label":"~", "x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"|", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Print screen", "x":14, "y":3, "w":1}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":2.25}, {"label":"FN", "x":6.00, "y":4, "w":1.25}, {"x":7.25, "y":4, "w":2.75}, {"label":"AltGr", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
/* ISO 60 layout by olligranlund
|
||||
*
|
||||
* This layout starts from a standard ISO 60% layout, and adds one function layer.
|
||||
* If you wish to only have one wide spacebar, you can easily do that by dismissing the "side" spacebar switches.
|
||||
*
|
||||
* Default Layer
|
||||
* ,-----------------------------------------------------------------------------------------.
|
||||
* | Esc | 1 ! | 2 " | 3 § | 4 $ | 5 % | 6 & | 7 / | 8 ( | 9 ) | 0 = | ß ? | ´ ` | Del | BSPC|
|
||||
* |-----------------------------------------------------------------------------------------|
|
||||
* | Tab | Q | W | E | R | T | Y | U | I | O | P | Ä | + * | Enter |
|
||||
* |---------------------------------------------------------------------------------- |
|
||||
* | FN | A | S | D | F | G | H | J | K | L | Ö | Ü | # ' | |
|
||||
* |-----------------------------------------------------------------------------------------|
|
||||
* | Shift | < > | Z | X | C | V | B | N | M | , ; | . : | - _ | Shift |Shift|
|
||||
* |-----------------------------------------------------------------------------------------|
|
||||
* | LCtl | LGUI | LAlt | Space | Space | Space | RAlt | FN | App | RCtl |
|
||||
* `-----------------------------------------------------------------------------------------'
|
||||
*/
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
LAYOUT_60_iso_split_space_bs_rshift(
|
||||
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_DEL, 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,
|
||||
MO(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_BSLS, KC_ENT,
|
||||
KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_PSCR,
|
||||
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, MO(1), KC_NO, KC_APP, KC_RCTL),
|
||||
|
||||
LAYOUT_60_iso_split_space_bs_rshift(
|
||||
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_DEL,
|
||||
KC_NO, KC_MPRV, KC_MPLY, KC_MNXT, KC_NO, KC_NO, KC_NO, KC_PGDOWN,KC_UP, KC_PGUP, KC_NO, KC_NO, KC_NO,
|
||||
KC_NO, KC_VOLD, KC_MUTE, KC_VOLU, KC_NO, KC_NO, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_NO, KC_NO, KC_NO, KC_NO,
|
||||
KC_LSFT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_END, KC_NO, KC_NO, KC_NO, KC_NO, KC_RSFT, KC_CAPS,
|
||||
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, MO(1), KC_NO, KC_APP, KC_RCTL),
|
||||
|
||||
};
|
||||
@@ -1,6 +0,0 @@
|
||||
# DZ60 with splitted parts
|
||||
### by Oliver Granlund
|
||||
|
||||

|
||||
|
||||
This is still under progress, but currently works on Windows as a daily driver.
|
||||
86
keyboards/moonlander/config.h
Normal file
86
keyboards/moonlander/config.h
Normal file
@@ -0,0 +1,86 @@
|
||||
/*
|
||||
Copyright 2018 Jack Humbert <jack.humb@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "config_common.h"
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define VENDOR_ID 0xFEED
|
||||
#define PRODUCT_ID 0x6060
|
||||
#define MANUFACTURER ZSA
|
||||
#define PRODUCT Moonlander
|
||||
#define DESCRIPTION A keyboard
|
||||
#define DEVICE_VER 0x0001
|
||||
|
||||
/* key matrix size */
|
||||
#define MATRIX_ROWS 12
|
||||
#define MATRIX_COLS 7
|
||||
|
||||
/* Planck PCB default pin-out */
|
||||
// #define MATRIX_ROW_PINS { B10, B11, B12, B13, B14, B15 }
|
||||
// #define MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, A6 }
|
||||
|
||||
// #define MCP23_ROW_PINS { GPB5, GBP4, GBP3, GBP2, GBP1, GBP0 }
|
||||
// #define MCP23_COL_PINS { GPA0, GBA1, GBA2, GBA3, GBA4, GBA5, GBA6 }
|
||||
|
||||
// #define MCP23_LED_R GPB7
|
||||
// #define MCP23_LED_G GPB6
|
||||
// #define MCP23_LED_B GPA7
|
||||
|
||||
|
||||
/* COL2ROW or ROW2COL */
|
||||
#define DIODE_DIRECTION ROW2COL
|
||||
|
||||
/* Set 0 if debouncing isn't needed */
|
||||
#define DEBOUNCING_DELAY 5
|
||||
|
||||
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
||||
#define LOCKING_SUPPORT_ENABLE
|
||||
/* Locking resynchronize hack */
|
||||
#define LOCKING_RESYNC_ENABLE
|
||||
|
||||
/* key combination for command */
|
||||
#define IS_COMMAND() ( \
|
||||
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
|
||||
)
|
||||
|
||||
/*
|
||||
* Feature disable options
|
||||
* These options are also useful to firmware size reduction.
|
||||
*/
|
||||
|
||||
/* disable debug print */
|
||||
//#define NO_DEBUG
|
||||
|
||||
/* disable print */
|
||||
//#define NO_PRINT
|
||||
|
||||
/* disable action features */
|
||||
//#define NO_ACTION_LAYER
|
||||
//#define NO_ACTION_TAPPING
|
||||
//#define NO_ACTION_ONESHOT
|
||||
//#define NO_ACTION_MACRO
|
||||
//#define NO_ACTION_FUNCTION
|
||||
|
||||
#define DRIVER_ADDR_1 0b1110100
|
||||
#define DRIVER_ADDR_2 0b1110111
|
||||
|
||||
#define DRIVER_COUNT 2
|
||||
#define DRIVER_1_LED_TOTAL 35
|
||||
#define DRIVER_2_LED_TOTAL 35
|
||||
#define DRIVER_LED_TOTAL DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL
|
||||
70
keyboards/moonlander/keymaps/default/keymap.c
Normal file
70
keyboards/moonlander/keymaps/default/keymap.c
Normal file
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
Copyright 2018 Jack Humbert <jack.humb@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 "moonlander.h"
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
[0] = LAYOUT_moonlander(
|
||||
RGB_MOD, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6,
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y,
|
||||
KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H,
|
||||
KC_LSFT,KC_Z, KC_X, KC_C, KC_V, KC_B,
|
||||
MO(1),KC_LCTL,KC_LALT,KC_LGUI,KC_RALT,
|
||||
KC_BSPC,KC_SPC, KC_ENT,
|
||||
|
||||
KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,
|
||||
KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL,
|
||||
KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT,
|
||||
KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,KC_ENT,
|
||||
KC_RALT,KC_LGUI,KC_LALT,KC_LCTL,MO(2),
|
||||
KC_ENT,KC_SPC, KC_BSPC
|
||||
),
|
||||
|
||||
[1] = LAYOUT_moonlander(
|
||||
RGB_MOD, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6,
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y,
|
||||
KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H,
|
||||
KC_LSFT,KC_Z, KC_X, KC_C, KC_V, KC_B,
|
||||
MO(1),KC_LCTL,KC_LALT,KC_LGUI,KC_RALT,
|
||||
KC_BSPC,KC_SPC, KC_ENT,
|
||||
|
||||
KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,
|
||||
KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL,
|
||||
KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT,
|
||||
KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,
|
||||
KC_RALT,KC_LGUI,KC_LALT,KC_LCTL,MO(2),
|
||||
KC_ENT,KC_SPC, KC_BSPC
|
||||
),
|
||||
|
||||
[1] = LAYOUT_moonlander(
|
||||
RGB_MOD, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6,
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y,
|
||||
KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H,
|
||||
KC_LSFT,KC_Z, KC_X, KC_C, KC_V, KC_B,
|
||||
MO(1),KC_LCTL,KC_LALT,KC_LGUI,KC_RALT,
|
||||
KC_BSPC,KC_SPC, KC_ENT,
|
||||
|
||||
KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,
|
||||
KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL,
|
||||
KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT,
|
||||
KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,
|
||||
KC_RALT,KC_LGUI,KC_LALT,KC_LCTL,MO(2),
|
||||
KC_ENT,KC_SPC, KC_BSPC
|
||||
)
|
||||
|
||||
};
|
||||
266
keyboards/moonlander/matrix.c
Normal file
266
keyboards/moonlander/matrix.c
Normal file
@@ -0,0 +1,266 @@
|
||||
/*
|
||||
Copyright 2018 Jack Humbert <jack.humb@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 <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
#include "hal.h"
|
||||
#include "timer.h"
|
||||
#include "wait.h"
|
||||
#include "printf.h"
|
||||
#include "backlight.h"
|
||||
#include "matrix.h"
|
||||
#include "action.h"
|
||||
#include "keycode.h"
|
||||
#include <string.h>
|
||||
#include "moonlander.h"
|
||||
#include "i2c_master.h"
|
||||
|
||||
/*
|
||||
#define MATRIX_ROW_PINS { B10, B11, B12, B13, B14, B15 } outputs
|
||||
#define MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, A6 } inputs
|
||||
*/
|
||||
/* matrix state(1:on, 0:off) */
|
||||
static matrix_row_t matrix[MATRIX_ROWS];
|
||||
static matrix_row_t matrix_debouncing[6];
|
||||
static matrix_row_t matrix_debouncing_right[MATRIX_COLS];
|
||||
static bool debouncing = false;
|
||||
static uint16_t debouncing_time = 0;
|
||||
static bool debouncing_right = false;
|
||||
static uint16_t debouncing_time_right = 0;
|
||||
|
||||
extern bool mcp23018_leds[3];
|
||||
|
||||
__attribute__ ((weak))
|
||||
void matrix_init_user(void) {}
|
||||
|
||||
__attribute__ ((weak))
|
||||
void matrix_scan_user(void) {}
|
||||
|
||||
__attribute__ ((weak))
|
||||
void matrix_init_kb(void) {
|
||||
matrix_init_user();
|
||||
}
|
||||
|
||||
__attribute__ ((weak))
|
||||
void matrix_scan_kb(void) {
|
||||
matrix_scan_user();
|
||||
}
|
||||
|
||||
bool mcp23018_initd = false;
|
||||
uint8_t mcp23018_tx[3];
|
||||
uint8_t mcp23018_rx[1];
|
||||
|
||||
void mcp23018_init(void) {
|
||||
|
||||
i2c_init();
|
||||
i2c_start(MCP23018_DEFAULT_ADDRESS << 1);
|
||||
|
||||
|
||||
// #define MCP23_ROW_PINS { GPB5, GBP4, GBP3, GBP2, GBP1, GBP0 } outputs
|
||||
// #define MCP23_COL_PINS { GPA0, GBA1, GBA2, GBA3, GBA4, GBA5, GBA6 } inputs
|
||||
|
||||
mcp23018_tx[0] = 0x00; // IODIRA
|
||||
mcp23018_tx[1] = 0b00000000; // A is output
|
||||
mcp23018_tx[2] = 0b00111111; // B is inputs
|
||||
|
||||
if (MSG_OK != i2c_transmit(MCP23018_DEFAULT_ADDRESS << 1,
|
||||
mcp23018_tx, 3, 100
|
||||
)) {
|
||||
printf("error hori\n");
|
||||
} else {
|
||||
mcp23018_tx[0] = 0x0C; // GPPUA
|
||||
mcp23018_tx[1] = 0b10000000; // A is not pulled-up
|
||||
mcp23018_tx[2] = 0b11111111; // B is pulled-up
|
||||
|
||||
if (MSG_OK != i2c_transmit(MCP23018_DEFAULT_ADDRESS << 1,
|
||||
mcp23018_tx, 3, 100
|
||||
)) {
|
||||
printf("error hori\n");
|
||||
} else {
|
||||
mcp23018_initd = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void matrix_init(void) {
|
||||
printf("matrix init\n");
|
||||
//debug_matrix = true;
|
||||
|
||||
// outputs
|
||||
palSetPadMode(GPIOB, 10, PAL_MODE_OUTPUT_PUSHPULL);
|
||||
palSetPadMode(GPIOB, 11, PAL_MODE_OUTPUT_PUSHPULL);
|
||||
palSetPadMode(GPIOB, 12, PAL_MODE_OUTPUT_PUSHPULL);
|
||||
palSetPadMode(GPIOB, 13, PAL_MODE_OUTPUT_PUSHPULL);
|
||||
palSetPadMode(GPIOB, 14, PAL_MODE_OUTPUT_PUSHPULL);
|
||||
palSetPadMode(GPIOB, 15, PAL_MODE_OUTPUT_PUSHPULL);
|
||||
|
||||
// inputs
|
||||
palSetPadMode(GPIOA, 0, PAL_MODE_INPUT_PULLDOWN);
|
||||
palSetPadMode(GPIOA, 1, PAL_MODE_INPUT_PULLDOWN);
|
||||
palSetPadMode(GPIOA, 2, PAL_MODE_INPUT_PULLDOWN);
|
||||
palSetPadMode(GPIOA, 3, PAL_MODE_INPUT_PULLDOWN);
|
||||
palSetPadMode(GPIOA, 6, PAL_MODE_INPUT_PULLDOWN);
|
||||
palSetPadMode(GPIOA, 7, PAL_MODE_INPUT_PULLDOWN);
|
||||
palSetPadMode(GPIOB, 0, PAL_MODE_INPUT_PULLDOWN);
|
||||
|
||||
memset(matrix, 0, MATRIX_ROWS * sizeof(matrix_row_t));
|
||||
memset(matrix_debouncing, 0, MATRIX_ROWS * sizeof(matrix_row_t));
|
||||
|
||||
mcp23018_init();
|
||||
|
||||
matrix_init_quantum();
|
||||
}
|
||||
|
||||
uint8_t matrix_scan(void) {
|
||||
|
||||
matrix_row_t data = 0;
|
||||
// actual matrix
|
||||
for (int row = 0; row < 6; row++) {
|
||||
|
||||
// strobe row
|
||||
switch (row) {
|
||||
case 0: palSetPad(GPIOB, 10); break;
|
||||
case 1: palSetPad(GPIOB, 11); break;
|
||||
case 2: palSetPad(GPIOB, 12); break;
|
||||
case 3: palSetPad(GPIOB, 13); break;
|
||||
case 4: palSetPad(GPIOB, 14); break;
|
||||
case 5: palSetPad(GPIOB, 15); break;
|
||||
}
|
||||
|
||||
// need wait to settle pin state
|
||||
wait_us(20);
|
||||
|
||||
// read col data
|
||||
data = (
|
||||
(palReadPad(GPIOA, 0) << 0 ) |
|
||||
(palReadPad(GPIOA, 1) << 1 ) |
|
||||
(palReadPad(GPIOA, 2) << 2 ) |
|
||||
(palReadPad(GPIOA, 3) << 3 ) |
|
||||
(palReadPad(GPIOA, 6) << 4 ) |
|
||||
(palReadPad(GPIOA, 7) << 5 ) |
|
||||
(palReadPad(GPIOB, 0) << 6 )
|
||||
);
|
||||
|
||||
// unstrobe row
|
||||
switch (row) {
|
||||
case 0: palClearPad(GPIOB, 10); break;
|
||||
case 1: palClearPad(GPIOB, 11); break;
|
||||
case 2: palClearPad(GPIOB, 12); break;
|
||||
case 3: palClearPad(GPIOB, 13); break;
|
||||
case 4: palClearPad(GPIOB, 14); break;
|
||||
case 5: palClearPad(GPIOB, 15); break;
|
||||
}
|
||||
|
||||
if (matrix_debouncing[row] != data) {
|
||||
matrix_debouncing[row] = data;
|
||||
debouncing = true;
|
||||
debouncing_time = timer_read();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (int row = 0; row < 7; row++) {
|
||||
// right side
|
||||
|
||||
if (!mcp23018_initd) {
|
||||
printf("trying to init right\n");
|
||||
mcp23018_init();
|
||||
}
|
||||
|
||||
// #define MCP23_ROW_PINS { GPB5, GBP4, GBP3, GBP2, GBP1, GBP0 } outputs
|
||||
// #define MCP23_COL_PINS { GPA0, GBA1, GBA2, GBA3, GBA4, GBA5, GBA6 } inputs
|
||||
|
||||
// select row
|
||||
|
||||
mcp23018_tx[0] = 0x12; // GPIOA
|
||||
mcp23018_tx[1] = (0b01111111 & ~(1<<(row))) | ((uint8_t)!mcp23018_leds[2] << 7); // activate row
|
||||
mcp23018_tx[2] = ((uint8_t)!mcp23018_leds[1] << 6) | ((uint8_t)!mcp23018_leds[0] << 7); // activate row
|
||||
|
||||
if (MSG_OK != i2c_transmit(MCP23018_DEFAULT_ADDRESS << 1,
|
||||
mcp23018_tx, 3, 100
|
||||
)) {
|
||||
printf("error hori\n");
|
||||
}
|
||||
|
||||
// read col
|
||||
|
||||
mcp23018_tx[0] = 0x13; // GPIOB
|
||||
|
||||
if (MSG_OK != i2c_transmit_receive(MCP23018_DEFAULT_ADDRESS << 1,
|
||||
mcp23018_tx, 1,
|
||||
mcp23018_rx, 1
|
||||
)) {
|
||||
printf("error vert\n");
|
||||
}
|
||||
|
||||
data = ~(mcp23018_rx[0] & 0b00111111);
|
||||
// data = 0x01;
|
||||
|
||||
if (matrix_debouncing_right[row] != data) {
|
||||
matrix_debouncing_right[row] = data;
|
||||
debouncing_right = true;
|
||||
debouncing_time_right = timer_read();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (debouncing && timer_elapsed(debouncing_time) > DEBOUNCING_DELAY) {
|
||||
for (int row = 0; row < 6; row++) {
|
||||
matrix[row] = matrix_debouncing[row];
|
||||
}
|
||||
debouncing = false;
|
||||
}
|
||||
|
||||
if (debouncing_right && timer_elapsed(debouncing_time_right) > DEBOUNCING_DELAY) {
|
||||
for (int row = 0; row < 6; row++) {
|
||||
matrix[11 - row] = 0;
|
||||
for (int col = 0; col < MATRIX_COLS; col++) {
|
||||
matrix[11 - row] |= ((matrix_debouncing_right[6 - col] & (1 << row) ? 1 : 0) << col);
|
||||
}
|
||||
}
|
||||
debouncing_right = false;
|
||||
}
|
||||
|
||||
matrix_scan_quantum();
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
bool matrix_is_on(uint8_t row, uint8_t col) {
|
||||
return (matrix[row] & (1<<col));
|
||||
}
|
||||
|
||||
matrix_row_t matrix_get_row(uint8_t row) {
|
||||
return matrix[row];
|
||||
}
|
||||
|
||||
void matrix_print(void) {
|
||||
printf("\nr/c 01234567\n");
|
||||
for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
|
||||
printf("%X0: ", row);
|
||||
matrix_row_t data = matrix_get_row(row);
|
||||
for (int col = 0; col < MATRIX_COLS; col++) {
|
||||
if (data & (1<<col))
|
||||
printf("1");
|
||||
else
|
||||
printf("0");
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
}
|
||||
266
keyboards/moonlander/moonlander.c
Normal file
266
keyboards/moonlander/moonlander.c
Normal file
@@ -0,0 +1,266 @@
|
||||
/*
|
||||
Copyright 2018 Jack Humbert <jack.humb@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 "moonlander.h"
|
||||
|
||||
bool mcp23018_leds[3] = {0, 0, 0};
|
||||
|
||||
void matrix_init_kb(void) {
|
||||
setPinOutput(B5);
|
||||
setPinOutput(B4);
|
||||
setPinOutput(B3);
|
||||
|
||||
writePinLow(B5);
|
||||
writePinLow(B4);
|
||||
writePinLow(B3);
|
||||
|
||||
mcp23018_leds[0] = 0; // blue
|
||||
mcp23018_leds[1] = 0; // green
|
||||
mcp23018_leds[2] = 0; // red
|
||||
|
||||
eeconfig_init();
|
||||
}
|
||||
|
||||
void matrix_scan_kb(void) {
|
||||
|
||||
}
|
||||
|
||||
uint32_t layer_state_set_kb(uint32_t state) {
|
||||
ML_LED_1(0);
|
||||
ML_LED_2(0);
|
||||
ML_LED_3(0);
|
||||
ML_LED_4(0);
|
||||
ML_LED_5(0);
|
||||
ML_LED_6(0);
|
||||
|
||||
uint8_t layer = biton32(state);
|
||||
switch (layer) {
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
ML_LED_1(1);
|
||||
ML_LED_4(1);
|
||||
break;
|
||||
case 2:
|
||||
ML_LED_2(1);
|
||||
ML_LED_5(1);
|
||||
break;
|
||||
case 3:
|
||||
ML_LED_3(1);
|
||||
break;
|
||||
case 4:
|
||||
ML_LED_4(1);
|
||||
break;
|
||||
case 5:
|
||||
ML_LED_5(1);
|
||||
break;
|
||||
case 6:
|
||||
ML_LED_6(1);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return state;
|
||||
}
|
||||
|
||||
const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
|
||||
/* Refer to IS31 manual for these locations
|
||||
* driver
|
||||
* | R location
|
||||
* | | G location
|
||||
* | | | B location
|
||||
* | | | | */
|
||||
{0, C3_2, C1_1, C4_2}, // 1
|
||||
{0, C2_2, C1_2, C4_3},
|
||||
{0, C2_3, C1_3, C3_3},
|
||||
{0, C2_4, C1_4, C3_4},
|
||||
{0, C2_5, C1_5, C3_5},
|
||||
{0, C2_6, C1_6, C3_6},
|
||||
{0, C2_7, C1_7, C3_7},
|
||||
{0, C2_8, C1_8, C3_8},
|
||||
{0, C3_1, C2_1, C4_1},
|
||||
|
||||
{0, C7_8, C6_8, C8_8}, // 10
|
||||
{0, C7_7, C6_7, C9_8},
|
||||
{0, C8_7, C6_6, C9_7},
|
||||
{0, C8_6, C7_6, C9_6},
|
||||
{0, C8_5, C7_5, C9_5},
|
||||
{0, C8_4, C7_4, C9_4},
|
||||
{0, C8_3, C7_3, C9_3},
|
||||
{0, C8_2, C7_2, C9_2},
|
||||
{0, C8_1, C7_1, C9_1},
|
||||
|
||||
{0, C3_10, C1_9, C4_10}, // 19
|
||||
{0, C2_10, C1_10, C4_11},
|
||||
{0, C2_11, C1_11, C3_11},
|
||||
{0, C2_12, C1_12, C3_12},
|
||||
{0, C2_13, C1_13, C3_13},
|
||||
{0, C2_14, C1_14, C3_14},
|
||||
{0, C2_15, C1_15, C3_15},
|
||||
{0, C2_16, C1_16, C3_16},
|
||||
{0, C3_9, C2_9, C4_9},
|
||||
|
||||
{0, C7_16, C6_16, C8_16}, // 28
|
||||
{0, C7_15, C6_15, C9_16},
|
||||
{0, C8_15, C6_14, C9_15},
|
||||
{0, C8_10, C7_10, C9_10},
|
||||
{0, C8_9, C7_9, C9_9},
|
||||
{0, C8_11, C7_11, C9_11},
|
||||
{0, C8_12, C7_12, C9_12},
|
||||
{0, C8_13, C7_13, C9_13},
|
||||
// {0, C8_14, C7_14, C9_4}
|
||||
|
||||
{1, C3_2, C1_1, C4_2}, // 1
|
||||
{1, C2_2, C1_2, C4_3},
|
||||
{1, C2_3, C1_3, C3_3},
|
||||
{1, C2_4, C1_4, C3_4},
|
||||
{1, C2_5, C1_5, C3_5},
|
||||
{1, C2_6, C1_6, C3_6},
|
||||
{1, C2_7, C1_7, C3_7},
|
||||
{1, C2_8, C1_8, C3_8},
|
||||
{1, C3_1, C2_1, C4_1},
|
||||
|
||||
{1, C7_8, C6_8, C8_8}, // 10
|
||||
{1, C7_7, C6_7, C9_8},
|
||||
{1, C8_7, C6_6, C9_7},
|
||||
{1, C8_6, C7_6, C9_6},
|
||||
{1, C8_5, C7_5, C9_5},
|
||||
{1, C8_4, C7_4, C9_4},
|
||||
{1, C8_3, C7_3, C9_3},
|
||||
{1, C8_2, C7_2, C9_2},
|
||||
{1, C8_1, C7_1, C9_1},
|
||||
|
||||
{1, C3_10, C1_9, C4_10}, // 19
|
||||
{1, C2_10, C1_10, C4_11},
|
||||
{1, C2_11, C1_11, C3_11},
|
||||
{1, C2_12, C1_12, C3_12},
|
||||
{1, C2_13, C1_13, C3_13},
|
||||
{1, C2_14, C1_14, C3_14},
|
||||
{1, C2_15, C1_15, C3_15},
|
||||
{1, C2_16, C1_16, C3_16},
|
||||
{1, C3_9, C2_9, C4_9},
|
||||
|
||||
{1, C7_16, C6_16, C8_16}, // 28
|
||||
{1, C7_15, C6_15, C9_16},
|
||||
{1, C8_15, C6_14, C9_15},
|
||||
{1, C8_10, C7_10, C9_10},
|
||||
{1, C8_9, C7_9, C9_9},
|
||||
{1, C8_11, C7_11, C9_11},
|
||||
{1, C8_12, C7_12, C9_12},
|
||||
{1, C8_13, C7_13, C9_13},
|
||||
|
||||
};
|
||||
|
||||
rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
|
||||
|
||||
/*{row | col << 4}
|
||||
| {x=0..224, y=0..64}
|
||||
| | modifier
|
||||
| | | */
|
||||
{{0|(0<<4)}, {17.23*0, 21.33*0}, 1},
|
||||
{{1|(0<<4)}, {17.23*0, 21.33*1}, 4},
|
||||
{{2|(0<<4)}, {17.23*0, 21.33*2}, 4},
|
||||
{{3|(0<<4)}, {17.23*0, 21.33*3}, 4},
|
||||
{{4|(0<<4)}, {17.23*0, 21.33*4}, 4},
|
||||
|
||||
{{0|(1<<4)}, {17.23*1, 21.33*0}, 4},
|
||||
{{1|(1<<4)}, {17.23*1, 21.33*1}, 4},
|
||||
{{2|(1<<4)}, {17.23*1, 21.33*2}, 4},
|
||||
{{3|(1<<4)}, {17.23*1, 21.33*3}, 4},
|
||||
{{4|(1<<4)}, {17.23*1, 21.33*4}, 4},
|
||||
|
||||
{{0|(2<<4)}, {17.23*2, 21.33*0}, 4},
|
||||
{{1|(2<<4)}, {17.23*2, 21.33*1}, 4},
|
||||
{{2|(2<<4)}, {17.23*2, 21.33*2}, 4},
|
||||
{{3|(2<<4)}, {17.23*2, 21.33*3}, 4},
|
||||
{{4|(2<<4)}, {17.23*2, 21.33*4}, 4},
|
||||
|
||||
{{0|(3<<4)}, {17.23*3, 21.33*0}, 4},
|
||||
{{1|(3<<4)}, {17.23*3, 21.33*1}, 4},
|
||||
{{2|(3<<4)}, {17.23*3, 21.33*2}, 4},
|
||||
{{3|(3<<4)}, {17.23*3, 21.33*3}, 4},
|
||||
{{4|(3<<4)}, {17.23*3, 21.33*4}, 4},
|
||||
|
||||
{{0|(4<<4)}, {17.23*4, 21.33*0}, 4},
|
||||
{{1|(4<<4)}, {17.23*4, 21.33*1}, 4},
|
||||
{{2|(4<<4)}, {17.23*4, 21.33*2}, 4},
|
||||
{{3|(4<<4)}, {17.23*4, 21.33*3}, 4},
|
||||
{{4|(4<<4)}, {17.23*4, 21.33*4}, 4},
|
||||
|
||||
{{0|(5<<4)}, {17.23*5, 21.33*0}, 4},
|
||||
{{1|(5<<4)}, {17.23*5, 21.33*1}, 4},
|
||||
{{2|(5<<4)}, {17.23*5, 21.33*2}, 4},
|
||||
{{3|(5<<4)}, {17.23*5, 21.33*3}, 4},
|
||||
|
||||
{{0|(6<<4)}, {17.23*6, 21.33*0}, 4},
|
||||
{{1|(6<<4)}, {17.23*6, 21.33*1}, 4},
|
||||
{{2|(6<<4)}, {17.23*6, 21.33*2}, 4},
|
||||
|
||||
// cluster
|
||||
{{5|(0<<4)}, {17.23*5.5, 21.33*4}, 4},
|
||||
{{5|(1<<4)}, {17.23*6.0, 21.33*5}, 4},
|
||||
{{5|(2<<4)}, {17.23*6.5, 21.33*6}, 4},
|
||||
|
||||
|
||||
|
||||
|
||||
{{0|(0<<4)}, {17.23*13, 21.33*0}, 1},
|
||||
{{1|(0<<4)}, {17.23*13, 21.33*1}, 4},
|
||||
{{2|(0<<4)}, {17.23*13, 21.33*2}, 4},
|
||||
{{3|(0<<4)}, {17.23*13, 21.33*3}, 4},
|
||||
{{4|(0<<4)}, {17.23*13, 21.33*4}, 4},
|
||||
|
||||
{{0|(1<<4)}, {17.23*12, 21.33*0}, 4},
|
||||
{{1|(1<<4)}, {17.23*12, 21.33*1}, 4},
|
||||
{{2|(1<<4)}, {17.23*12, 21.33*2}, 4},
|
||||
{{3|(1<<4)}, {17.23*12, 21.33*3}, 4},
|
||||
{{4|(1<<4)}, {17.23*12, 21.33*4}, 4},
|
||||
|
||||
{{0|(2<<4)}, {17.23*11, 21.33*0}, 4},
|
||||
{{1|(2<<4)}, {17.23*11, 21.33*1}, 4},
|
||||
{{2|(2<<4)}, {17.23*11, 21.33*2}, 4},
|
||||
{{3|(2<<4)}, {17.23*11, 21.33*3}, 4},
|
||||
{{4|(2<<4)}, {17.23*11, 21.33*4}, 4},
|
||||
|
||||
{{0|(3<<4)}, {17.23*10, 21.33*0}, 4},
|
||||
{{1|(3<<4)}, {17.23*10, 21.33*1}, 4},
|
||||
{{2|(3<<4)}, {17.23*10, 21.33*2}, 4},
|
||||
{{3|(3<<4)}, {17.23*10, 21.33*3}, 4},
|
||||
{{4|(3<<4)}, {17.23*10, 21.33*4}, 4},
|
||||
|
||||
{{0|(4<<4)}, {17.23*9, 21.33*0}, 4},
|
||||
{{1|(4<<4)}, {17.23*9, 21.33*1}, 4},
|
||||
{{2|(4<<4)}, {17.23*9, 21.33*2}, 4},
|
||||
{{3|(4<<4)}, {17.23*9, 21.33*3}, 4},
|
||||
{{4|(4<<4)}, {17.23*9, 21.33*4}, 4},
|
||||
|
||||
{{0|(5<<4)}, {17.23*8, 21.33*0}, 4},
|
||||
{{1|(5<<4)}, {17.23*8, 21.33*1}, 4},
|
||||
{{2|(5<<4)}, {17.23*8, 21.33*2}, 4},
|
||||
{{3|(5<<4)}, {17.23*8, 21.33*3}, 4},
|
||||
|
||||
{{0|(6<<4)}, {17.23*7, 21.33*0}, 4},
|
||||
{{1|(6<<4)}, {17.23*7, 21.33*1}, 4},
|
||||
{{2|(6<<4)}, {17.23*7, 21.33*2}, 4},
|
||||
|
||||
// cluster
|
||||
{{5|(0<<4)}, {17.23*7.5, 21.33*4}, 4},
|
||||
{{5|(1<<4)}, {17.23*7.0, 21.33*5}, 4},
|
||||
{{5|(2<<4)}, {17.23*6.5, 21.33*6}, 4},
|
||||
|
||||
};
|
||||
61
keyboards/moonlander/moonlander.h
Normal file
61
keyboards/moonlander/moonlander.h
Normal file
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
Copyright 2018 Jack Humbert <jack.humb@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 MCP23018_DEFAULT_ADDRESS 0b0100000
|
||||
|
||||
#define ML_LED_1(status) (status ? writePinHigh(B5) : writePinLow(B5))
|
||||
#define ML_LED_2(status) (status ? writePinHigh(B4) : writePinLow(B4))
|
||||
#define ML_LED_3(status) (status ? writePinHigh(B3) : writePinLow(B3))
|
||||
|
||||
#define ML_LED_4(status) mcp23018_leds[0] = status
|
||||
#define ML_LED_5(status) mcp23018_leds[1] = status
|
||||
#define ML_LED_6(status) mcp23018_leds[2] = status
|
||||
|
||||
#include "quantum.h"
|
||||
|
||||
#define LAYOUT_moonlander( \
|
||||
k00, k01, k02, k03, k04, k05, k06, \
|
||||
k10, k11, k12, k13, k14, k15, k16, \
|
||||
k20, k21, k22, k23, k24, k25, k26, \
|
||||
k30, k31, k32, k33, k34, k35, \
|
||||
k40, k41, k42, k43, k44, \
|
||||
k50, k51, k52, \
|
||||
\
|
||||
k60, k61, k62, k63, k64, k65, k66, \
|
||||
k70, k71, k72, k73, k74, k75, k76, \
|
||||
k80, k81, k82, k83, k84, k85, k86, \
|
||||
k91, k92, k93, k94, k95, k96, \
|
||||
ka2, ka3, ka4, ka5, ka6, \
|
||||
kb4, kb5, kb6 \
|
||||
) \
|
||||
{ \
|
||||
{ k00, k01, k02, k03, k04, k05, k06 }, \
|
||||
{ k10, k11, k12, k13, k14, k15, k16 }, \
|
||||
{ k20, k21, k22, k23, k24, k25, k26 }, \
|
||||
{ k30, k31, k32, k33, k34, k35, KC_NO }, \
|
||||
{ k40, k41, k42, k43, k44, KC_NO, KC_NO }, \
|
||||
{ k50, k51, k52, KC_NO, KC_NO, KC_NO, KC_NO }, \
|
||||
\
|
||||
{ k60, k61, k62, k63, k64, k65, k66 }, \
|
||||
{ k70, k71, k72, k73, k74, k75, k76 }, \
|
||||
{ k80, k81, k82, k83, k84, k85, k86 }, \
|
||||
{ KC_NO,k91, k92, k93, k94, k95, k96 }, \
|
||||
{ KC_NO, KC_NO, ka2, ka3, ka4, ka5, ka6 }, \
|
||||
{ KC_NO, KC_NO, KC_NO, KC_NO, kb4, kb5, kb6 } \
|
||||
}
|
||||
23
keyboards/moonlander/rules.mk
Normal file
23
keyboards/moonlander/rules.mk
Normal file
@@ -0,0 +1,23 @@
|
||||
# project specific files
|
||||
SRC = matrix.c
|
||||
#LAYOUTS += ortho_4x12
|
||||
|
||||
# Cortex version
|
||||
MCU = STM32F303
|
||||
|
||||
# Build Options
|
||||
# comment out to disable the options.
|
||||
#
|
||||
BACKLIGHT_ENABLE = no
|
||||
BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration
|
||||
## (Note that for BOOTMAGIC on Teensy LC you have to use a custom .ld script.)
|
||||
MOUSEKEY_ENABLE = yes # Mouse keys
|
||||
EXTRAKEY_ENABLE = yes # Audio control and System control
|
||||
CONSOLE_ENABLE = yes # Console for debug
|
||||
COMMAND_ENABLE = yes # Commands for debug and configuration
|
||||
#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
|
||||
NKRO_ENABLE = yes # USB Nkey Rollover
|
||||
CUSTOM_MATRIX = yes # Custom matrix file
|
||||
AUDIO_ENABLE = yes
|
||||
RGB_MATRIX_ENABLE = IS31FL3731
|
||||
# SERIAL_LINK_ENABLE = yes
|
||||
48
keyboards/planck/rules.mk
Normal file
48
keyboards/planck/rules.mk
Normal file
@@ -0,0 +1,48 @@
|
||||
# MCU name
|
||||
MCU = atmega32u4
|
||||
|
||||
# Bootloader
|
||||
# This definition is optional, and if your keyboard supports multiple bootloaders of
|
||||
# different sizes, comment this out, and the correct address will be loaded
|
||||
# automatically (+60). See bootloader.mk for all options.
|
||||
ifeq ($(strip $(KEYBOARD)), planck/rev3)
|
||||
BOOTLOADER = atmel-dfu
|
||||
endif
|
||||
ifeq ($(strip $(KEYBOARD)), planck/rev4)
|
||||
BOOTLOADER = atmel-dfu
|
||||
endif
|
||||
ifeq ($(strip $(KEYBOARD)), planck/rev5)
|
||||
BOOTLOADER = qmk-dfu
|
||||
endif
|
||||
ifeq ($(strip $(KEYBOARD)), planck/light)
|
||||
BOOTLOADER = atmel-dfu
|
||||
endif
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
# Build Options
|
||||
# change to "no" to disable the options, or define them in the Makefile in
|
||||
# the appropriate keymap folder that will get included automatically
|
||||
#
|
||||
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE = no # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE = yes # Console for debug(+400)
|
||||
COMMAND_ENABLE = no # Commands for debug and configuration
|
||||
NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
|
||||
MIDI_ENABLE = no # MIDI controls
|
||||
AUDIO_ENABLE = yes # Audio output on port C6
|
||||
UNICODE_ENABLE = no # Unicode
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
|
||||
API_SYSEX_ENABLE = no
|
||||
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||
|
||||
LAYOUTS = ortho_4x12 planck_mit planck_grid
|
||||
LAYOUTS_HAS_RGB = no
|
||||
|
||||
DEFAULT_FOLDER = planck/rev5
|
||||
@@ -48,9 +48,6 @@
|
||||
#define CALC KC_CALC // Open default calculator app
|
||||
#define MYCM KC_MYCM // Open default file manager
|
||||
|
||||
// increase readability
|
||||
#define XXXXX KC_NO
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
/* Keymap BASE: (Base Layer) Default Layer
|
||||
|
||||
@@ -13,5 +13,5 @@ MIDI_ENABLE = no # MIDI controls
|
||||
AUDIO_ENABLE = no # Audio output on port C6
|
||||
UNICODE_ENABLE = no # Unicode
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight.
|
||||
RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight.
|
||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||
|
||||
@@ -16,8 +16,6 @@ Flashing
|
||||
|
||||
ps2avr(GB) boards use an atmega32a microcontroller and a different bootloader. It is not flashable using the regular QMK methods.
|
||||
|
||||
**Reset Key:** Hold down the key located at `K00`, commonly programmed as `Esc` while plugging in the keyboard.
|
||||
|
||||
Windows:
|
||||
1. Download [HIDBootFlash](http://vusb.wikidot.com/project:hidbootflash).
|
||||
2. Place your keyboard into reset.
|
||||
|
||||
@@ -31,13 +31,13 @@ F_CPU = 12000000
|
||||
BOOTLOADER = bootloadHID
|
||||
|
||||
# build options
|
||||
BOOTMAGIC_ENABLE = no
|
||||
BOOTMAGIC_ENABLE = full
|
||||
MOUSEKEY_ENABLE = no
|
||||
EXTRAKEY_ENABLE = yes
|
||||
CONSOLE_ENABLE = yes
|
||||
COMMAND_ENABLE = yes
|
||||
BACKLIGHT_ENABLE = no
|
||||
RGBLIGHT_ENABLE = yes
|
||||
RGBLIGHT_ENABLE = no
|
||||
RGBLIGHT_CUSTOM_DRIVER = yes
|
||||
|
||||
OPT_DEFS = -DDEBUG_LEVEL=0
|
||||
|
||||
@@ -8,7 +8,8 @@
|
||||
* This Revision: $Id: usbconfig-prototype.h 785 2010-05-30 17:57:07Z cs $
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#ifndef __usbconfig_h_included__
|
||||
#define __usbconfig_h_included__
|
||||
|
||||
#include "config.h"
|
||||
|
||||
@@ -391,3 +392,5 @@ section at the end of this file).
|
||||
/* #define USB_INTR_PENDING EIFR */
|
||||
#define USB_INTR_PENDING_BIT INTF1
|
||||
#define USB_INTR_VECTOR INT1_vect
|
||||
|
||||
#endif /* __usbconfig_h_included__ */
|
||||
|
||||
Reference in New Issue
Block a user