Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d597af9e1e | ||
|
|
03ed819717 | ||
|
|
141535c9db | ||
|
|
a92947fcdb | ||
|
|
cde5237a88 | ||
|
|
dc79792ab4 | ||
|
|
e6a9f700de | ||
|
|
0fdd37ee19 | ||
|
|
40e8d60ecd | ||
|
|
f81b0e35a6 | ||
|
|
5e98eaaaff | ||
|
|
9e8767917d | ||
|
|
f89439ae09 | ||
|
|
3cd2a27ac0 | ||
|
|
28d94b7248 | ||
|
|
abd8e75cb7 | ||
|
|
9046107183 | ||
|
|
2b63896466 | ||
|
|
6734a39811 | ||
|
|
799acb2802 | ||
|
|
18bc525493 | ||
|
|
4edb5a5e8c | ||
|
|
3b5fd4cc51 |
No files matched your search
@@ -58,6 +58,8 @@ This is the default mode. You can adjust the cursor and scrolling acceleration u
|
|||||||
|`MOUSEKEY_INTERVAL` |50 |Time between cursor movements |
|
|`MOUSEKEY_INTERVAL` |50 |Time between cursor movements |
|
||||||
|`MOUSEKEY_MAX_SPEED` |10 |Maximum cursor speed at which acceleration stops |
|
|`MOUSEKEY_MAX_SPEED` |10 |Maximum cursor speed at which acceleration stops |
|
||||||
|`MOUSEKEY_TIME_TO_MAX` |20 |Time until maximum cursor speed is reached |
|
|`MOUSEKEY_TIME_TO_MAX` |20 |Time until maximum cursor speed is reached |
|
||||||
|
|`MOUSEKEY_WHEEL_DELAY` |300 |Delay between pressing a wheel key and wheel movement |
|
||||||
|
|`MOUSEKEY_WHEEL_INTERVAL` |100 |Time between wheel movements |
|
||||||
|`MOUSEKEY_WHEEL_MAX_SPEED` |8 |Maximum number of scroll steps per scroll action |
|
|`MOUSEKEY_WHEEL_MAX_SPEED` |8 |Maximum number of scroll steps per scroll action |
|
||||||
|`MOUSEKEY_WHEEL_TIME_TO_MAX`|40 |Time until maximum scroll speed is reached |
|
|`MOUSEKEY_WHEEL_TIME_TO_MAX`|40 |Time until maximum scroll speed is reached |
|
||||||
|
|
||||||
@@ -66,6 +68,7 @@ Tips:
|
|||||||
* Setting `MOUSEKEY_DELAY` too low makes the cursor unresponsive. Setting it too high makes small movements difficult.
|
* Setting `MOUSEKEY_DELAY` too low makes the cursor unresponsive. Setting it too high makes small movements difficult.
|
||||||
* For smoother cursor movements, lower the value of `MOUSEKEY_INTERVAL`. If the refresh rate of your display is 60Hz, you could set it to `16` (1/60). As this raises the cursor speed significantly, you may want to lower `MOUSEKEY_MAX_SPEED`.
|
* For smoother cursor movements, lower the value of `MOUSEKEY_INTERVAL`. If the refresh rate of your display is 60Hz, you could set it to `16` (1/60). As this raises the cursor speed significantly, you may want to lower `MOUSEKEY_MAX_SPEED`.
|
||||||
* Setting `MOUSEKEY_TIME_TO_MAX` or `MOUSEKEY_WHEEL_TIME_TO_MAX` to `0` will disable acceleration for the cursor or scrolling respectively. This way you can make one of them constant while keeping the other accelerated, which is not possible in constant speed mode.
|
* Setting `MOUSEKEY_TIME_TO_MAX` or `MOUSEKEY_WHEEL_TIME_TO_MAX` to `0` will disable acceleration for the cursor or scrolling respectively. This way you can make one of them constant while keeping the other accelerated, which is not possible in constant speed mode.
|
||||||
|
* Setting `MOUSEKEY_WHEEL_INTERVAL` too low will make scrolling too fast. Setting it too high will make scrolling too slow when the wheel key is held down.
|
||||||
|
|
||||||
Cursor acceleration uses the same algorithm as the X Window System MouseKeysAccel feature. You can read more about it [on Wikipedia](https://en.wikipedia.org/wiki/Mouse_keys).
|
Cursor acceleration uses the same algorithm as the X Window System MouseKeysAccel feature. You can read more about it [on Wikipedia](https://en.wikipedia.org/wiki/Mouse_keys).
|
||||||
|
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ On the display tab click 'Open stroke display'. With Plover disabled you should
|
|||||||
|
|
||||||
## Learning Stenography
|
## Learning Stenography
|
||||||
|
|
||||||
* [Learn Plover!](https://sites.google.com/site/ploverdoc/)
|
* [Learn Plover!](https://sites.google.com/site/learnplover/)
|
||||||
* [QWERTY Steno](http://qwertysteno.com/Home/)
|
* [QWERTY Steno](http://qwertysteno.com/Home/)
|
||||||
* [Steno Jig](https://joshuagrams.github.io/steno-jig/)
|
* [Steno Jig](https://joshuagrams.github.io/steno-jig/)
|
||||||
* More resources at the Plover [Learning Stenography](https://github.com/openstenoproject/plover/wiki/Learning-Stenography) wiki
|
* More resources at the Plover [Learning Stenography](https://github.com/openstenoproject/plover/wiki/Learning-Stenography) wiki
|
||||||
|
|||||||
@@ -0,0 +1,65 @@
|
|||||||
|
# How to Use Github with QMK
|
||||||
|
|
||||||
|
Github can be a little tricky to those that aren't familiar with it - this guide will walk through each step of forking, cloning, and submitting a pull request with QMK.
|
||||||
|
|
||||||
|
?> This guide assumes you're somewhat comfortable with running things at the command line, and have git installed on your system.
|
||||||
|
|
||||||
|
Start on the [QMK Github page](https://github.com/qmk/qmk_firmware), and you'll see a button in the upper right that says "Fork":
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
If you're a part of an organization, you'll need to choose which account to fork it to. In most circumstances, you'll want to fork it to your personal account. Once your fork is completed (sometimes this takes a little while), click the "Clone or Download" button:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
And be sure to select "HTTPS", and select the link and copy it:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
From here, enter `git clone --recurse-submodules ` into the command line, and then paste your link:
|
||||||
|
|
||||||
|
```
|
||||||
|
user@computer:~$ git clone --recurse-submodules https://github.com/whoeveryouare/qmk_firmware.git
|
||||||
|
Cloning into 'qmk_firmware'...
|
||||||
|
remote: Enumerating objects: 9, done.
|
||||||
|
remote: Counting objects: 100% (9/9), done.
|
||||||
|
remote: Compressing objects: 100% (5/5), done.
|
||||||
|
remote: Total 183883 (delta 5), reused 4 (delta 4), pack-reused 183874
|
||||||
|
Receiving objects: 100% (183883/183883), 132.90 MiB | 9.57 MiB/s, done.
|
||||||
|
Resolving deltas: 100% (119972/119972), done.
|
||||||
|
...
|
||||||
|
Submodule path 'lib/chibios': checked out '587968d6cbc2b0e1c7147540872f2a67e59ca18b'
|
||||||
|
Submodule path 'lib/chibios-contrib': checked out 'ede48346eee4b8d6847c19bc01420bee76a5e486'
|
||||||
|
Submodule path 'lib/googletest': checked out 'ec44c6c1675c25b9827aacd08c02433cccde7780'
|
||||||
|
Submodule path 'lib/lufa': checked out 'ce10f7642b0459e409839b23cc91498945119b4d'
|
||||||
|
Submodule path 'lib/ugfx': checked out '3e97b74e03c93631cdd3ddb2ce43b963fdce19b2'
|
||||||
|
```
|
||||||
|
|
||||||
|
You now have your QMK fork on your local machine, and you can add your keymap, compile it and flash it to your board. Once you're happy with your changes, you can add, commit, and push them to your fork like this:
|
||||||
|
|
||||||
|
```
|
||||||
|
user@computer:~$ git add .
|
||||||
|
user@computer:~$ git commit -m "adding my keymap"
|
||||||
|
[master cccb1608] adding my keymap
|
||||||
|
1 file changed, 1 insertion(+)
|
||||||
|
create mode 100644 keyboards/planck/keymaps/mine/keymap.c
|
||||||
|
user@computer:~$ git push
|
||||||
|
Counting objects: 1, done.
|
||||||
|
Delta compression using up to 4 threads.
|
||||||
|
Compressing objects: 100% (1/1), done.
|
||||||
|
Writing objects: 100% (1/1), 1.64 KiB | 0 bytes/s, done.
|
||||||
|
Total 1 (delta 1), reused 0 (delta 0)
|
||||||
|
remote: Resolving deltas: 100% (1/1), completed with 1 local objects.
|
||||||
|
To https://github.com/whoeveryouare/qmk_firmware.git
|
||||||
|
+ 20043e64...7da94ac5 master -> master
|
||||||
|
```
|
||||||
|
|
||||||
|
Your changes now exist on your fork on Github - if you go back there (`https://github.com/<whoeveryouare>/qmk_firmware`), you can create a "New Pull Request" by clicking this button:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Here you'll be able to see exactly what you've committed - if it all looks good, you can finalize it by clicking "Create Pull Request":
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
After submitting, we may talk to you about your changes, ask that you make changes, and eventually accept it! Thanks for contributing to QMK :)
|
||||||
@@ -17,7 +17,7 @@ Note that this set-up has been tested on Ubuntu 16.04 only for the moment.
|
|||||||
|
|
||||||
# Prerequisites
|
# Prerequisites
|
||||||
## Build Environment
|
## Build Environment
|
||||||
Before starting, you must have followed the [Getting Started](news_getting_started.md) section of the Tutorial. In particular, you must have been able to build the firmware with [the `qmk compile` command](news_building_firmware#build-your-firmware).
|
Before starting, you must have followed the [Getting Started](newbs_getting_started.md) section of the Tutorial. In particular, you must have been able to build the firmware with [the `qmk compile` command](newbs_building_firmware.md#build-your-firmware).
|
||||||
|
|
||||||
## Java
|
## Java
|
||||||
Eclipse is a Java application, so you will need to install Java 8 or more recent to be able to run it. You may choose between the JRE or the JDK, the latter being useful if you intend to do Java development.
|
Eclipse is a Java application, so you will need to install Java 8 or more recent to be able to run it. You may choose between the JRE or the JDK, the latter being useful if you intend to do Java development.
|
||||||
|
|||||||
@@ -1,324 +0,0 @@
|
|||||||
/*
|
|
||||||
pins_arduino.h - Pin definition functions for Arduino
|
|
||||||
Part of Arduino - http://www.arduino.cc/
|
|
||||||
|
|
||||||
Copyright (c) 2007 David A. Mellis
|
|
||||||
|
|
||||||
This library is free software; you can redistribute it and/or
|
|
||||||
modify it under the terms of the GNU Lesser General Public
|
|
||||||
License as published by the Free Software Foundation; either
|
|
||||||
version 2.1 of the License, or (at your option) any later version.
|
|
||||||
|
|
||||||
This library 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
|
|
||||||
Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General
|
|
||||||
Public License along with this library; if not, write to the
|
|
||||||
Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
|
||||||
Boston, MA 02111-1307 USA
|
|
||||||
|
|
||||||
$Id: wiring.h 249 2007-02-03 16:52:51Z mellis $
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef Pins_Arduino_h
|
|
||||||
#define Pins_Arduino_h
|
|
||||||
|
|
||||||
#include <avr/pgmspace.h>
|
|
||||||
|
|
||||||
// Workaround for wrong definitions in "iom32u4.h".
|
|
||||||
// This should be fixed in the AVR toolchain.
|
|
||||||
#undef UHCON
|
|
||||||
#undef UHINT
|
|
||||||
#undef UHIEN
|
|
||||||
#undef UHADDR
|
|
||||||
#undef UHFNUM
|
|
||||||
#undef UHFNUML
|
|
||||||
#undef UHFNUMH
|
|
||||||
#undef UHFLEN
|
|
||||||
#undef UPINRQX
|
|
||||||
#undef UPINTX
|
|
||||||
#undef UPNUM
|
|
||||||
#undef UPRST
|
|
||||||
#undef UPCONX
|
|
||||||
#undef UPCFG0X
|
|
||||||
#undef UPCFG1X
|
|
||||||
#undef UPSTAX
|
|
||||||
#undef UPCFG2X
|
|
||||||
#undef UPIENX
|
|
||||||
#undef UPDATX
|
|
||||||
#undef TCCR2A
|
|
||||||
#undef WGM20
|
|
||||||
#undef WGM21
|
|
||||||
#undef COM2B0
|
|
||||||
#undef COM2B1
|
|
||||||
#undef COM2A0
|
|
||||||
#undef COM2A1
|
|
||||||
#undef TCCR2B
|
|
||||||
#undef CS20
|
|
||||||
#undef CS21
|
|
||||||
#undef CS22
|
|
||||||
#undef WGM22
|
|
||||||
#undef FOC2B
|
|
||||||
#undef FOC2A
|
|
||||||
#undef TCNT2
|
|
||||||
#undef TCNT2_0
|
|
||||||
#undef TCNT2_1
|
|
||||||
#undef TCNT2_2
|
|
||||||
#undef TCNT2_3
|
|
||||||
#undef TCNT2_4
|
|
||||||
#undef TCNT2_5
|
|
||||||
#undef TCNT2_6
|
|
||||||
#undef TCNT2_7
|
|
||||||
#undef OCR2A
|
|
||||||
#undef OCR2_0
|
|
||||||
#undef OCR2_1
|
|
||||||
#undef OCR2_2
|
|
||||||
#undef OCR2_3
|
|
||||||
#undef OCR2_4
|
|
||||||
#undef OCR2_5
|
|
||||||
#undef OCR2_6
|
|
||||||
#undef OCR2_7
|
|
||||||
#undef OCR2B
|
|
||||||
#undef OCR2_0
|
|
||||||
#undef OCR2_1
|
|
||||||
#undef OCR2_2
|
|
||||||
#undef OCR2_3
|
|
||||||
#undef OCR2_4
|
|
||||||
#undef OCR2_5
|
|
||||||
#undef OCR2_6
|
|
||||||
#undef OCR2_7
|
|
||||||
|
|
||||||
#define NUM_DIGITAL_PINS 30
|
|
||||||
#define NUM_ANALOG_INPUTS 12
|
|
||||||
|
|
||||||
#define TX_RX_LED_INIT DDRD |= (1 << 5), DDRB |= (1 << 0)
|
|
||||||
#define TXLED0 PORTD |= (1 << 5)
|
|
||||||
#define TXLED1 PORTD &= ~(1 << 5)
|
|
||||||
#define RXLED0 PORTB |= (1 << 0)
|
|
||||||
#define RXLED1 PORTB &= ~(1 << 0)
|
|
||||||
|
|
||||||
static const uint8_t SDA = 2;
|
|
||||||
static const uint8_t SCL = 3;
|
|
||||||
#define LED_BUILTIN 13
|
|
||||||
|
|
||||||
// Map SPI port to 'new' pins D14..D17
|
|
||||||
static const uint8_t SS = 17;
|
|
||||||
static const uint8_t MOSI = 16;
|
|
||||||
static const uint8_t MISO = 14;
|
|
||||||
static const uint8_t SCK = 15;
|
|
||||||
|
|
||||||
// Mapping of analog pins as digital I/O
|
|
||||||
// A6-A11 share with digital pins
|
|
||||||
static const uint8_t ADC0 = 18;
|
|
||||||
static const uint8_t ADC1 = 19;
|
|
||||||
static const uint8_t ADC2 = 20;
|
|
||||||
static const uint8_t ADC3 = 21;
|
|
||||||
static const uint8_t ADC4 = 22;
|
|
||||||
static const uint8_t ADC5 = 23;
|
|
||||||
static const uint8_t ADC6 = 24; // D4
|
|
||||||
static const uint8_t ADC7 = 25; // D6
|
|
||||||
static const uint8_t ADC8 = 26; // D8
|
|
||||||
static const uint8_t ADC9 = 27; // D9
|
|
||||||
static const uint8_t ADC10 = 28; // D10
|
|
||||||
static const uint8_t ADC11 = 29; // D12
|
|
||||||
|
|
||||||
#define digitalPinToPCICR(p) ((((p) >= 8 && (p) <= 11) || ((p) >= 14 && (p) <= 17) || ((p) >= A8 && (p) <= A10)) ? (&PCICR) : ((uint8_t *)0))
|
|
||||||
#define digitalPinToPCICRbit(p) 0
|
|
||||||
#define digitalPinToPCMSK(p) ((((p) >= 8 && (p) <= 11) || ((p) >= 14 && (p) <= 17) || ((p) >= A8 && (p) <= A10)) ? (&PCMSK0) : ((uint8_t *)0))
|
|
||||||
#define digitalPinToPCMSKbit(p) (((p) >= 8 && (p) <= 11) ? (p)-4 : ((p) == 14 ? 3 : ((p) == 15 ? 1 : ((p) == 16 ? 2 : ((p) == 17 ? 0 : (p - A8 + 4))))))
|
|
||||||
|
|
||||||
// __AVR_ATmega32U4__ has an unusual mapping of pins to channels
|
|
||||||
extern const uint8_t PROGMEM analog_pin_to_channel_PGM[];
|
|
||||||
#define analogPinToChannel(P) (pgm_read_byte(analog_pin_to_channel_PGM + (P)))
|
|
||||||
|
|
||||||
#define digitalPinToInterrupt(p) ((p) == 0 ? 2 : ((p) == 1 ? 3 : ((p) == 2 ? 1 : ((p) == 3 ? 0 : ((p) == 7 ? 4 : NOT_AN_INTERRUPT)))))
|
|
||||||
|
|
||||||
#ifdef ARDUINO_MAIN
|
|
||||||
|
|
||||||
// On the Arduino board, digital pins are also used
|
|
||||||
// for the analog output (software PWM). Analog input
|
|
||||||
// pins are a separate set.
|
|
||||||
|
|
||||||
// ATMEL ATMEGA32U4 / ARDUINO LEONARDO
|
|
||||||
//
|
|
||||||
// D0 PD2 RXD1/INT2
|
|
||||||
// D1 PD3 TXD1/INT3
|
|
||||||
// D2 PD1 SDA SDA/INT1
|
|
||||||
// D3# PD0 PWM8/SCL OC0B/SCL/INT0
|
|
||||||
// D4 A6 PD4 ADC8
|
|
||||||
// D5# PC6 ??? OC3A/#OC4A
|
|
||||||
// D6# A7 PD7 FastPWM #OC4D/ADC10
|
|
||||||
// D7 PE6 INT6/AIN0
|
|
||||||
//
|
|
||||||
// D8 A8 PB4 ADC11/PCINT4
|
|
||||||
// D9# A9 PB5 PWM16 OC1A/#OC4B/ADC12/PCINT5
|
|
||||||
// D10# A10 PB6 PWM16 OC1B/0c4B/ADC13/PCINT6
|
|
||||||
// D11# PB7 PWM8/16 0C0A/OC1C/#RTS/PCINT7
|
|
||||||
// D12 A11 PD6 T1/#OC4D/ADC9
|
|
||||||
// D13# PC7 PWM10 CLK0/OC4A
|
|
||||||
//
|
|
||||||
// A0 D18 PF7 ADC7
|
|
||||||
// A1 D19 PF6 ADC6
|
|
||||||
// A2 D20 PF5 ADC5
|
|
||||||
// A3 D21 PF4 ADC4
|
|
||||||
// A4 D22 PF1 ADC1
|
|
||||||
// A5 D23 PF0 ADC0
|
|
||||||
//
|
|
||||||
// New pins D14..D17 to map SPI port to digital pins
|
|
||||||
//
|
|
||||||
// MISO D14 PB3 MISO,PCINT3
|
|
||||||
// SCK D15 PB1 SCK,PCINT1
|
|
||||||
// MOSI D16 PB2 MOSI,PCINT2
|
|
||||||
// SS D17 PB0 RXLED,SS/PCINT0
|
|
||||||
//
|
|
||||||
// Connected LEDs on board for TX and RX
|
|
||||||
// TXLED D24 PD5 XCK1
|
|
||||||
// RXLED D17 PB0
|
|
||||||
// HWB PE2 HWB
|
|
||||||
|
|
||||||
// these arrays map port names (e.g. port B) to the
|
|
||||||
// appropriate addresses for various functions (e.g. reading
|
|
||||||
// and writing)
|
|
||||||
const uint16_t PROGMEM port_to_mode_PGM[] = {
|
|
||||||
NOT_A_PORT, NOT_A_PORT, (uint16_t)&DDRB, (uint16_t)&DDRC, (uint16_t)&DDRD, (uint16_t)&DDRE, (uint16_t)&DDRF,
|
|
||||||
};
|
|
||||||
|
|
||||||
const uint16_t PROGMEM port_to_output_PGM[] = {
|
|
||||||
NOT_A_PORT, NOT_A_PORT, (uint16_t)&PORTB, (uint16_t)&PORTC, (uint16_t)&PORTD, (uint16_t)&PORTE, (uint16_t)&PORTF,
|
|
||||||
};
|
|
||||||
|
|
||||||
const uint16_t PROGMEM port_to_input_PGM[] = {
|
|
||||||
NOT_A_PORT, NOT_A_PORT, (uint16_t)&PINB, (uint16_t)&PINC, (uint16_t)&PIND, (uint16_t)&PINE, (uint16_t)&PINF,
|
|
||||||
};
|
|
||||||
|
|
||||||
const uint8_t PROGMEM digital_pin_to_port_PGM[] = {
|
|
||||||
PD, // D0 - PD2
|
|
||||||
PD, // D1 - PD3
|
|
||||||
PD, // D2 - PD1
|
|
||||||
PD, // D3 - PD0
|
|
||||||
PD, // D4 - PD4
|
|
||||||
PC, // D5 - PC6
|
|
||||||
PD, // D6 - PD7
|
|
||||||
PE, // D7 - PE6
|
|
||||||
|
|
||||||
PB, // D8 - PB4
|
|
||||||
PB, // D9 - PB5
|
|
||||||
PB, // D10 - PB6
|
|
||||||
PB, // D11 - PB7
|
|
||||||
PD, // D12 - PD6
|
|
||||||
PC, // D13 - PC7
|
|
||||||
|
|
||||||
PB, // D14 - MISO - PB3
|
|
||||||
PB, // D15 - SCK - PB1
|
|
||||||
PB, // D16 - MOSI - PB2
|
|
||||||
PB, // D17 - SS - PB0
|
|
||||||
|
|
||||||
PF, // D18 - A0 - PF7
|
|
||||||
PF, // D19 - A1 - PF6
|
|
||||||
PF, // D20 - A2 - PF5
|
|
||||||
PF, // D21 - A3 - PF4
|
|
||||||
PF, // D22 - A4 - PF1
|
|
||||||
PF, // D23 - A5 - PF0
|
|
||||||
|
|
||||||
PD, // D24 - PD5
|
|
||||||
PD, // D25 / D6 - A7 - PD7
|
|
||||||
PB, // D26 / D8 - A8 - PB4
|
|
||||||
PB, // D27 / D9 - A9 - PB5
|
|
||||||
PB, // D28 / D10 - A10 - PB6
|
|
||||||
PD, // D29 / D12 - A11 - PD6
|
|
||||||
};
|
|
||||||
|
|
||||||
const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[] = {
|
|
||||||
_BV(2), // D0 - PD2
|
|
||||||
_BV(3), // D1 - PD3
|
|
||||||
_BV(1), // D2 - PD1
|
|
||||||
_BV(0), // D3 - PD0
|
|
||||||
_BV(4), // D4 - PD4
|
|
||||||
_BV(6), // D5 - PC6
|
|
||||||
_BV(7), // D6 - PD7
|
|
||||||
_BV(6), // D7 - PE6
|
|
||||||
|
|
||||||
_BV(4), // D8 - PB4
|
|
||||||
_BV(5), // D9 - PB5
|
|
||||||
_BV(6), // D10 - PB6
|
|
||||||
_BV(7), // D11 - PB7
|
|
||||||
_BV(6), // D12 - PD6
|
|
||||||
_BV(7), // D13 - PC7
|
|
||||||
|
|
||||||
_BV(3), // D14 - MISO - PB3
|
|
||||||
_BV(1), // D15 - SCK - PB1
|
|
||||||
_BV(2), // D16 - MOSI - PB2
|
|
||||||
_BV(0), // D17 - SS - PB0
|
|
||||||
|
|
||||||
_BV(7), // D18 - A0 - PF7
|
|
||||||
_BV(6), // D19 - A1 - PF6
|
|
||||||
_BV(5), // D20 - A2 - PF5
|
|
||||||
_BV(4), // D21 - A3 - PF4
|
|
||||||
_BV(1), // D22 - A4 - PF1
|
|
||||||
_BV(0), // D23 - A5 - PF0
|
|
||||||
|
|
||||||
_BV(5), // D24 - PD5
|
|
||||||
_BV(7), // D25 / D6 - A7 - PD7
|
|
||||||
_BV(4), // D26 / D8 - A8 - PB4
|
|
||||||
_BV(5), // D27 / D9 - A9 - PB5
|
|
||||||
_BV(6), // D28 / D10 - A10 - PB6
|
|
||||||
_BV(6), // D29 / D12 - A11 - PD6
|
|
||||||
};
|
|
||||||
|
|
||||||
const uint8_t PROGMEM digital_pin_to_timer_PGM[] = {
|
|
||||||
NOT_ON_TIMER, NOT_ON_TIMER, NOT_ON_TIMER, TIMER0B, /* 3 */
|
|
||||||
NOT_ON_TIMER, TIMER3A, /* 5 */
|
|
||||||
TIMER4D, /* 6 */
|
|
||||||
NOT_ON_TIMER,
|
|
||||||
|
|
||||||
NOT_ON_TIMER, TIMER1A, /* 9 */
|
|
||||||
TIMER1B, /* 10 */
|
|
||||||
TIMER0A, /* 11 */
|
|
||||||
|
|
||||||
NOT_ON_TIMER, TIMER4A, /* 13 */
|
|
||||||
|
|
||||||
NOT_ON_TIMER, NOT_ON_TIMER, NOT_ON_TIMER, NOT_ON_TIMER, NOT_ON_TIMER, NOT_ON_TIMER,
|
|
||||||
|
|
||||||
NOT_ON_TIMER, NOT_ON_TIMER, NOT_ON_TIMER, NOT_ON_TIMER, NOT_ON_TIMER, NOT_ON_TIMER, NOT_ON_TIMER, NOT_ON_TIMER, NOT_ON_TIMER, NOT_ON_TIMER,
|
|
||||||
};
|
|
||||||
|
|
||||||
const uint8_t PROGMEM analog_pin_to_channel_PGM[] = {
|
|
||||||
7, // A0 PF7 ADC7
|
|
||||||
6, // A1 PF6 ADC6
|
|
||||||
5, // A2 PF5 ADC5
|
|
||||||
4, // A3 PF4 ADC4
|
|
||||||
1, // A4 PF1 ADC1
|
|
||||||
0, // A5 PF0 ADC0
|
|
||||||
8, // A6 D4 PD4 ADC8
|
|
||||||
10, // A7 D6 PD7 ADC10
|
|
||||||
11, // A8 D8 PB4 ADC11
|
|
||||||
12, // A9 D9 PB5 ADC12
|
|
||||||
13, // A10 D10 PB6 ADC13
|
|
||||||
9 // A11 D12 PD6 ADC9
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif /* ARDUINO_MAIN */
|
|
||||||
|
|
||||||
// These serial port names are intended to allow libraries and architecture-neutral
|
|
||||||
// sketches to automatically default to the correct port name for a particular type
|
|
||||||
// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
|
|
||||||
// the first hardware serial port whose RX/TX pins are not dedicated to another use.
|
|
||||||
//
|
|
||||||
// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor
|
|
||||||
//
|
|
||||||
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
|
|
||||||
//
|
|
||||||
// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
|
|
||||||
//
|
|
||||||
// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins.
|
|
||||||
//
|
|
||||||
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
|
|
||||||
// pins are NOT connected to anything by default.
|
|
||||||
#define SERIAL_PORT_MONITOR Serial
|
|
||||||
#define SERIAL_PORT_USBVIRTUAL Serial
|
|
||||||
#define SERIAL_PORT_HARDWARE Serial1
|
|
||||||
#define SERIAL_PORT_HARDWARE_OPEN Serial1
|
|
||||||
|
|
||||||
#endif /* Pins_Arduino_h */
|
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
/* Copyright 2020 nickolaij
|
||||||
|
*
|
||||||
|
* 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 "abacus.h"
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
/* Copyright 2020 nickolaij
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
|
||||||
|
|
||||||
|
/* This is a shortcut to help you visually see your layout.
|
||||||
|
*
|
||||||
|
* The first section contains all of the arguments representing the physical
|
||||||
|
* layout of the board and position of the keys.
|
||||||
|
*
|
||||||
|
* The second converts the arguments into a two-dimensional array which
|
||||||
|
* represents the switch matrix.
|
||||||
|
*/
|
||||||
|
#define LAYOUT( \
|
||||||
|
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \
|
||||||
|
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \
|
||||||
|
k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \
|
||||||
|
k30, k31, k32, k33, k34, k35, k36, k37, k38 \
|
||||||
|
) \
|
||||||
|
{ \
|
||||||
|
{ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \
|
||||||
|
{ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \
|
||||||
|
{ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \
|
||||||
|
{ k30, k31, k32, k33, XXX, XXX, k34, XXX, k35, k36, k37, k38} \
|
||||||
|
}
|
||||||
@@ -0,0 +1,133 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2020 nickolaij
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "config_common.h"
|
||||||
|
|
||||||
|
/* USB Device descriptor parameter */
|
||||||
|
#define VENDOR_ID 0xFEED
|
||||||
|
#define PRODUCT_ID 0x0000
|
||||||
|
#define DEVICE_VER 0x0001
|
||||||
|
#define MANUFACTURER nickolaij
|
||||||
|
#define PRODUCT abacus
|
||||||
|
#define DESCRIPTION A first attempt at a custom keyboard
|
||||||
|
|
||||||
|
/* key matrix size */
|
||||||
|
#define MATRIX_ROWS 4
|
||||||
|
#define MATRIX_COLS 12
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Keyboard Matrix Assignments
|
||||||
|
*
|
||||||
|
* Change this to how you wired your keyboard
|
||||||
|
* COLS: AVR pins used for columns, left to right
|
||||||
|
* ROWS: AVR pins used for rows, top to bottom
|
||||||
|
* DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
|
||||||
|
* ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#define MATRIX_ROW_PINS { D3, D2, D4, C6 }
|
||||||
|
#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, D7, B3, E6, B2, B4, B6, B5}
|
||||||
|
#define UNUSED_PINS {B0}
|
||||||
|
|
||||||
|
#define DIP_SWITCH_PINS { D0 }
|
||||||
|
|
||||||
|
#define ENCODERS_PAD_A { F1 }
|
||||||
|
#define ENCODERS_PAD_B { F0 }
|
||||||
|
#define ENCODER_RESOLUTION 4
|
||||||
|
|
||||||
|
/* COL2ROW, ROW2COL*/
|
||||||
|
#define DIODE_DIRECTION COL2ROW
|
||||||
|
#define RGB_DI_PIN D1
|
||||||
|
|
||||||
|
#ifdef RGB_DI_PIN
|
||||||
|
# define RGBLED_NUM 17
|
||||||
|
# define RGBLIGHT_HUE_STEP 8
|
||||||
|
# define RGBLIGHT_SAT_STEP 8
|
||||||
|
# define RGBLIGHT_VAL_STEP 8
|
||||||
|
# define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */
|
||||||
|
# define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */
|
||||||
|
/*== choose animations ==*/
|
||||||
|
# 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_STATIC_GRADIENT
|
||||||
|
/*== customize breathing effect ==*/
|
||||||
|
/*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/
|
||||||
|
# define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64
|
||||||
|
/*==== use exp() and sin() ====*/
|
||||||
|
# define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7
|
||||||
|
# define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
|
||||||
|
#define DEBOUNCE 5
|
||||||
|
|
||||||
|
/* define if matrix has ghost (lacks anti-ghosting diodes) */
|
||||||
|
//#define MATRIX_HAS_GHOST
|
||||||
|
|
||||||
|
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
||||||
|
#define LOCKING_SUPPORT_ENABLE
|
||||||
|
/* Locking resynchronize hack */
|
||||||
|
#define LOCKING_RESYNC_ENABLE
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 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
|
||||||
|
|
||||||
|
/* disable these deprecated features by default */
|
||||||
|
#ifndef LINK_TIME_OPTIMIZATION_ENABLE
|
||||||
|
#define NO_ACTION_MACRO
|
||||||
|
#define NO_ACTION_FUNCTION
|
||||||
|
#endif
|
||||||
|
/*
|
||||||
|
* MIDI options
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Prevent use of disabled MIDI features in the keymap */
|
||||||
|
//#define MIDI_ENABLE_STRICT 1
|
||||||
|
|
||||||
|
/* enable basic MIDI features:
|
||||||
|
- MIDI notes can be sent when in Music mode is on
|
||||||
|
*/
|
||||||
|
//#define MIDI_BASIC
|
||||||
|
|
||||||
|
/* enable advanced MIDI features:
|
||||||
|
- MIDI notes can be added to the keymap
|
||||||
|
- Octave shift and transpose
|
||||||
|
- Virtual sustain, portamento, and modulation wheel
|
||||||
|
- etc.
|
||||||
|
*/
|
||||||
|
//#define MIDI_ADVANCED
|
||||||
|
|
||||||
|
/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
|
||||||
|
//#define MIDI_TONE_KEYCODE_OCTAVES 1
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
{
|
||||||
|
"keyboard_name": "Abacus",
|
||||||
|
"url": "https://www.github.com/nickolaij",
|
||||||
|
"maintainer": "nickolaij",
|
||||||
|
"width": 12.75,
|
||||||
|
"height": 4,
|
||||||
|
"layouts": {
|
||||||
|
"LAYOUT": {
|
||||||
|
"key_count": 45,
|
||||||
|
"layout": [
|
||||||
|
{"label":"k00", "x":0, "y":0, "w":1},
|
||||||
|
{"label":"k01", "x":1, "y":0, "w":1},
|
||||||
|
{"label":"k02", "x":2, "y":0, "w":1},
|
||||||
|
{"label":"k03", "x":3, "y":0, "w":1},
|
||||||
|
{"label":"k04", "x":4, "y":0, "w":1},
|
||||||
|
{"label":"k05", "x":5, "y":0, "w":1},
|
||||||
|
{"label":"k06", "x":6, "y":0, "w":1},
|
||||||
|
{"label":"k07", "x":7, "y":0, "w":1},
|
||||||
|
{"label":"k08", "x":8, "y":0, "w":1},
|
||||||
|
{"label":"k09", "x":9, "y":0, "w":1},
|
||||||
|
{"label":"k0a", "x":10, "y":0, "w":1},
|
||||||
|
{"label":"k0b", "x":11, "y":0, "w":1.75},
|
||||||
|
|
||||||
|
{"label":"k10", "x":0, "y":1, "w":1.25},
|
||||||
|
{"label":"k11", "x":1.25, "y":1, "w":1},
|
||||||
|
{"label":"k12", "x":2.25, "y":1, "w":1},
|
||||||
|
{"label":"k13", "x":3.25, "y":1, "w":1},
|
||||||
|
{"label":"k14", "x":4.25, "y":1, "w":1},
|
||||||
|
{"label":"k15", "x":5.25, "y":1, "w":1},
|
||||||
|
{"label":"k16", "x":6.25, "y":1, "w":1},
|
||||||
|
{"label":"k17", "x":7.25, "y":1, "w":1},
|
||||||
|
{"label":"k18", "x":8.25, "y":1, "w":1},
|
||||||
|
{"label":"k19", "x":9.25, "y":1, "w":1},
|
||||||
|
{"label":"k1a", "x":10.25, "y":1, "w":1},
|
||||||
|
{"label":"k1b", "x":11.25, "y":1, "w":1.5},
|
||||||
|
|
||||||
|
{"label":"k20", "x":0, "y":2, "w":1.75},
|
||||||
|
{"label":"k21", "x":1.75, "y":2, "w":1},
|
||||||
|
{"label":"k22", "x":2.75, "y":2, "w":1},
|
||||||
|
{"label":"k23", "x":3.75, "y":2, "w":1},
|
||||||
|
{"label":"k24", "x":4.75, "y":2, "w":1},
|
||||||
|
{"label":"k25", "x":5.75, "y":2, "w":1},
|
||||||
|
{"label":"k26", "x":6.75, "y":2, "w":1},
|
||||||
|
{"label":"k27", "x":7.75, "y":2, "w":1},
|
||||||
|
{"label":"k28", "x":8.75, "y":2, "w":1},
|
||||||
|
{"label":"k29", "x":9.75, "y":2, "w":1},
|
||||||
|
{"label":"k2a", "x":10.75, "y":2, "w":1},
|
||||||
|
{"label":"k2b", "x":11.75, "y":2, "w":1},
|
||||||
|
|
||||||
|
{"label":"k30", "x":0, "y":3, "w":1.25},
|
||||||
|
{"label":"k31", "x":1.25, "y":3, "w":1},
|
||||||
|
{"label":"k32", "x":2.25, "y":3, "w":1},
|
||||||
|
{"label":"k33", "x":3.25, "y":3, "w":2.75},
|
||||||
|
{"label":"k34", "x":6, "y":3, "w":2.75},
|
||||||
|
{"label":"k35", "x":8.75, "y":3, "w":1},
|
||||||
|
{"label":"k36", "x":9.75, "y":3, "w":1},
|
||||||
|
{"label":"k37", "x":10.75, "y":3, "w":1},
|
||||||
|
{"label":"k38", "x":11.75, "y":3, "w":1}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,148 @@
|
|||||||
|
/* Copyright 2020 nickolaij
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
|
||||||
|
// wait DELAY ms before unregistering media keys
|
||||||
|
#define MEDIA_KEY_DELAY 10
|
||||||
|
|
||||||
|
// Defines names for use in layer keycodes and the keymap
|
||||||
|
enum layer_names {
|
||||||
|
_BASE,
|
||||||
|
_UPPER,
|
||||||
|
_LOWER
|
||||||
|
};
|
||||||
|
|
||||||
|
// Defines the keycodes used by our macros in process_record_user
|
||||||
|
enum custom_keycodes {
|
||||||
|
NICKURL = SAFE_RANGE,
|
||||||
|
ALTTAB
|
||||||
|
};
|
||||||
|
|
||||||
|
enum unicode_names {
|
||||||
|
LOVEEYES,
|
||||||
|
THINK,
|
||||||
|
UPSIDEDOWN,
|
||||||
|
NOMOUTH,
|
||||||
|
PARTY,
|
||||||
|
HEART,
|
||||||
|
EGGPLANT,
|
||||||
|
PEACH,
|
||||||
|
EMOJI100,
|
||||||
|
EMOJIB
|
||||||
|
};
|
||||||
|
|
||||||
|
const uint32_t PROGMEM unicode_map[] = {
|
||||||
|
[LOVEEYES] = 0x1f60d,
|
||||||
|
[THINK] = 0x1f914,
|
||||||
|
[UPSIDEDOWN] = 0x1f643,
|
||||||
|
[NOMOUTH] = 0x1f636,
|
||||||
|
[PARTY] = 0x1f973,
|
||||||
|
[HEART] = 0x1f495,
|
||||||
|
[EMOJI100] = 0x1f4af,
|
||||||
|
[PEACH] = 0x1f351,
|
||||||
|
[EGGPLANT] = 0x1f346,
|
||||||
|
[EMOJIB] = 0x1f171
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
/* Base */
|
||||||
|
[_BASE] = LAYOUT(
|
||||||
|
KC_ESCAPE, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPACE,
|
||||||
|
KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCOLON, KC_BSLASH,
|
||||||
|
KC_LSHIFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMMA, KC_DOT, KC_UP, KC_DELETE,
|
||||||
|
KC_LCTRL, KC_LGUI, MO(_UPPER), KC_SPACE, KC_ENTER, MO(_LOWER), KC_LEFT, KC_DOWN, KC_RIGHT
|
||||||
|
),
|
||||||
|
[_UPPER] = LAYOUT(
|
||||||
|
KC_GRAVE, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______,
|
||||||
|
ALTTAB, _______, _______, _______, _______, _______, _______, _______, KC_LBRACKET, KC_RBRACKET, KC_QUOTE, KC_SLASH,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, KC_MINUS, KC_EQUAL, _______, _______,
|
||||||
|
KC_LALT, _______, _______, _______, _______, _______, KC_HOME, _______, KC_END
|
||||||
|
),
|
||||||
|
[_LOWER] = LAYOUT(
|
||||||
|
NICKURL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______,
|
||||||
|
_______, KC_F11, KC_F12, RGB_MODE_PLAIN, RGB_MODE_BREATHE, RGB_MODE_RAINBOW, RGB_MODE_SWIRL, RGB_MODE_SNAKE, RGB_MODE_KNIGHT, RGB_MODE_GRADIENT, XXXXXXX, RGB_TOG,
|
||||||
|
_______, X(LOVEEYES), X(THINK), X(UPSIDEDOWN), X(NOMOUTH), X(PARTY), X(PEACH), X(HEART), X(EGGPLANT), X(EMOJI100), X(EMOJIB), RGB_HUI,
|
||||||
|
KC_CAPS, _______, _______, _______, _______, _______, _______, _______, _______
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
switch (keycode) {
|
||||||
|
case NICKURL:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
SEND_STRING("https://www.github.com/nickolaij");
|
||||||
|
} else {
|
||||||
|
tap_code(KC_ENTER);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ALTTAB:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
tap_code16(A(KC_TAB));
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return true;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void dip_switch_update_user(uint8_t index, bool active) {
|
||||||
|
switch (index) {
|
||||||
|
case 0:
|
||||||
|
if(active) {
|
||||||
|
switch(get_highest_layer(layer_state)) {
|
||||||
|
case _BASE:
|
||||||
|
tap_code16(LCTL(KC_F));
|
||||||
|
break;
|
||||||
|
case _UPPER:
|
||||||
|
tap_code(KC_MUTE);
|
||||||
|
break;
|
||||||
|
case _LOWER:
|
||||||
|
tap_code(KC_MEDIA_PLAY_PAUSE);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void matrix_init_user(void) {
|
||||||
|
set_unicode_input_mode(UC_WINC);
|
||||||
|
}
|
||||||
|
|
||||||
|
void encoder_update_user(uint8_t index, bool clockwise) {
|
||||||
|
|
||||||
|
switch(get_highest_layer(layer_state)) {
|
||||||
|
case _BASE:
|
||||||
|
clockwise ? tap_code(KC_PGDN) : tap_code(KC_PGUP);
|
||||||
|
break;
|
||||||
|
case _UPPER:
|
||||||
|
clockwise ? tap_code(KC_VOLU) : tap_code(KC_VOLD);
|
||||||
|
break;
|
||||||
|
case _LOWER:
|
||||||
|
clockwise ? tap_code(KC_MEDIA_NEXT_TRACK) : tap_code(KC_MEDIA_PREV_TRACK);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
# The default keymap for Abacus
|
||||||
|
|
||||||
|
This is made based on my first few days of playing with it and honing in on what feels right.
|
||||||
|
I've repurposed the DIP switch function for the encoder switches and added some functionality for multiple layers also effecting the encoders output.
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
# Abacus
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
A first attempt at a PCB design for a mechanical keyboard. Includes rotary encoder and RGB underglow.
|
||||||
|
|
||||||
|
* Keyboard Maintainer: [nickolaij](https://github.com/nickolaij)
|
||||||
|
* Hardware Supported: Abacus PCB, [Elite C Microcontroller](https://keeb.io/products/elite-c-usb-c-pro-micro-replacement-arduino-compatible-atmega32u4) or Pro Micro Microcontroller (Elite C has additional pins for encoder)
|
||||||
|
* Hardware Availability: [Abacus PCB Github](https://github.com/nickolaij/Abacus_Rev2)
|
||||||
|
|
||||||
|
Make example for this keyboard (after setting up your build environment):
|
||||||
|
|
||||||
|
make abacus:default
|
||||||
|
|
||||||
|
See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
# MCU name
|
||||||
|
MCU = atmega32u4
|
||||||
|
|
||||||
|
# Bootloader selection
|
||||||
|
# Teensy halfkay
|
||||||
|
# Pro Micro caterina
|
||||||
|
# Atmel DFU atmel-dfu
|
||||||
|
# LUFA DFU lufa-dfu
|
||||||
|
# QMK DFU qmk-dfu
|
||||||
|
# ATmega32A bootloadHID
|
||||||
|
# ATmega328P USBasp
|
||||||
|
BOOTLOADER = atmel-dfu
|
||||||
|
|
||||||
|
# Build Options
|
||||||
|
# change yes to no to disable
|
||||||
|
#
|
||||||
|
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration
|
||||||
|
MOUSEKEY_ENABLE = no # Mouse keys
|
||||||
|
EXTRAKEY_ENABLE = yes # Audio control and System control
|
||||||
|
CONSOLE_ENABLE = yes # Console for debug
|
||||||
|
COMMAND_ENABLE = yes # Commands for debug and configuration
|
||||||
|
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||||
|
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||||
|
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||||
|
NKRO_ENABLE = no # USB Nkey Rollover
|
||||||
|
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
|
||||||
|
RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
|
||||||
|
MIDI_ENABLE = no # MIDI support
|
||||||
|
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||||
|
AUDIO_ENABLE = no # Audio output on port C6
|
||||||
|
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
|
||||||
|
HD44780_ENABLE = no # Enable support for HD44780 based LCDs
|
||||||
|
UNICODEMAP_ENABLE = yes
|
||||||
|
ENCODER_ENABLE = yes
|
||||||
|
DIP_SWITCH_ENABLE = yes
|
||||||
|
LTO_ENABLE = yes
|
||||||
@@ -1,268 +0,0 @@
|
|||||||
/*
|
|
||||||
ChibiOS - Copyright (C) 2006..2018 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* This file has been automatically generated using ChibiStudio board
|
|
||||||
* generator plugin. Do not edit manually.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "hal.h"
|
|
||||||
#include "stm32_gpio.h"
|
|
||||||
|
|
||||||
/*===========================================================================*/
|
|
||||||
/* Driver local definitions. */
|
|
||||||
/*===========================================================================*/
|
|
||||||
|
|
||||||
/*===========================================================================*/
|
|
||||||
/* Driver exported variables. */
|
|
||||||
/*===========================================================================*/
|
|
||||||
|
|
||||||
/*===========================================================================*/
|
|
||||||
/* Driver local variables and types. */
|
|
||||||
/*===========================================================================*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Type of STM32 GPIO port setup.
|
|
||||||
*/
|
|
||||||
typedef struct {
|
|
||||||
uint32_t moder;
|
|
||||||
uint32_t otyper;
|
|
||||||
uint32_t ospeedr;
|
|
||||||
uint32_t pupdr;
|
|
||||||
uint32_t odr;
|
|
||||||
uint32_t afrl;
|
|
||||||
uint32_t afrh;
|
|
||||||
} gpio_setup_t;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Type of STM32 GPIO initialization data.
|
|
||||||
*/
|
|
||||||
typedef struct {
|
|
||||||
#if STM32_HAS_GPIOA || defined(__DOXYGEN__)
|
|
||||||
gpio_setup_t PAData;
|
|
||||||
#endif
|
|
||||||
#if STM32_HAS_GPIOB || defined(__DOXYGEN__)
|
|
||||||
gpio_setup_t PBData;
|
|
||||||
#endif
|
|
||||||
#if STM32_HAS_GPIOC || defined(__DOXYGEN__)
|
|
||||||
gpio_setup_t PCData;
|
|
||||||
#endif
|
|
||||||
#if STM32_HAS_GPIOD || defined(__DOXYGEN__)
|
|
||||||
gpio_setup_t PDData;
|
|
||||||
#endif
|
|
||||||
#if STM32_HAS_GPIOE || defined(__DOXYGEN__)
|
|
||||||
gpio_setup_t PEData;
|
|
||||||
#endif
|
|
||||||
#if STM32_HAS_GPIOF || defined(__DOXYGEN__)
|
|
||||||
gpio_setup_t PFData;
|
|
||||||
#endif
|
|
||||||
#if STM32_HAS_GPIOG || defined(__DOXYGEN__)
|
|
||||||
gpio_setup_t PGData;
|
|
||||||
#endif
|
|
||||||
#if STM32_HAS_GPIOH || defined(__DOXYGEN__)
|
|
||||||
gpio_setup_t PHData;
|
|
||||||
#endif
|
|
||||||
#if STM32_HAS_GPIOI || defined(__DOXYGEN__)
|
|
||||||
gpio_setup_t PIData;
|
|
||||||
#endif
|
|
||||||
#if STM32_HAS_GPIOJ || defined(__DOXYGEN__)
|
|
||||||
gpio_setup_t PJData;
|
|
||||||
#endif
|
|
||||||
#if STM32_HAS_GPIOK || defined(__DOXYGEN__)
|
|
||||||
gpio_setup_t PKData;
|
|
||||||
#endif
|
|
||||||
} gpio_config_t;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief STM32 GPIO static initialization data.
|
|
||||||
*/
|
|
||||||
static const gpio_config_t gpio_default_config = {
|
|
||||||
#if STM32_HAS_GPIOA
|
|
||||||
{VAL_GPIOA_MODER, VAL_GPIOA_OTYPER, VAL_GPIOA_OSPEEDR, VAL_GPIOA_PUPDR,
|
|
||||||
VAL_GPIOA_ODR, VAL_GPIOA_AFRL, VAL_GPIOA_AFRH},
|
|
||||||
#endif
|
|
||||||
#if STM32_HAS_GPIOB
|
|
||||||
{VAL_GPIOB_MODER, VAL_GPIOB_OTYPER, VAL_GPIOB_OSPEEDR, VAL_GPIOB_PUPDR,
|
|
||||||
VAL_GPIOB_ODR, VAL_GPIOB_AFRL, VAL_GPIOB_AFRH},
|
|
||||||
#endif
|
|
||||||
#if STM32_HAS_GPIOC
|
|
||||||
{VAL_GPIOC_MODER, VAL_GPIOC_OTYPER, VAL_GPIOC_OSPEEDR, VAL_GPIOC_PUPDR,
|
|
||||||
VAL_GPIOC_ODR, VAL_GPIOC_AFRL, VAL_GPIOC_AFRH},
|
|
||||||
#endif
|
|
||||||
#if STM32_HAS_GPIOD
|
|
||||||
{VAL_GPIOD_MODER, VAL_GPIOD_OTYPER, VAL_GPIOD_OSPEEDR, VAL_GPIOD_PUPDR,
|
|
||||||
VAL_GPIOD_ODR, VAL_GPIOD_AFRL, VAL_GPIOD_AFRH},
|
|
||||||
#endif
|
|
||||||
#if STM32_HAS_GPIOE
|
|
||||||
{VAL_GPIOE_MODER, VAL_GPIOE_OTYPER, VAL_GPIOE_OSPEEDR, VAL_GPIOE_PUPDR,
|
|
||||||
VAL_GPIOE_ODR, VAL_GPIOE_AFRL, VAL_GPIOE_AFRH},
|
|
||||||
#endif
|
|
||||||
#if STM32_HAS_GPIOF
|
|
||||||
{VAL_GPIOF_MODER, VAL_GPIOF_OTYPER, VAL_GPIOF_OSPEEDR, VAL_GPIOF_PUPDR,
|
|
||||||
VAL_GPIOF_ODR, VAL_GPIOF_AFRL, VAL_GPIOF_AFRH},
|
|
||||||
#endif
|
|
||||||
#if STM32_HAS_GPIOG
|
|
||||||
{VAL_GPIOG_MODER, VAL_GPIOG_OTYPER, VAL_GPIOG_OSPEEDR, VAL_GPIOG_PUPDR,
|
|
||||||
VAL_GPIOG_ODR, VAL_GPIOG_AFRL, VAL_GPIOG_AFRH},
|
|
||||||
#endif
|
|
||||||
#if STM32_HAS_GPIOH
|
|
||||||
{VAL_GPIOH_MODER, VAL_GPIOH_OTYPER, VAL_GPIOH_OSPEEDR, VAL_GPIOH_PUPDR,
|
|
||||||
VAL_GPIOH_ODR, VAL_GPIOH_AFRL, VAL_GPIOH_AFRH},
|
|
||||||
#endif
|
|
||||||
#if STM32_HAS_GPIOI
|
|
||||||
{VAL_GPIOI_MODER, VAL_GPIOI_OTYPER, VAL_GPIOI_OSPEEDR, VAL_GPIOI_PUPDR,
|
|
||||||
VAL_GPIOI_ODR, VAL_GPIOI_AFRL, VAL_GPIOI_AFRH},
|
|
||||||
#endif
|
|
||||||
#if STM32_HAS_GPIOJ
|
|
||||||
{VAL_GPIOJ_MODER, VAL_GPIOJ_OTYPER, VAL_GPIOJ_OSPEEDR, VAL_GPIOJ_PUPDR,
|
|
||||||
VAL_GPIOJ_ODR, VAL_GPIOJ_AFRL, VAL_GPIOJ_AFRH},
|
|
||||||
#endif
|
|
||||||
#if STM32_HAS_GPIOK
|
|
||||||
{VAL_GPIOK_MODER, VAL_GPIOK_OTYPER, VAL_GPIOK_OSPEEDR, VAL_GPIOK_PUPDR,
|
|
||||||
VAL_GPIOK_ODR, VAL_GPIOK_AFRL, VAL_GPIOK_AFRH}
|
|
||||||
#endif
|
|
||||||
};
|
|
||||||
|
|
||||||
/*===========================================================================*/
|
|
||||||
/* Driver local functions. */
|
|
||||||
/*===========================================================================*/
|
|
||||||
|
|
||||||
static void gpio_init(stm32_gpio_t *gpiop, const gpio_setup_t *config) {
|
|
||||||
|
|
||||||
gpiop->OTYPER = config->otyper;
|
|
||||||
gpiop->OSPEEDR = config->ospeedr;
|
|
||||||
gpiop->PUPDR = config->pupdr;
|
|
||||||
gpiop->ODR = config->odr;
|
|
||||||
gpiop->AFRL = config->afrl;
|
|
||||||
gpiop->AFRH = config->afrh;
|
|
||||||
gpiop->MODER = config->moder;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void stm32_gpio_init(void) {
|
|
||||||
|
|
||||||
/* Enabling GPIO-related clocks, the mask comes from the
|
|
||||||
registry header file.*/
|
|
||||||
rccResetAHB(STM32_GPIO_EN_MASK);
|
|
||||||
rccEnableAHB(STM32_GPIO_EN_MASK, true);
|
|
||||||
|
|
||||||
/* Initializing all the defined GPIO ports.*/
|
|
||||||
#if STM32_HAS_GPIOA
|
|
||||||
gpio_init(GPIOA, &gpio_default_config.PAData);
|
|
||||||
#endif
|
|
||||||
#if STM32_HAS_GPIOB
|
|
||||||
gpio_init(GPIOB, &gpio_default_config.PBData);
|
|
||||||
#endif
|
|
||||||
#if STM32_HAS_GPIOC
|
|
||||||
gpio_init(GPIOC, &gpio_default_config.PCData);
|
|
||||||
#endif
|
|
||||||
#if STM32_HAS_GPIOD
|
|
||||||
gpio_init(GPIOD, &gpio_default_config.PDData);
|
|
||||||
#endif
|
|
||||||
#if STM32_HAS_GPIOE
|
|
||||||
gpio_init(GPIOE, &gpio_default_config.PEData);
|
|
||||||
#endif
|
|
||||||
#if STM32_HAS_GPIOF
|
|
||||||
gpio_init(GPIOF, &gpio_default_config.PFData);
|
|
||||||
#endif
|
|
||||||
#if STM32_HAS_GPIOG
|
|
||||||
gpio_init(GPIOG, &gpio_default_config.PGData);
|
|
||||||
#endif
|
|
||||||
#if STM32_HAS_GPIOH
|
|
||||||
gpio_init(GPIOH, &gpio_default_config.PHData);
|
|
||||||
#endif
|
|
||||||
#if STM32_HAS_GPIOI
|
|
||||||
gpio_init(GPIOI, &gpio_default_config.PIData);
|
|
||||||
#endif
|
|
||||||
#if STM32_HAS_GPIOJ
|
|
||||||
gpio_init(GPIOJ, &gpio_default_config.PJData);
|
|
||||||
#endif
|
|
||||||
#if STM32_HAS_GPIOK
|
|
||||||
gpio_init(GPIOK, &gpio_default_config.PKData);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
/*===========================================================================*/
|
|
||||||
/* Driver interrupt handlers. */
|
|
||||||
/*===========================================================================*/
|
|
||||||
|
|
||||||
/*===========================================================================*/
|
|
||||||
/* Driver exported functions. */
|
|
||||||
/*===========================================================================*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Early initialization code.
|
|
||||||
* @details GPIO ports and system clocks are initialized before everything
|
|
||||||
* else.
|
|
||||||
*/
|
|
||||||
void __early_init(void) {
|
|
||||||
extern void enter_bootloader_mode_if_requested(void);
|
|
||||||
enter_bootloader_mode_if_requested();
|
|
||||||
stm32_gpio_init();
|
|
||||||
stm32_clock_init();
|
|
||||||
}
|
|
||||||
|
|
||||||
#if HAL_USE_SDC || defined(__DOXYGEN__)
|
|
||||||
/**
|
|
||||||
* @brief SDC card detection.
|
|
||||||
*/
|
|
||||||
bool sdc_lld_is_card_inserted(SDCDriver *sdcp) {
|
|
||||||
|
|
||||||
(void)sdcp;
|
|
||||||
/* TODO: Fill the implementation.*/
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief SDC card write protection detection.
|
|
||||||
*/
|
|
||||||
bool sdc_lld_is_write_protected(SDCDriver *sdcp) {
|
|
||||||
|
|
||||||
(void)sdcp;
|
|
||||||
/* TODO: Fill the implementation.*/
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
#endif /* HAL_USE_SDC */
|
|
||||||
|
|
||||||
#if HAL_USE_MMC_SPI || defined(__DOXYGEN__)
|
|
||||||
/**
|
|
||||||
* @brief MMC_SPI card detection.
|
|
||||||
*/
|
|
||||||
bool mmc_lld_is_card_inserted(MMCDriver *mmcp) {
|
|
||||||
|
|
||||||
(void)mmcp;
|
|
||||||
/* TODO: Fill the implementation.*/
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief MMC_SPI card write protection detection.
|
|
||||||
*/
|
|
||||||
bool mmc_lld_is_write_protected(MMCDriver *mmcp) {
|
|
||||||
|
|
||||||
(void)mmcp;
|
|
||||||
/* TODO: Fill the implementation.*/
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Board-specific initialization code.
|
|
||||||
* @todo Add your board-specific code, if any.
|
|
||||||
*/
|
|
||||||
void boardInit(void) {
|
|
||||||
SYSCFG->CFGR1 |= SYSCFG_CFGR1_I2C1_DMA_RMP;
|
|
||||||
SYSCFG->CFGR1 &= ~(SYSCFG_CFGR1_SPI2_DMA_RMP);
|
|
||||||
}
|
|
||||||
@@ -1,923 +0,0 @@
|
|||||||
/*
|
|
||||||
ChibiOS - Copyright (C) 2006..2016 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* This file has been automatically generated using ChibiStudio board
|
|
||||||
* generator plugin. Do not edit manually.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef BOARD_H
|
|
||||||
#define BOARD_H
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Setup for ST STM32F072B-Discovery board.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Board identifier.
|
|
||||||
*/
|
|
||||||
#define BOARD_ST_STM32F072B_DISCOVERY
|
|
||||||
#define BOARD_NAME "ST STM32F072B-Discovery"
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Board oscillators-related settings.
|
|
||||||
* NOTE: LSE not fitted.
|
|
||||||
* NOTE: HSE not fitted.
|
|
||||||
*/
|
|
||||||
#if !defined(STM32_LSECLK)
|
|
||||||
#define STM32_LSECLK 0U
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define STM32_LSEDRV (3U << 3U)
|
|
||||||
|
|
||||||
#if !defined(STM32_HSECLK)
|
|
||||||
#define STM32_HSECLK 0U
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define STM32_HSE_BYPASS
|
|
||||||
|
|
||||||
/*
|
|
||||||
* MCU type as defined in the ST header.
|
|
||||||
*/
|
|
||||||
#define STM32F072xB
|
|
||||||
|
|
||||||
/*
|
|
||||||
* IO pins assignments.
|
|
||||||
*/
|
|
||||||
#define GPIOA_BUTTON 0U
|
|
||||||
#define GPIOA_PIN1 1U
|
|
||||||
#define GPIOA_PIN2 2U
|
|
||||||
#define GPIOA_PIN3 3U
|
|
||||||
#define GPIOA_PIN4 4U
|
|
||||||
#define GPIOA_PIN5 5U
|
|
||||||
#define GPIOA_PIN6 6U
|
|
||||||
#define GPIOA_PIN7 7U
|
|
||||||
#define GPIOA_PIN8 8U
|
|
||||||
#define GPIOA_PIN9 9U
|
|
||||||
#define GPIOA_PIN10 10U
|
|
||||||
#define GPIOA_USB_DM 11U
|
|
||||||
#define GPIOA_USB_DP 12U
|
|
||||||
#define GPIOA_SWDIO 13U
|
|
||||||
#define GPIOA_SWCLK 14U
|
|
||||||
#define GPIOA_PIN15 15U
|
|
||||||
|
|
||||||
#define GPIOB_PIN0 0U
|
|
||||||
#define GPIOB_PIN1 1U
|
|
||||||
#define GPIOB_PIN2 2U
|
|
||||||
#define GPIOB_PIN3 3U
|
|
||||||
#define GPIOB_PIN4 4U
|
|
||||||
#define GPIOB_PIN5 5U
|
|
||||||
#define GPIOB_PIN6 6U
|
|
||||||
#define GPIOB_PIN7 7U
|
|
||||||
#define GPIOB_PIN8 8U
|
|
||||||
#define GPIOB_PIN9 9U
|
|
||||||
#define GPIOB_PIN10 10U
|
|
||||||
#define GPIOB_PIN11 11U
|
|
||||||
#define GPIOB_PIN12 12U
|
|
||||||
#define GPIOB_SPI2_SCK 13U
|
|
||||||
#define GPIOB_SPI2_MISO 14U
|
|
||||||
#define GPIOB_SPI2_MOSI 15U
|
|
||||||
|
|
||||||
#define GPIOC_MEMS_CS 0U
|
|
||||||
#define GPIOC_PIN1 1U
|
|
||||||
#define GPIOC_PIN2 2U
|
|
||||||
#define GPIOC_PIN3 3U
|
|
||||||
#define GPIOC_PIN4 4U
|
|
||||||
#define GPIOC_PIN5 5U
|
|
||||||
#define GPIOC_LED_RED 6U
|
|
||||||
#define GPIOC_LED_BLUE 7U
|
|
||||||
#define GPIOC_LED_ORANGE 8U
|
|
||||||
#define GPIOC_LED_GREEN 9U
|
|
||||||
#define GPIOC_PIN10 10U
|
|
||||||
#define GPIOC_PIN11 11U
|
|
||||||
#define GPIOC_PIN12 12U
|
|
||||||
#define GPIOC_PIN13 13U
|
|
||||||
#define GPIOC_OSC32_IN 14U
|
|
||||||
#define GPIOC_OSC32_OUT 15U
|
|
||||||
|
|
||||||
#define GPIOD_PIN0 0U
|
|
||||||
#define GPIOD_PIN1 1U
|
|
||||||
#define GPIOD_PIN2 2U
|
|
||||||
#define GPIOD_PIN3 3U
|
|
||||||
#define GPIOD_PIN4 4U
|
|
||||||
#define GPIOD_PIN5 5U
|
|
||||||
#define GPIOD_PIN6 6U
|
|
||||||
#define GPIOD_PIN7 7U
|
|
||||||
#define GPIOD_PIN8 8U
|
|
||||||
#define GPIOD_PIN9 9U
|
|
||||||
#define GPIOD_PIN10 10U
|
|
||||||
#define GPIOD_PIN11 11U
|
|
||||||
#define GPIOD_PIN12 12U
|
|
||||||
#define GPIOD_PIN13 13U
|
|
||||||
#define GPIOD_PIN14 14U
|
|
||||||
#define GPIOD_PIN15 15U
|
|
||||||
|
|
||||||
#define GPIOE_PIN0 0U
|
|
||||||
#define GPIOE_PIN1 1U
|
|
||||||
#define GPIOE_PIN2 2U
|
|
||||||
#define GPIOE_PIN3 3U
|
|
||||||
#define GPIOE_PIN4 4U
|
|
||||||
#define GPIOE_PIN5 5U
|
|
||||||
#define GPIOE_PIN6 6U
|
|
||||||
#define GPIOE_PIN7 7U
|
|
||||||
#define GPIOE_PIN8 8U
|
|
||||||
#define GPIOE_PIN9 9U
|
|
||||||
#define GPIOE_PIN10 10U
|
|
||||||
#define GPIOE_PIN11 11U
|
|
||||||
#define GPIOE_PIN12 12U
|
|
||||||
#define GPIOE_PIN13 13U
|
|
||||||
#define GPIOE_PIN14 14U
|
|
||||||
#define GPIOE_PIN15 15U
|
|
||||||
|
|
||||||
#define GPIOF_OSC_IN 0U
|
|
||||||
#define GPIOF_OSC_OUT 1U
|
|
||||||
#define GPIOF_PIN2 2U
|
|
||||||
#define GPIOF_PIN3 3U
|
|
||||||
#define GPIOF_PIN4 4U
|
|
||||||
#define GPIOF_PIN5 5U
|
|
||||||
#define GPIOF_PIN6 6U
|
|
||||||
#define GPIOF_PIN7 7U
|
|
||||||
#define GPIOF_PIN8 8U
|
|
||||||
#define GPIOF_PIN9 9U
|
|
||||||
#define GPIOF_PIN10 10U
|
|
||||||
#define GPIOF_PIN11 11U
|
|
||||||
#define GPIOF_PIN12 12U
|
|
||||||
#define GPIOF_PIN13 13U
|
|
||||||
#define GPIOF_PIN14 14U
|
|
||||||
#define GPIOF_PIN15 15U
|
|
||||||
|
|
||||||
/*
|
|
||||||
* IO lines assignments.
|
|
||||||
*/
|
|
||||||
#define LINE_BUTTON PAL_LINE(GPIOA, 0U)
|
|
||||||
#define LINE_USB_DM PAL_LINE(GPIOA, 11U)
|
|
||||||
#define LINE_USB_DP PAL_LINE(GPIOA, 12U)
|
|
||||||
#define LINE_SWDIO PAL_LINE(GPIOA, 13U)
|
|
||||||
#define LINE_SWCLK PAL_LINE(GPIOA, 14U)
|
|
||||||
|
|
||||||
#define LINE_SPI2_SCK PAL_LINE(GPIOB, 13U)
|
|
||||||
#define LINE_SPI2_MISO PAL_LINE(GPIOB, 14U)
|
|
||||||
#define LINE_SPI2_MOSI PAL_LINE(GPIOB, 15U)
|
|
||||||
|
|
||||||
#define LINE_MEMS_CS PAL_LINE(GPIOC, 0U)
|
|
||||||
#define LINE_LED_RED PAL_LINE(GPIOC, 6U)
|
|
||||||
#define LINE_LED_BLUE PAL_LINE(GPIOC, 7U)
|
|
||||||
#define LINE_LED_ORANGE PAL_LINE(GPIOC, 8U)
|
|
||||||
#define LINE_LED_GREEN PAL_LINE(GPIOC, 9U)
|
|
||||||
#define LINE_OSC32_IN PAL_LINE(GPIOC, 14U)
|
|
||||||
#define LINE_OSC32_OUT PAL_LINE(GPIOC, 15U)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define LINE_OSC_IN PAL_LINE(GPIOF, 0U)
|
|
||||||
#define LINE_OSC_OUT PAL_LINE(GPIOF, 1U)
|
|
||||||
|
|
||||||
/*
|
|
||||||
* I/O ports initial setup, this configuration is established soon after reset
|
|
||||||
* in the initialization code.
|
|
||||||
* Please refer to the STM32 Reference Manual for details.
|
|
||||||
*/
|
|
||||||
#define PIN_MODE_INPUT(n) (0U << ((n) * 2U))
|
|
||||||
#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U))
|
|
||||||
#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U))
|
|
||||||
#define PIN_MODE_ANALOG(n) (3U << ((n) * 2U))
|
|
||||||
#define PIN_ODR_LOW(n) (0U << (n))
|
|
||||||
#define PIN_ODR_HIGH(n) (1U << (n))
|
|
||||||
#define PIN_OTYPE_PUSHPULL(n) (0U << (n))
|
|
||||||
#define PIN_OTYPE_OPENDRAIN(n) (1U << (n))
|
|
||||||
#define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U))
|
|
||||||
#define PIN_OSPEED_LOW(n) (1U << ((n) * 2U))
|
|
||||||
#define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U))
|
|
||||||
#define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U))
|
|
||||||
#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U))
|
|
||||||
#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U))
|
|
||||||
#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U))
|
|
||||||
#define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U))
|
|
||||||
|
|
||||||
/*
|
|
||||||
* GPIOA setup:
|
|
||||||
*
|
|
||||||
* PA0 - BUTTON (input floating).
|
|
||||||
* PA1 - PIN1 (input pullup).
|
|
||||||
* PA2 - PIN2 (input pullup).
|
|
||||||
* PA3 - PIN3 (input pullup).
|
|
||||||
* PA4 - PIN4 (input pullup).
|
|
||||||
* PA5 - PIN5 (input pullup).
|
|
||||||
* PA6 - PIN6 (input pullup).
|
|
||||||
* PA7 - PIN7 (input pullup).
|
|
||||||
* PA8 - PIN8 (input pullup).
|
|
||||||
* PA9 - PIN9 (input pullup).
|
|
||||||
* PA10 - PIN10 (input pullup).
|
|
||||||
* PA11 - USB_DM (input floating).
|
|
||||||
* PA12 - USB_DP (input floating).
|
|
||||||
* PA13 - SWDIO (alternate 0).
|
|
||||||
* PA14 - SWCLK (alternate 0).
|
|
||||||
* PA15 - PIN15 (input pullup).
|
|
||||||
*/
|
|
||||||
#define VAL_GPIOA_MODER (PIN_MODE_INPUT(GPIOA_BUTTON) | \
|
|
||||||
PIN_MODE_INPUT(GPIOA_PIN1) | \
|
|
||||||
PIN_MODE_INPUT(GPIOA_PIN2) | \
|
|
||||||
PIN_MODE_INPUT(GPIOA_PIN3) | \
|
|
||||||
PIN_MODE_INPUT(GPIOA_PIN4) | \
|
|
||||||
PIN_MODE_INPUT(GPIOA_PIN5) | \
|
|
||||||
PIN_MODE_INPUT(GPIOA_PIN6) | \
|
|
||||||
PIN_MODE_INPUT(GPIOA_PIN7) | \
|
|
||||||
PIN_MODE_INPUT(GPIOA_PIN8) | \
|
|
||||||
PIN_MODE_INPUT(GPIOA_PIN9) | \
|
|
||||||
PIN_MODE_INPUT(GPIOA_PIN10) | \
|
|
||||||
PIN_MODE_INPUT(GPIOA_USB_DM) | \
|
|
||||||
PIN_MODE_INPUT(GPIOA_USB_DP) | \
|
|
||||||
PIN_MODE_ALTERNATE(GPIOA_SWDIO) | \
|
|
||||||
PIN_MODE_ALTERNATE(GPIOA_SWCLK) | \
|
|
||||||
PIN_MODE_INPUT(GPIOA_PIN15))
|
|
||||||
#define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(GPIOA_BUTTON) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOA_PIN1) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOA_PIN2) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOA_PIN3) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOA_PIN4) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOA_PIN5) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOA_PIN6) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOA_PIN7) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOA_PIN8) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOA_PIN9) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOA_PIN10) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOA_USB_DM) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOA_USB_DP) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOA_PIN15))
|
|
||||||
#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOA_BUTTON) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOA_PIN1) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOA_PIN2) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOA_PIN3) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOA_PIN4) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOA_PIN5) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOA_PIN6) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOA_PIN7) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOA_PIN8) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOA_PIN9) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOA_PIN10) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOA_USB_DM) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOA_USB_DP) | \
|
|
||||||
PIN_OSPEED_HIGH(GPIOA_SWDIO) | \
|
|
||||||
PIN_OSPEED_HIGH(GPIOA_SWCLK) | \
|
|
||||||
PIN_OSPEED_HIGH(GPIOA_PIN15))
|
|
||||||
#define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING(GPIOA_BUTTON) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOA_PIN1) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOA_PIN2) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOA_PIN3) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOA_PIN4) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOA_PIN5) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOA_PIN6) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOA_PIN7) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOA_PIN8) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOA_PIN9) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOA_PIN10) | \
|
|
||||||
PIN_PUPDR_FLOATING(GPIOA_USB_DM) | \
|
|
||||||
PIN_PUPDR_FLOATING(GPIOA_USB_DP) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOA_SWDIO) | \
|
|
||||||
PIN_PUPDR_PULLDOWN(GPIOA_SWCLK) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOA_PIN15))
|
|
||||||
#define VAL_GPIOA_ODR (PIN_ODR_HIGH(GPIOA_BUTTON) | \
|
|
||||||
PIN_ODR_HIGH(GPIOA_PIN1) | \
|
|
||||||
PIN_ODR_HIGH(GPIOA_PIN2) | \
|
|
||||||
PIN_ODR_HIGH(GPIOA_PIN3) | \
|
|
||||||
PIN_ODR_HIGH(GPIOA_PIN4) | \
|
|
||||||
PIN_ODR_HIGH(GPIOA_PIN5) | \
|
|
||||||
PIN_ODR_HIGH(GPIOA_PIN6) | \
|
|
||||||
PIN_ODR_HIGH(GPIOA_PIN7) | \
|
|
||||||
PIN_ODR_HIGH(GPIOA_PIN8) | \
|
|
||||||
PIN_ODR_HIGH(GPIOA_PIN9) | \
|
|
||||||
PIN_ODR_HIGH(GPIOA_PIN10) | \
|
|
||||||
PIN_ODR_HIGH(GPIOA_USB_DM) | \
|
|
||||||
PIN_ODR_HIGH(GPIOA_USB_DP) | \
|
|
||||||
PIN_ODR_HIGH(GPIOA_SWDIO) | \
|
|
||||||
PIN_ODR_HIGH(GPIOA_SWCLK) | \
|
|
||||||
PIN_ODR_HIGH(GPIOA_PIN15))
|
|
||||||
#define VAL_GPIOA_AFRL (PIN_AFIO_AF(GPIOA_BUTTON, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOA_PIN1, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOA_PIN2, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOA_PIN3, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOA_PIN4, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOA_PIN5, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOA_PIN6, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOA_PIN7, 0U))
|
|
||||||
#define VAL_GPIOA_AFRH (PIN_AFIO_AF(GPIOA_PIN8, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOA_PIN9, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOA_PIN10, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOA_USB_DM, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOA_USB_DP, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOA_SWDIO, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOA_SWCLK, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOA_PIN15, 0U))
|
|
||||||
|
|
||||||
/*
|
|
||||||
* GPIOB setup:
|
|
||||||
*
|
|
||||||
* PB0 - PIN0 (input pullup).
|
|
||||||
* PB1 - PIN1 (input pullup).
|
|
||||||
* PB2 - PIN2 (input pullup).
|
|
||||||
* PB3 - PIN3 (input pullup).
|
|
||||||
* PB4 - PIN4 (input pullup).
|
|
||||||
* PB5 - PIN5 (input pullup).
|
|
||||||
* PB6 - PIN6 (input pullup).
|
|
||||||
* PB7 - PIN7 (input pullup).
|
|
||||||
* PB8 - PIN8 (input pullup).
|
|
||||||
* PB9 - PIN9 (input pullup).
|
|
||||||
* PB10 - PIN10 (input pullup).
|
|
||||||
* PB11 - PIN11 (input pullup).
|
|
||||||
* PB12 - PIN12 (input pullup).
|
|
||||||
* PB13 - SPI2_SCK (alternate 0).
|
|
||||||
* PB14 - SPI2_MISO (alternate 0).
|
|
||||||
* PB15 - SPI2_MOSI (alternate 0).
|
|
||||||
*/
|
|
||||||
#define VAL_GPIOB_MODER (PIN_MODE_INPUT(GPIOB_PIN0) | \
|
|
||||||
PIN_MODE_INPUT(GPIOB_PIN1) | \
|
|
||||||
PIN_MODE_INPUT(GPIOB_PIN2) | \
|
|
||||||
PIN_MODE_INPUT(GPIOB_PIN3) | \
|
|
||||||
PIN_MODE_INPUT(GPIOB_PIN4) | \
|
|
||||||
PIN_MODE_INPUT(GPIOB_PIN5) | \
|
|
||||||
PIN_MODE_INPUT(GPIOB_PIN6) | \
|
|
||||||
PIN_MODE_INPUT(GPIOB_PIN7) | \
|
|
||||||
PIN_MODE_INPUT(GPIOB_PIN8) | \
|
|
||||||
PIN_MODE_INPUT(GPIOB_PIN9) | \
|
|
||||||
PIN_MODE_INPUT(GPIOB_PIN10) | \
|
|
||||||
PIN_MODE_INPUT(GPIOB_PIN11) | \
|
|
||||||
PIN_MODE_INPUT(GPIOB_PIN12) | \
|
|
||||||
PIN_MODE_ALTERNATE(GPIOB_SPI2_SCK) | \
|
|
||||||
PIN_MODE_ALTERNATE(GPIOB_SPI2_MISO) | \
|
|
||||||
PIN_MODE_ALTERNATE(GPIOB_SPI2_MOSI))
|
|
||||||
#define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(GPIOB_PIN0) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOB_PIN1) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOB_PIN2) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOB_PIN3) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOB_PIN4) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOB_PIN5) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOB_PIN6) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOB_PIN7) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOB_PIN8) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOB_PIN9) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOB_PIN10) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOB_PIN11) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOB_PIN12) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOB_SPI2_SCK) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOB_SPI2_MISO) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOB_SPI2_MOSI))
|
|
||||||
#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOB_PIN0) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOB_PIN1) | \
|
|
||||||
PIN_OSPEED_HIGH(GPIOB_PIN2) | \
|
|
||||||
PIN_OSPEED_HIGH(GPIOB_PIN3) | \
|
|
||||||
PIN_OSPEED_HIGH(GPIOB_PIN4) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOB_PIN5) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOB_PIN6) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOB_PIN7) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOB_PIN8) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOB_PIN9) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOB_PIN10) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOB_PIN11) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOB_PIN12) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOB_SPI2_SCK) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOB_SPI2_MISO) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOB_SPI2_MOSI))
|
|
||||||
#define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_PIN0) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOB_PIN1) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOB_PIN2) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOB_PIN3) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOB_PIN4) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOB_PIN5) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOB_PIN6) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOB_PIN7) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOB_PIN8) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOB_PIN9) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOB_PIN10) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOB_PIN11) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOB_PIN12) | \
|
|
||||||
PIN_PUPDR_FLOATING(GPIOB_SPI2_SCK) | \
|
|
||||||
PIN_PUPDR_FLOATING(GPIOB_SPI2_MISO) | \
|
|
||||||
PIN_PUPDR_FLOATING(GPIOB_SPI2_MOSI))
|
|
||||||
#define VAL_GPIOB_ODR (PIN_ODR_HIGH(GPIOB_PIN0) | \
|
|
||||||
PIN_ODR_HIGH(GPIOB_PIN1) | \
|
|
||||||
PIN_ODR_HIGH(GPIOB_PIN2) | \
|
|
||||||
PIN_ODR_HIGH(GPIOB_PIN3) | \
|
|
||||||
PIN_ODR_HIGH(GPIOB_PIN4) | \
|
|
||||||
PIN_ODR_HIGH(GPIOB_PIN5) | \
|
|
||||||
PIN_ODR_HIGH(GPIOB_PIN6) | \
|
|
||||||
PIN_ODR_HIGH(GPIOB_PIN7) | \
|
|
||||||
PIN_ODR_HIGH(GPIOB_PIN8) | \
|
|
||||||
PIN_ODR_HIGH(GPIOB_PIN9) | \
|
|
||||||
PIN_ODR_HIGH(GPIOB_PIN10) | \
|
|
||||||
PIN_ODR_HIGH(GPIOB_PIN11) | \
|
|
||||||
PIN_ODR_HIGH(GPIOB_PIN12) | \
|
|
||||||
PIN_ODR_HIGH(GPIOB_SPI2_SCK) | \
|
|
||||||
PIN_ODR_HIGH(GPIOB_SPI2_MISO) | \
|
|
||||||
PIN_ODR_HIGH(GPIOB_SPI2_MOSI))
|
|
||||||
#define VAL_GPIOB_AFRL (PIN_AFIO_AF(GPIOB_PIN0, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOB_PIN1, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOB_PIN2, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOB_PIN3, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOB_PIN4, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOB_PIN5, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOB_PIN6, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOB_PIN7, 0U))
|
|
||||||
#define VAL_GPIOB_AFRH (PIN_AFIO_AF(GPIOB_PIN8, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOB_PIN9, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOB_PIN10, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOB_PIN11, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOB_PIN12, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOB_SPI2_SCK, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOB_SPI2_MISO, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOB_SPI2_MOSI, 0U))
|
|
||||||
|
|
||||||
/*
|
|
||||||
* GPIOC setup:
|
|
||||||
*
|
|
||||||
* PC0 - MEMS_CS (output pushpull maximum).
|
|
||||||
* PC1 - PIN1 (input pullup).
|
|
||||||
* PC2 - PIN2 (input pullup).
|
|
||||||
* PC3 - PIN3 (input pullup).
|
|
||||||
* PC4 - PIN4 (input pullup).
|
|
||||||
* PC5 - PIN5 (input pullup).
|
|
||||||
* PC6 - LED_RED (output pushpull maximum).
|
|
||||||
* PC7 - LED_BLUE (output pushpull maximum).
|
|
||||||
* PC8 - LED_ORANGE (output pushpull maximum).
|
|
||||||
* PC9 - LED_GREEN (output pushpull maximum).
|
|
||||||
* PC10 - PIN10 (input pullup).
|
|
||||||
* PC11 - PIN11 (input pullup).
|
|
||||||
* PC12 - PIN12 (input pullup).
|
|
||||||
* PC13 - PIN13 (input pullup).
|
|
||||||
* PC14 - OSC32_IN (input floating).
|
|
||||||
* PC15 - OSC32_OUT (input floating).
|
|
||||||
*/
|
|
||||||
#define VAL_GPIOC_MODER (PIN_MODE_OUTPUT(GPIOC_MEMS_CS) | \
|
|
||||||
PIN_MODE_INPUT(GPIOC_PIN1) | \
|
|
||||||
PIN_MODE_INPUT(GPIOC_PIN2) | \
|
|
||||||
PIN_MODE_INPUT(GPIOC_PIN3) | \
|
|
||||||
PIN_MODE_INPUT(GPIOC_PIN4) | \
|
|
||||||
PIN_MODE_INPUT(GPIOC_PIN5) | \
|
|
||||||
PIN_MODE_OUTPUT(GPIOC_LED_RED) | \
|
|
||||||
PIN_MODE_OUTPUT(GPIOC_LED_BLUE) | \
|
|
||||||
PIN_MODE_OUTPUT(GPIOC_LED_ORANGE) | \
|
|
||||||
PIN_MODE_OUTPUT(GPIOC_LED_GREEN) | \
|
|
||||||
PIN_MODE_INPUT(GPIOC_PIN10) | \
|
|
||||||
PIN_MODE_INPUT(GPIOC_PIN11) | \
|
|
||||||
PIN_MODE_INPUT(GPIOC_PIN12) | \
|
|
||||||
PIN_MODE_INPUT(GPIOC_PIN13) | \
|
|
||||||
PIN_MODE_INPUT(GPIOC_OSC32_IN) | \
|
|
||||||
PIN_MODE_INPUT(GPIOC_OSC32_OUT))
|
|
||||||
#define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(GPIOC_MEMS_CS) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOC_PIN1) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOC_PIN2) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOC_PIN3) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOC_PIN4) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOC_PIN5) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOC_LED_RED) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOC_LED_BLUE) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOC_LED_ORANGE) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOC_LED_GREEN) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOC_PIN10) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOC_PIN11) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOC_PIN12) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOC_PIN13) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOC_OSC32_IN) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOC_OSC32_OUT))
|
|
||||||
#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_HIGH(GPIOC_MEMS_CS) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOC_PIN1) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOC_PIN2) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOC_PIN3) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOC_PIN4) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOC_PIN5) | \
|
|
||||||
PIN_OSPEED_HIGH(GPIOC_LED_RED) | \
|
|
||||||
PIN_OSPEED_HIGH(GPIOC_LED_BLUE) | \
|
|
||||||
PIN_OSPEED_HIGH(GPIOC_LED_ORANGE) | \
|
|
||||||
PIN_OSPEED_HIGH(GPIOC_LED_GREEN) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOC_PIN10) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOC_PIN11) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOC_PIN12) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOC_PIN13) | \
|
|
||||||
PIN_OSPEED_HIGH(GPIOC_OSC32_IN) | \
|
|
||||||
PIN_OSPEED_HIGH(GPIOC_OSC32_OUT))
|
|
||||||
#define VAL_GPIOC_PUPDR (PIN_PUPDR_FLOATING(GPIOC_MEMS_CS) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOC_PIN1) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOC_PIN2) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOC_PIN3) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOC_PIN4) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOC_PIN5) | \
|
|
||||||
PIN_PUPDR_FLOATING(GPIOC_LED_RED) | \
|
|
||||||
PIN_PUPDR_FLOATING(GPIOC_LED_BLUE) | \
|
|
||||||
PIN_PUPDR_FLOATING(GPIOC_LED_ORANGE) | \
|
|
||||||
PIN_PUPDR_FLOATING(GPIOC_LED_GREEN) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOC_PIN10) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOC_PIN11) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOC_PIN12) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOC_PIN13) | \
|
|
||||||
PIN_PUPDR_FLOATING(GPIOC_OSC32_IN) | \
|
|
||||||
PIN_PUPDR_FLOATING(GPIOC_OSC32_OUT))
|
|
||||||
#define VAL_GPIOC_ODR (PIN_ODR_HIGH(GPIOC_MEMS_CS) | \
|
|
||||||
PIN_ODR_HIGH(GPIOC_PIN1) | \
|
|
||||||
PIN_ODR_HIGH(GPIOC_PIN2) | \
|
|
||||||
PIN_ODR_HIGH(GPIOC_PIN3) | \
|
|
||||||
PIN_ODR_HIGH(GPIOC_PIN4) | \
|
|
||||||
PIN_ODR_HIGH(GPIOC_PIN5) | \
|
|
||||||
PIN_ODR_LOW(GPIOC_LED_RED) | \
|
|
||||||
PIN_ODR_LOW(GPIOC_LED_BLUE) | \
|
|
||||||
PIN_ODR_LOW(GPIOC_LED_ORANGE) | \
|
|
||||||
PIN_ODR_LOW(GPIOC_LED_GREEN) | \
|
|
||||||
PIN_ODR_HIGH(GPIOC_PIN10) | \
|
|
||||||
PIN_ODR_HIGH(GPIOC_PIN11) | \
|
|
||||||
PIN_ODR_HIGH(GPIOC_PIN12) | \
|
|
||||||
PIN_ODR_HIGH(GPIOC_PIN13) | \
|
|
||||||
PIN_ODR_HIGH(GPIOC_OSC32_IN) | \
|
|
||||||
PIN_ODR_HIGH(GPIOC_OSC32_OUT))
|
|
||||||
#define VAL_GPIOC_AFRL (PIN_AFIO_AF(GPIOC_MEMS_CS, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOC_PIN1, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOC_PIN2, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOC_PIN3, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOC_PIN4, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOC_PIN5, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOC_LED_RED, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOC_LED_BLUE, 0U))
|
|
||||||
#define VAL_GPIOC_AFRH (PIN_AFIO_AF(GPIOC_LED_ORANGE, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOC_LED_GREEN, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOC_PIN10, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOC_PIN11, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOC_PIN12, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOC_PIN13, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOC_OSC32_IN, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOC_OSC32_OUT, 0U))
|
|
||||||
|
|
||||||
/*
|
|
||||||
* GPIOD setup:
|
|
||||||
*
|
|
||||||
* PD0 - PIN0 (input pullup).
|
|
||||||
* PD1 - PIN1 (input pullup).
|
|
||||||
* PD2 - PIN2 (input pullup).
|
|
||||||
* PD3 - PIN3 (input pullup).
|
|
||||||
* PD4 - PIN4 (input pullup).
|
|
||||||
* PD5 - PIN5 (input pullup).
|
|
||||||
* PD6 - PIN6 (input pullup).
|
|
||||||
* PD7 - PIN7 (input pullup).
|
|
||||||
* PD8 - PIN8 (input pullup).
|
|
||||||
* PD9 - PIN9 (input pullup).
|
|
||||||
* PD10 - PIN10 (input pullup).
|
|
||||||
* PD11 - PIN11 (input pullup).
|
|
||||||
* PD12 - PIN12 (input pullup).
|
|
||||||
* PD13 - PIN13 (input pullup).
|
|
||||||
* PD14 - PIN14 (input pullup).
|
|
||||||
* PD15 - PIN15 (input pullup).
|
|
||||||
*/
|
|
||||||
#define VAL_GPIOD_MODER (PIN_MODE_INPUT(GPIOD_PIN0) | \
|
|
||||||
PIN_MODE_INPUT(GPIOD_PIN1) | \
|
|
||||||
PIN_MODE_INPUT(GPIOD_PIN2) | \
|
|
||||||
PIN_MODE_INPUT(GPIOD_PIN3) | \
|
|
||||||
PIN_MODE_INPUT(GPIOD_PIN4) | \
|
|
||||||
PIN_MODE_INPUT(GPIOD_PIN5) | \
|
|
||||||
PIN_MODE_INPUT(GPIOD_PIN6) | \
|
|
||||||
PIN_MODE_INPUT(GPIOD_PIN7) | \
|
|
||||||
PIN_MODE_INPUT(GPIOD_PIN8) | \
|
|
||||||
PIN_MODE_INPUT(GPIOD_PIN9) | \
|
|
||||||
PIN_MODE_INPUT(GPIOD_PIN10) | \
|
|
||||||
PIN_MODE_INPUT(GPIOD_PIN11) | \
|
|
||||||
PIN_MODE_INPUT(GPIOD_PIN12) | \
|
|
||||||
PIN_MODE_INPUT(GPIOD_PIN13) | \
|
|
||||||
PIN_MODE_INPUT(GPIOD_PIN14) | \
|
|
||||||
PIN_MODE_INPUT(GPIOD_PIN15))
|
|
||||||
#define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(GPIOD_PIN0) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOD_PIN1) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOD_PIN2) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOD_PIN3) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOD_PIN4) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOD_PIN5) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOD_PIN6) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOD_PIN7) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOD_PIN8) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOD_PIN9) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOD_PIN10) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOD_PIN11) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOD_PIN12) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOD_PIN15))
|
|
||||||
#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOD_PIN0) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOD_PIN1) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOD_PIN2) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOD_PIN3) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOD_PIN4) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOD_PIN5) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOD_PIN6) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOD_PIN7) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOD_PIN8) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOD_PIN9) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOD_PIN10) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOD_PIN11) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOD_PIN12) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOD_PIN13) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOD_PIN14) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOD_PIN15))
|
|
||||||
#define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOD_PIN1) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOD_PIN2) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOD_PIN3) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOD_PIN4) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOD_PIN5) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOD_PIN6) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOD_PIN7) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOD_PIN8) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOD_PIN9) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOD_PIN10) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOD_PIN11) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOD_PIN12) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOD_PIN13) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOD_PIN14) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOD_PIN15))
|
|
||||||
#define VAL_GPIOD_ODR (PIN_ODR_HIGH(GPIOD_PIN0) | \
|
|
||||||
PIN_ODR_HIGH(GPIOD_PIN1) | \
|
|
||||||
PIN_ODR_HIGH(GPIOD_PIN2) | \
|
|
||||||
PIN_ODR_HIGH(GPIOD_PIN3) | \
|
|
||||||
PIN_ODR_HIGH(GPIOD_PIN4) | \
|
|
||||||
PIN_ODR_HIGH(GPIOD_PIN5) | \
|
|
||||||
PIN_ODR_HIGH(GPIOD_PIN6) | \
|
|
||||||
PIN_ODR_HIGH(GPIOD_PIN7) | \
|
|
||||||
PIN_ODR_HIGH(GPIOD_PIN8) | \
|
|
||||||
PIN_ODR_HIGH(GPIOD_PIN9) | \
|
|
||||||
PIN_ODR_HIGH(GPIOD_PIN10) | \
|
|
||||||
PIN_ODR_HIGH(GPIOD_PIN11) | \
|
|
||||||
PIN_ODR_HIGH(GPIOD_PIN12) | \
|
|
||||||
PIN_ODR_HIGH(GPIOD_PIN13) | \
|
|
||||||
PIN_ODR_HIGH(GPIOD_PIN14) | \
|
|
||||||
PIN_ODR_HIGH(GPIOD_PIN15))
|
|
||||||
#define VAL_GPIOD_AFRL (PIN_AFIO_AF(GPIOD_PIN0, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOD_PIN1, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOD_PIN2, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOD_PIN3, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOD_PIN4, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOD_PIN5, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOD_PIN6, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOD_PIN7, 0U))
|
|
||||||
#define VAL_GPIOD_AFRH (PIN_AFIO_AF(GPIOD_PIN8, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOD_PIN9, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOD_PIN10, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOD_PIN11, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOD_PIN12, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOD_PIN13, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOD_PIN14, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOD_PIN15, 0U))
|
|
||||||
|
|
||||||
/*
|
|
||||||
* GPIOE setup:
|
|
||||||
*
|
|
||||||
* PE0 - PIN0 (input pullup).
|
|
||||||
* PE1 - PIN1 (input pullup).
|
|
||||||
* PE2 - PIN2 (input pullup).
|
|
||||||
* PE3 - PIN3 (input pullup).
|
|
||||||
* PE4 - PIN4 (input pullup).
|
|
||||||
* PE5 - PIN5 (input pullup).
|
|
||||||
* PE6 - PIN6 (input pullup).
|
|
||||||
* PE7 - PIN7 (input pullup).
|
|
||||||
* PE8 - PIN8 (input pullup).
|
|
||||||
* PE9 - PIN9 (input pullup).
|
|
||||||
* PE10 - PIN10 (input pullup).
|
|
||||||
* PE11 - PIN11 (input pullup).
|
|
||||||
* PE12 - PIN12 (input pullup).
|
|
||||||
* PE13 - PIN13 (input pullup).
|
|
||||||
* PE14 - PIN14 (input pullup).
|
|
||||||
* PE15 - PIN15 (input pullup).
|
|
||||||
*/
|
|
||||||
#define VAL_GPIOE_MODER (PIN_MODE_INPUT(GPIOE_PIN0) | \
|
|
||||||
PIN_MODE_INPUT(GPIOE_PIN1) | \
|
|
||||||
PIN_MODE_INPUT(GPIOE_PIN2) | \
|
|
||||||
PIN_MODE_INPUT(GPIOE_PIN3) | \
|
|
||||||
PIN_MODE_INPUT(GPIOE_PIN4) | \
|
|
||||||
PIN_MODE_INPUT(GPIOE_PIN5) | \
|
|
||||||
PIN_MODE_INPUT(GPIOE_PIN6) | \
|
|
||||||
PIN_MODE_INPUT(GPIOE_PIN7) | \
|
|
||||||
PIN_MODE_INPUT(GPIOE_PIN8) | \
|
|
||||||
PIN_MODE_INPUT(GPIOE_PIN9) | \
|
|
||||||
PIN_MODE_INPUT(GPIOE_PIN10) | \
|
|
||||||
PIN_MODE_INPUT(GPIOE_PIN11) | \
|
|
||||||
PIN_MODE_INPUT(GPIOE_PIN12) | \
|
|
||||||
PIN_MODE_INPUT(GPIOE_PIN13) | \
|
|
||||||
PIN_MODE_INPUT(GPIOE_PIN14) | \
|
|
||||||
PIN_MODE_INPUT(GPIOE_PIN15))
|
|
||||||
#define VAL_GPIOE_OTYPER (PIN_OTYPE_PUSHPULL(GPIOE_PIN0) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOE_PIN1) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOE_PIN2) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOE_PIN3) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOE_PIN4) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOE_PIN5) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOE_PIN6) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOE_PIN7) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOE_PIN8) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOE_PIN9) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOE_PIN10) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOE_PIN11) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOE_PIN12) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOE_PIN14) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOE_PIN15))
|
|
||||||
#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOE_PIN0) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOE_PIN1) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOE_PIN2) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOE_PIN3) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOE_PIN4) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOE_PIN5) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOE_PIN6) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOE_PIN7) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOE_PIN8) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOE_PIN9) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOE_PIN10) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOE_PIN11) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOE_PIN12) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOE_PIN13) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOE_PIN14) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOE_PIN15))
|
|
||||||
#define VAL_GPIOE_PUPDR (PIN_PUPDR_PULLUP(GPIOE_PIN0) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOE_PIN1) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOE_PIN2) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOE_PIN3) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOE_PIN4) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOE_PIN5) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOE_PIN6) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOE_PIN7) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOE_PIN8) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOE_PIN9) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOE_PIN10) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOE_PIN11) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOE_PIN12) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOE_PIN13) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOE_PIN14) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOE_PIN15))
|
|
||||||
#define VAL_GPIOE_ODR (PIN_ODR_HIGH(GPIOE_PIN0) | \
|
|
||||||
PIN_ODR_HIGH(GPIOE_PIN1) | \
|
|
||||||
PIN_ODR_HIGH(GPIOE_PIN2) | \
|
|
||||||
PIN_ODR_HIGH(GPIOE_PIN3) | \
|
|
||||||
PIN_ODR_HIGH(GPIOE_PIN4) | \
|
|
||||||
PIN_ODR_HIGH(GPIOE_PIN5) | \
|
|
||||||
PIN_ODR_HIGH(GPIOE_PIN6) | \
|
|
||||||
PIN_ODR_HIGH(GPIOE_PIN7) | \
|
|
||||||
PIN_ODR_HIGH(GPIOE_PIN8) | \
|
|
||||||
PIN_ODR_HIGH(GPIOE_PIN9) | \
|
|
||||||
PIN_ODR_HIGH(GPIOE_PIN10) | \
|
|
||||||
PIN_ODR_HIGH(GPIOE_PIN11) | \
|
|
||||||
PIN_ODR_HIGH(GPIOE_PIN12) | \
|
|
||||||
PIN_ODR_HIGH(GPIOE_PIN13) | \
|
|
||||||
PIN_ODR_HIGH(GPIOE_PIN14) | \
|
|
||||||
PIN_ODR_HIGH(GPIOE_PIN15))
|
|
||||||
#define VAL_GPIOE_AFRL (PIN_AFIO_AF(GPIOE_PIN0, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOE_PIN1, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOE_PIN2, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOE_PIN3, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOE_PIN4, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOE_PIN5, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOE_PIN6, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOE_PIN7, 0U))
|
|
||||||
#define VAL_GPIOE_AFRH (PIN_AFIO_AF(GPIOE_PIN8, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOE_PIN9, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOE_PIN10, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOE_PIN11, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOE_PIN12, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOE_PIN13, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOE_PIN14, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOE_PIN15, 0U))
|
|
||||||
|
|
||||||
/*
|
|
||||||
* GPIOF setup:
|
|
||||||
*
|
|
||||||
* PF0 - OSC_IN (input floating).
|
|
||||||
* PF1 - OSC_OUT (input floating).
|
|
||||||
* PF2 - PIN2 (input pullup).
|
|
||||||
* PF3 - PIN3 (input pullup).
|
|
||||||
* PF4 - PIN4 (input pullup).
|
|
||||||
* PF5 - PIN5 (input pullup).
|
|
||||||
* PF6 - PIN6 (input pullup).
|
|
||||||
* PF7 - PIN7 (input pullup).
|
|
||||||
* PF8 - PIN8 (input pullup).
|
|
||||||
* PF9 - PIN9 (input pullup).
|
|
||||||
* PF10 - PIN10 (input pullup).
|
|
||||||
* PF11 - PIN11 (input pullup).
|
|
||||||
* PF12 - PIN12 (input pullup).
|
|
||||||
* PF13 - PIN13 (input pullup).
|
|
||||||
* PF14 - PIN14 (input pullup).
|
|
||||||
* PF15 - PIN15 (input pullup).
|
|
||||||
*/
|
|
||||||
#define VAL_GPIOF_MODER (PIN_MODE_INPUT(GPIOF_OSC_IN) | \
|
|
||||||
PIN_MODE_INPUT(GPIOF_OSC_OUT) | \
|
|
||||||
PIN_MODE_INPUT(GPIOF_PIN2) | \
|
|
||||||
PIN_MODE_INPUT(GPIOF_PIN3) | \
|
|
||||||
PIN_MODE_INPUT(GPIOF_PIN4) | \
|
|
||||||
PIN_MODE_INPUT(GPIOF_PIN5) | \
|
|
||||||
PIN_MODE_INPUT(GPIOF_PIN6) | \
|
|
||||||
PIN_MODE_INPUT(GPIOF_PIN7) | \
|
|
||||||
PIN_MODE_INPUT(GPIOF_PIN8) | \
|
|
||||||
PIN_MODE_INPUT(GPIOF_PIN9) | \
|
|
||||||
PIN_MODE_INPUT(GPIOF_PIN10) | \
|
|
||||||
PIN_MODE_INPUT(GPIOF_PIN11) | \
|
|
||||||
PIN_MODE_INPUT(GPIOF_PIN12) | \
|
|
||||||
PIN_MODE_INPUT(GPIOF_PIN13) | \
|
|
||||||
PIN_MODE_INPUT(GPIOF_PIN14) | \
|
|
||||||
PIN_MODE_INPUT(GPIOF_PIN15))
|
|
||||||
#define VAL_GPIOF_OTYPER (PIN_OTYPE_PUSHPULL(GPIOF_OSC_IN) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOF_OSC_OUT) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOF_PIN2) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOF_PIN3) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOF_PIN4) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOF_PIN5) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOF_PIN6) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOF_PIN7) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOF_PIN8) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOF_PIN9) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOF_PIN10) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOF_PIN11) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOF_PIN12) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOF_PIN15))
|
|
||||||
#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOF_OSC_IN) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOF_OSC_OUT) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOF_PIN2) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOF_PIN3) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOF_PIN4) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOF_PIN5) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOF_PIN6) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOF_PIN7) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOF_PIN8) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOF_PIN9) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOF_PIN10) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOF_PIN11) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOF_PIN12) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOF_PIN13) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOF_PIN14) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOF_PIN15))
|
|
||||||
#define VAL_GPIOF_PUPDR (PIN_PUPDR_FLOATING(GPIOF_OSC_IN) | \
|
|
||||||
PIN_PUPDR_FLOATING(GPIOF_OSC_OUT) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOF_PIN2) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOF_PIN3) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOF_PIN4) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOF_PIN5) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOF_PIN6) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOF_PIN7) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOF_PIN8) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOF_PIN9) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOF_PIN10) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOF_PIN11) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOF_PIN12) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOF_PIN13) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOF_PIN14) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOF_PIN15))
|
|
||||||
#define VAL_GPIOF_ODR (PIN_ODR_HIGH(GPIOF_OSC_IN) | \
|
|
||||||
PIN_ODR_HIGH(GPIOF_OSC_OUT) | \
|
|
||||||
PIN_ODR_HIGH(GPIOF_PIN2) | \
|
|
||||||
PIN_ODR_HIGH(GPIOF_PIN3) | \
|
|
||||||
PIN_ODR_HIGH(GPIOF_PIN4) | \
|
|
||||||
PIN_ODR_HIGH(GPIOF_PIN5) | \
|
|
||||||
PIN_ODR_HIGH(GPIOF_PIN6) | \
|
|
||||||
PIN_ODR_HIGH(GPIOF_PIN7) | \
|
|
||||||
PIN_ODR_HIGH(GPIOF_PIN8) | \
|
|
||||||
PIN_ODR_HIGH(GPIOF_PIN9) | \
|
|
||||||
PIN_ODR_HIGH(GPIOF_PIN10) | \
|
|
||||||
PIN_ODR_HIGH(GPIOF_PIN11) | \
|
|
||||||
PIN_ODR_HIGH(GPIOF_PIN12) | \
|
|
||||||
PIN_ODR_HIGH(GPIOF_PIN13) | \
|
|
||||||
PIN_ODR_HIGH(GPIOF_PIN14) | \
|
|
||||||
PIN_ODR_HIGH(GPIOF_PIN15))
|
|
||||||
#define VAL_GPIOF_AFRL (PIN_AFIO_AF(GPIOF_OSC_IN, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOF_OSC_OUT, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOF_PIN2, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOF_PIN3, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOF_PIN4, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOF_PIN5, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOF_PIN6, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOF_PIN7, 0U))
|
|
||||||
#define VAL_GPIOF_AFRH (PIN_AFIO_AF(GPIOF_PIN8, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOF_PIN9, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOF_PIN10, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOF_PIN11, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOF_PIN12, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOF_PIN13, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOF_PIN14, 0U) | \
|
|
||||||
PIN_AFIO_AF(GPIOF_PIN15, 0U))
|
|
||||||
|
|
||||||
|
|
||||||
#if !defined(_FROM_ASM_)
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
void boardInit(void);
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#endif /* _FROM_ASM_ */
|
|
||||||
|
|
||||||
#endif /* BOARD_H */
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
# List of all the board related files.
|
|
||||||
BOARDSRC = $(BOARD_PATH)/boards/ST_STM32F072B_DISCOVERY/board.c
|
|
||||||
|
|
||||||
# Required include directories
|
|
||||||
BOARDINC = $(BOARD_PATH)/boards/ST_STM32F072B_DISCOVERY
|
|
||||||
File renamed without changes.
@@ -6,13 +6,6 @@
|
|||||||
"height": 4,
|
"height": 4,
|
||||||
"layouts": {
|
"layouts": {
|
||||||
"LAYOUT": {
|
"LAYOUT": {
|
||||||
"layout": [
|
|
||||||
{"label":"Esc", "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":"Del", "x":11, "y":0}, {"label":"BkSp", "x":12, "y":0}, {"label":"7", "x":13, "y":0}, {"label":"8", "x":14, "y":0}, {"label":"9", "x":15, "y":0}, {"label":"*", "x":16, "y":0},
|
|
||||||
{"label":"Tab", "x":0, "y":1, "w":1.25}, {"label":"A", "x":1.25, "y":1}, {"label":"S", "x":2.25, "y":1}, {"label":"D", "x":3.25, "y":1}, {"label":"F", "x":4.25, "y":1}, {"label":"G", "x":5.25, "y":1}, {"label":"H", "x":6.25, "y":1}, {"label":"J", "x":7.25, "y":1}, {"label":"K", "x":8.25, "y":1}, {"label":"L", "x":9.25, "y":1}, {"label":":", "x":10.25, "y":1}, {"label":"Enter", "x":11.25, "y":1, "w":1.75}, {"label":"4", "x":13, "y":1}, {"label":"5", "x":14, "y":1}, {"label":"6", "x":15, "y":1}, {"label":"-", "x":16, "y":1},
|
|
||||||
{"label":"Shift", "x":0, "y":2, "w":1.75}, {"label":"Z", "x":1.75, "y":2}, {"label":"X", "x":2.75, "y":2}, {"label":"C", "x":3.75, "y":2}, {"label":"V", "x":4.75, "y":2}, {"label":"B", "x":5.75, "y":2}, {"label":"N", "x":6.75, "y":2}, {"label":"M", "x":7.75, "y":2}, {"label":"<", "x":8.75, "y":2}, {"label":">", "x":9.75, "y":2}, {"label":"Shift", "x":10.75, "y":2, "w":1.25}, {"label":"↑", "x":12, "y":2}, {"label":"1", "x":13, "y":2}, {"label":"2", "x":14, "y":2}, {"label":"3", "x":15, "y":2}, {"label":"+", "x":16, "y":2},
|
|
||||||
{"label":"Ctrl", "x":0, "y":3, "w":1.25}, {"label":"GUI", "x":1.25, "y":3, "w":1.25}, {"label":"Alt", "x":2.5, "y":3, "w":1.25}, {"x":3.75, "y":3, "w":1.75}, {"x":5.5, "y":3, "w":1}, {"label":"Backspace", "x":6.5, "y":3, "w":2.25}, {"label":"Menu", "x":8.75, "y":3, "w":1.25}, {"label":"Fn", "x":10, "y":3}, {"label":"←", "x":11, "y":3}, {"label":"↓", "x":12, "y":3}, {"label":"→", "x":13, "y":3}, {"label":"0", "x":14, "y":3}, {"label":".", "x":15, "y":3}, {"label":"Enter", "x":16, "y":3}]
|
|
||||||
},
|
|
||||||
"LAYOUT_lefty": {
|
|
||||||
"layout": [
|
"layout": [
|
||||||
{"label":"7", "x":0, "y":0}, {"label":"8", "x":1, "y":0}, {"label":"9", "x":2, "y":0}, {"label":"-", "x":3, "y":0}, {"label":"Esc", "x":4, "y":0}, {"label":"Q", "x":5, "y":0}, {"label":"W", "x":6, "y":0}, {"label":"E", "x":7, "y":0}, {"label":"R", "x":8, "y":0}, {"label":"T", "x":9, "y":0}, {"label":"Y", "x":10, "y":0}, {"label":"U", "x":11, "y":0}, {"label":"I", "x":12, "y":0}, {"label":"O", "x":13, "y":0}, {"label":"P", "x":14, "y":0}, {"label":"{", "x":15, "y":0}, {"label":"}", "x":16, "y":0},
|
{"label":"7", "x":0, "y":0}, {"label":"8", "x":1, "y":0}, {"label":"9", "x":2, "y":0}, {"label":"-", "x":3, "y":0}, {"label":"Esc", "x":4, "y":0}, {"label":"Q", "x":5, "y":0}, {"label":"W", "x":6, "y":0}, {"label":"E", "x":7, "y":0}, {"label":"R", "x":8, "y":0}, {"label":"T", "x":9, "y":0}, {"label":"Y", "x":10, "y":0}, {"label":"U", "x":11, "y":0}, {"label":"I", "x":12, "y":0}, {"label":"O", "x":13, "y":0}, {"label":"P", "x":14, "y":0}, {"label":"{", "x":15, "y":0}, {"label":"}", "x":16, "y":0},
|
||||||
{"label":"4", "x":0, "y":1}, {"label":"5", "x":1, "y":1}, {"label":"6", "x":2, "y":1}, {"label":"+", "x":3, "y":1}, {"label":"Tab", "x":4, "y":1, "w":1.25}, {"label":"A", "x":5.25, "y":1}, {"label":"S", "x":6.25, "y":1}, {"label":"D", "x":7.25, "y":1}, {"label":"F", "x":8.25, "y":1}, {"label":"G", "x":9.25, "y":1}, {"label":"H", "x":10.25, "y":1}, {"label":"J", "x":11.25, "y":1}, {"label":"K", "x":12.25, "y":1}, {"label":"L", "x":13.25, "y":1}, {"label":":", "x":14.25, "y":1}, {"label":"Enter", "x":15.25, "y":1, "w":1.75},
|
{"label":"4", "x":0, "y":1}, {"label":"5", "x":1, "y":1}, {"label":"6", "x":2, "y":1}, {"label":"+", "x":3, "y":1}, {"label":"Tab", "x":4, "y":1, "w":1.25}, {"label":"A", "x":5.25, "y":1}, {"label":"S", "x":6.25, "y":1}, {"label":"D", "x":7.25, "y":1}, {"label":"F", "x":8.25, "y":1}, {"label":"G", "x":9.25, "y":1}, {"label":"H", "x":10.25, "y":1}, {"label":"J", "x":11.25, "y":1}, {"label":"K", "x":12.25, "y":1}, {"label":"L", "x":13.25, "y":1}, {"label":":", "x":14.25, "y":1}, {"label":"Enter", "x":15.25, "y":1, "w":1.75},
|
||||||
+2
-2
@@ -22,7 +22,7 @@
|
|||||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
/* Keymap _BL: Base Layer (Default Layer)
|
/* Keymap _BL: Base Layer (Default Layer)
|
||||||
*/
|
*/
|
||||||
[_BL] = LAYOUT_lefty(
|
[_BL] = LAYOUT(
|
||||||
KC_P7 , KC_P8, KC_P9 , KC_PAST, KC_ESC , KC_Q , KC_W , KC_E, KC_R , KC_T , KC_Y, KC_U , KC_I , KC_O , KC_P , KC_DEL , KC_BSPC , \
|
KC_P7 , KC_P8, KC_P9 , KC_PAST, KC_ESC , KC_Q , KC_W , KC_E, KC_R , KC_T , KC_Y, KC_U , KC_I , KC_O , KC_P , KC_DEL , KC_BSPC , \
|
||||||
KC_P4 , KC_P5, KC_P6 , KC_PMNS, KC_TAB , KC_A , KC_S , KC_D, KC_F , KC_G , KC_H, KC_J , KC_K , KC_L , KC_SCLN, KC_ENT , \
|
KC_P4 , KC_P5, KC_P6 , KC_PMNS, KC_TAB , KC_A , KC_S , KC_D, KC_F , KC_G , KC_H, KC_J , KC_K , KC_L , KC_SCLN, KC_ENT , \
|
||||||
KC_P1 , KC_P2, KC_P3 , KC_PPLS, KC_LSFT, KC_Z , KC_X, KC_C , KC_V , KC_B, KC_N , KC_M , KC_COMM, KC_DOT , KC_UP ,KC_RSFT , \
|
KC_P1 , KC_P2, KC_P3 , KC_PPLS, KC_LSFT, KC_Z , KC_X, KC_C , KC_V , KC_B, KC_N , KC_M , KC_COMM, KC_DOT , KC_UP ,KC_RSFT , \
|
||||||
@@ -30,7 +30,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||||||
|
|
||||||
/* Keymap _FL: Function Layer
|
/* Keymap _FL: Function Layer
|
||||||
*/
|
*/
|
||||||
[_FL] = LAYOUT_lefty(
|
[_FL] = LAYOUT(
|
||||||
KC_P7 , KC_P8, KC_P9 , KC_VOLU, RESET , KC_Q , KC_W , KC_E, KC_R , KC_T , KC_Y, KC_U , KC_I , KC_LBRC, KC_RBRC, KC_INS , KC_BSPC , \
|
KC_P7 , KC_P8, KC_P9 , KC_VOLU, RESET , KC_Q , KC_W , KC_E, KC_R , KC_T , KC_Y, KC_U , KC_I , KC_LBRC, KC_RBRC, KC_INS , KC_BSPC , \
|
||||||
KC_P4 , KC_P5, KC_P6 , KC_VOLD, KC_TAB , KC_A , KC_SLCK, KC_D, KC_F , KC_G , KC_H, KC_J , KC_K , KC_L , KC_QUOT, KC_BSLS , \
|
KC_P4 , KC_P5, KC_P6 , KC_VOLD, KC_TAB , KC_A , KC_SLCK, KC_D, KC_F , KC_G , KC_H, KC_J , KC_K , KC_L , KC_QUOT, KC_BSLS , \
|
||||||
KC_P1 , KC_P2, KC_P3 , KC_PEQL, KC_LSFT, KC_Z , KC_X, KC_CAPS, KC_V , KC_B, KC_NLCK, KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_PGUP , \
|
KC_P1 , KC_P2, KC_P3 , KC_PEQL, KC_LSFT, KC_Z , KC_X, KC_CAPS, KC_V , KC_B, KC_NLCK, KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_PGUP , \
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "candybar.h"
|
#include "lefty.h"
|
||||||
|
|
||||||
void matrix_init_kb(void) {
|
void matrix_init_kb(void) {
|
||||||
matrix_init_user();
|
matrix_init_user();
|
||||||
@@ -17,19 +17,8 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "quantum.h"
|
#include "quantum.h"
|
||||||
|
|
||||||
#define LAYOUT( \
|
|
||||||
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, k0f, k0g, \
|
|
||||||
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1c, k1d, k1e, k1f, k1g, \
|
|
||||||
k20, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, k2e, k2f, k2g, \
|
|
||||||
k30, k31, k32, k35, k37, k38, k39, k3a, k3b, k3c, k3d, k3e, k3f, k3g \
|
|
||||||
) { \
|
|
||||||
{ k00, k01 , k02, k03 , k04 , k05, k06 , k07, k08, k09, k0a, k0b , k0c, k0d, k0e, k0f, k0g } , \
|
|
||||||
{ k10, k11 , k12, k13 , k14 , k15, k16 , k17, k18, k19, k1a, KC_NO, k1c, k1d, k1e, k1f, k1g } , \
|
|
||||||
{ k20, KC_NO, k22, k23 , k24 , k25, k26 , k27, k28, k29, k2a, k2b , k2c, k2d, k2e, k2f, k2g } , \
|
|
||||||
{ k30, k31 , k32, KC_NO, KC_NO, k35, KC_NO, k37, k38, k39, k3a, k3b , k3c, k3d, k3e, k3f, k3g } \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define LAYOUT_lefty( \
|
#define LAYOUT( \
|
||||||
k0d, k0e, k0f, k0g, k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, \
|
k0d, k0e, k0f, k0g, k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, \
|
||||||
k1d, k1e, k1f, k1g, k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1c, \
|
k1d, k1e, k1f, k1g, k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1c, \
|
||||||
k2d, k2e, k2f, k2g, k20, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, \
|
k2d, k2e, k2f, k2g, k20, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, \
|
||||||
@@ -40,5 +29,3 @@
|
|||||||
{ k20, KC_NO, k22, k23 , k24 , k25, k26 , k27, k28, k29, k2a, k2b , k2c, k2d, k2e, k2f, k2g } , \
|
{ k20, KC_NO, k22, k23 , k24 , k25, k26 , k27, k28, k29, k2a, k2b , k2c, k2d, k2e, k2f, k2g } , \
|
||||||
{ k30, k31 , k32, KC_NO, KC_NO, k35, KC_NO, k37, k38, k39, k3a, k3b , k3c, k3d, k3e, k3f, k3g } \
|
{ k30, k31 , k32, KC_NO, KC_NO, k35, KC_NO, k37, k38, k39, k3a, k3b , k3c, k3d, k3e, k3f, k3g } \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define LAYOUT_righty LAYOUT
|
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
# The Key Company Candybar
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
The Key Company Candybar is a staggered 40% board with a numpad utilizing the STM32F072 microcontroller.
|
||||||
|
|
||||||
|
* Keyboard Maintainer: [Terry Mathews](https://github.com/TerryMathews/)
|
||||||
|
* Hardware Supported: TKC Candybar
|
||||||
|
* Hardware Availability: [TheKey.Company](https://thekey.company/collections/candybar)
|
||||||
|
|
||||||
|
Make example for this keyboard (after setting up your build environment):
|
||||||
|
|
||||||
|
make candybar/lefty:default:dfu-util
|
||||||
|
|
||||||
|
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).
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
# MCU name
|
# MCU name
|
||||||
MCU = STM32F072
|
MCU = STM32F072
|
||||||
BOARD = ST_STM32F072B_DISCOVERY
|
|
||||||
|
|
||||||
# Build Options
|
# Build Options
|
||||||
# comment out to disable the options.
|
# comment out to disable the options.
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
The Key Company Candybar
|
|
||||||
===
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
|
|
||||||
The Key Company Candybar is a staggered 40% board with a numpad utilizing the STM32F072 microcontroller.
|
|
||||||
|
|
||||||
Keyboard Maintainer: [Terry Mathews](https://github.com/TerryMathews/)
|
|
||||||
Hardware Supported: TKC Candybar
|
|
||||||
Hardware Availability: Via GB
|
|
||||||
|
|
||||||
|
|
||||||
Make example for this keyboard (after setting up your build environment):
|
|
||||||
|
|
||||||
make candybar:default:dfu-util
|
|
||||||
|
|
||||||
See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information.
|
|
||||||
@@ -0,0 +1,115 @@
|
|||||||
|
/* Copyright 2018 Jack Humbert
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "config_common.h"
|
||||||
|
|
||||||
|
/* USB Device descriptor parameter */
|
||||||
|
#define VENDOR_ID 0xFEED
|
||||||
|
#define PRODUCT_ID 0x6060
|
||||||
|
#define DEVICE_VER 0x0006
|
||||||
|
#define MANUFACTURER The Key Company
|
||||||
|
#define PRODUCT Candybar
|
||||||
|
#define DESCRIPTION A compact staggered 40% keyboard with attached numpad
|
||||||
|
|
||||||
|
/* key matrix size */
|
||||||
|
#define MATRIX_ROWS 4
|
||||||
|
#define MATRIX_COLS 17
|
||||||
|
#define DIODE_DIRECTION COL2ROW
|
||||||
|
#define MATRIX_ROW_PINS { A8, A9, A10, A13 }
|
||||||
|
#define MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, A6, A7, B0, B1, B2, B10, B11, B12, B13, B14, B15 }
|
||||||
|
|
||||||
|
|
||||||
|
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not 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
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Force NKRO
|
||||||
|
*
|
||||||
|
* Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
|
||||||
|
* state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
|
||||||
|
* makefile for this to work.)
|
||||||
|
*
|
||||||
|
* If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
|
||||||
|
* until the next keyboard reset.
|
||||||
|
*
|
||||||
|
* NKRO may prevent your keystrokes from being detected in the BIOS, but it is
|
||||||
|
* fully operational during normal computer usage.
|
||||||
|
*
|
||||||
|
* For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
|
||||||
|
* or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
|
||||||
|
* bootmagic, NKRO mode will always be enabled until it is toggled again during a
|
||||||
|
* power-up.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
//#define FORCE_NKRO
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Feature disable options
|
||||||
|
* These options are also useful to firmware size reduction.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* disable debug print */
|
||||||
|
//#define NO_DEBUG
|
||||||
|
|
||||||
|
/* disable print */
|
||||||
|
//#define NO_PRINT
|
||||||
|
|
||||||
|
/* disable action features */
|
||||||
|
//#define NO_ACTION_LAYER
|
||||||
|
//#define NO_ACTION_TAPPING
|
||||||
|
//#define NO_ACTION_ONESHOT
|
||||||
|
//#define NO_ACTION_MACRO
|
||||||
|
//#define NO_ACTION_FUNCTION
|
||||||
|
|
||||||
|
/*
|
||||||
|
* MIDI options
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Prevent use of disabled MIDI features in the keymap */
|
||||||
|
//#define MIDI_ENABLE_STRICT 1
|
||||||
|
|
||||||
|
/* enable basic MIDI features:
|
||||||
|
- MIDI notes can be sent when in Music mode is on
|
||||||
|
*/
|
||||||
|
//#define MIDI_BASIC
|
||||||
|
|
||||||
|
/* enable advanced MIDI features:
|
||||||
|
- MIDI notes can be added to the keymap
|
||||||
|
- Octave shift and transpose
|
||||||
|
- Virtual sustain, portamento, and modulation wheel
|
||||||
|
- etc.
|
||||||
|
*/
|
||||||
|
//#define MIDI_ADVANCED
|
||||||
|
|
||||||
|
/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
|
||||||
|
//#define MIDI_TONE_KEYCODE_OCTAVES 1
|
||||||
|
|
||||||
|
// #define WS2812_LED_N 2
|
||||||
|
// #define RGBLED_NUM WS2812_LED_N
|
||||||
|
// #define WS2812_TIM_N 2
|
||||||
|
// #define WS2812_TIM_CH 2
|
||||||
|
// #define PORT_WS2812 GPIOA
|
||||||
|
// #define PIN_WS2812 1
|
||||||
|
// #define WS2812_DMA_STREAM STM32_DMA1_STREAM2 // DMA stream for TIMx_UP (look up in reference manual under DMA Channel selection)
|
||||||
|
//#define WS2812_DMA_CHANNEL 7 // DMA channel for TIMx_UP
|
||||||
|
//#define WS2812_EXTERNAL_PULLUP
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"keyboard_name": "TKC Candybar",
|
||||||
|
"url": "",
|
||||||
|
"maintainer": "terrymathews",
|
||||||
|
"width": 17,
|
||||||
|
"height": 4,
|
||||||
|
"layouts": {
|
||||||
|
"LAYOUT": {
|
||||||
|
"layout": [
|
||||||
|
{"label":"Esc", "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":"Del", "x":11, "y":0}, {"label":"BkSp", "x":12, "y":0}, {"label":"7", "x":13, "y":0}, {"label":"8", "x":14, "y":0}, {"label":"9", "x":15, "y":0}, {"label":"*", "x":16, "y":0},
|
||||||
|
{"label":"Tab", "x":0, "y":1, "w":1.25}, {"label":"A", "x":1.25, "y":1}, {"label":"S", "x":2.25, "y":1}, {"label":"D", "x":3.25, "y":1}, {"label":"F", "x":4.25, "y":1}, {"label":"G", "x":5.25, "y":1}, {"label":"H", "x":6.25, "y":1}, {"label":"J", "x":7.25, "y":1}, {"label":"K", "x":8.25, "y":1}, {"label":"L", "x":9.25, "y":1}, {"label":":", "x":10.25, "y":1}, {"label":"Enter", "x":11.25, "y":1, "w":1.75}, {"label":"4", "x":13, "y":1}, {"label":"5", "x":14, "y":1}, {"label":"6", "x":15, "y":1}, {"label":"-", "x":16, "y":1},
|
||||||
|
{"label":"Shift", "x":0, "y":2, "w":1.75}, {"label":"Z", "x":1.75, "y":2}, {"label":"X", "x":2.75, "y":2}, {"label":"C", "x":3.75, "y":2}, {"label":"V", "x":4.75, "y":2}, {"label":"B", "x":5.75, "y":2}, {"label":"N", "x":6.75, "y":2}, {"label":"M", "x":7.75, "y":2}, {"label":"<", "x":8.75, "y":2}, {"label":">", "x":9.75, "y":2}, {"label":"Shift", "x":10.75, "y":2, "w":1.25}, {"label":"↑", "x":12, "y":2}, {"label":"1", "x":13, "y":2}, {"label":"2", "x":14, "y":2}, {"label":"3", "x":15, "y":2}, {"label":"+", "x":16, "y":2},
|
||||||
|
{"label":"Ctrl", "x":0, "y":3, "w":1.25}, {"label":"GUI", "x":1.25, "y":3, "w":1.25}, {"label":"Alt", "x":2.5, "y":3, "w":1.25}, {"x":3.75, "y":3, "w":1.75}, {"x":5.5, "y":3, "w":1}, {"label":"Backspace", "x":6.5, "y":3, "w":2.25}, {"label":"Menu", "x":8.75, "y":3, "w":1.25}, {"label":"Fn", "x":10, "y":3}, {"label":"←", "x":11, "y":3}, {"label":"↓", "x":12, "y":3}, {"label":"→", "x":13, "y":3}, {"label":"0", "x":14, "y":3}, {"label":".", "x":15, "y":3}, {"label":"Enter", "x":16, "y":3}]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
File renamed without changes.
@@ -0,0 +1,15 @@
|
|||||||
|
# The Key Company Candybar
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
The Key Company Candybar is a staggered 40% board with a numpad utilizing the STM32F072 microcontroller.
|
||||||
|
|
||||||
|
* Keyboard Maintainer: [Terry Mathews](https://github.com/TerryMathews/)
|
||||||
|
* Hardware Supported: TKC Candybar
|
||||||
|
* Hardware Availability: [TheKey.Company](https://thekey.company/collections/candybar)
|
||||||
|
|
||||||
|
Make example for this keyboard (after setting up your build environment):
|
||||||
|
|
||||||
|
make candybar/righty:default:dfu-util
|
||||||
|
|
||||||
|
See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
/* Copyright 2018 Jack Humbert
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "righty.h"
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
/* Copyright 2018 Jack Humbert
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
#include "quantum.h"
|
||||||
|
|
||||||
|
#define LAYOUT( \
|
||||||
|
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, k0f, k0g, \
|
||||||
|
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1c, k1d, k1e, k1f, k1g, \
|
||||||
|
k20, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, k2e, k2f, k2g, \
|
||||||
|
k30, k31, k32, k35, k37, k38, k39, k3a, k3b, k3c, k3d, k3e, k3f, k3g \
|
||||||
|
) { \
|
||||||
|
{ k00, k01 , k02, k03 , k04 , k05, k06 , k07, k08, k09, k0a, k0b , k0c, k0d, k0e, k0f, k0g } , \
|
||||||
|
{ k10, k11 , k12, k13 , k14 , k15, k16 , k17, k18, k19, k1a, KC_NO, k1c, k1d, k1e, k1f, k1g } , \
|
||||||
|
{ k20, KC_NO, k22, k23 , k24 , k25, k26 , k27, k28, k29, k2a, k2b , k2c, k2d, k2e, k2f, k2g } , \
|
||||||
|
{ k30, k31 , k32, KC_NO, KC_NO, k35, KC_NO, k37, k38, k39, k3a, k3b , k3c, k3d, k3e, k3f, k3g } \
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
# MCU name
|
||||||
|
MCU = STM32F072
|
||||||
|
|
||||||
|
# Build Options
|
||||||
|
# comment out to disable the options.
|
||||||
|
#
|
||||||
|
# EXTRAFLAGS+=-flto
|
||||||
|
LINK_TIME_OPTIMIZATION_ENABLE = yes
|
||||||
|
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 = no # Mouse keys
|
||||||
|
EXTRAKEY_ENABLE = yes # Audio control and System control
|
||||||
|
CONSOLE_ENABLE = no # Console for debug
|
||||||
|
COMMAND_ENABLE = no # Commands for debug and configuration
|
||||||
|
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||||
|
NKRO_ENABLE = yes # USB Nkey Rollover
|
||||||
|
AUDIO_ENABLE = no
|
||||||
|
RGBLIGHT_ENABLE = no
|
||||||
|
SERIAL_LINK_ENABLE = no
|
||||||
|
|
||||||
|
|
||||||
|
# Enter lower-power sleep mode when on the ChibiOS idle thread
|
||||||
|
OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE
|
||||||
@@ -30,7 +30,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "matrix.h"
|
#include "matrix.h"
|
||||||
#include "split_util.h"
|
#include "split_util.h"
|
||||||
#include "pro_micro.h"
|
#include "quantum.h"
|
||||||
|
|
||||||
#ifdef USE_MATRIX_I2C
|
#ifdef USE_MATRIX_I2C
|
||||||
# include "i2c.h"
|
# include "i2c.h"
|
||||||
@@ -102,9 +102,10 @@ void matrix_init(void)
|
|||||||
unselect_rows();
|
unselect_rows();
|
||||||
init_cols();
|
init_cols();
|
||||||
|
|
||||||
TX_RX_LED_INIT;
|
setPinOutput(B0);
|
||||||
TXLED0;
|
setPinOutput(D5);
|
||||||
RXLED0;
|
writePinHigh(B0);
|
||||||
|
writePinHigh(D5);
|
||||||
|
|
||||||
// initialize matrix state: all keys off
|
// initialize matrix state: all keys off
|
||||||
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
|
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
|
||||||
@@ -189,10 +190,10 @@ int serial_transaction(int master_changed) {
|
|||||||
int ret=serial_update_buffers();
|
int ret=serial_update_buffers();
|
||||||
#endif
|
#endif
|
||||||
if (ret ) {
|
if (ret ) {
|
||||||
if(ret==2) RXLED1;
|
if(ret==2) writePinLow(B0);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
RXLED0;
|
writePinHigh(B0);
|
||||||
memcpy(&matrix[slaveOffset],
|
memcpy(&matrix[slaveOffset],
|
||||||
(void *)serial_slave_buffer, SERIAL_SLAVE_BUFFER_LENGTH);
|
(void *)serial_slave_buffer, SERIAL_SLAVE_BUFFER_LENGTH);
|
||||||
return 0;
|
return 0;
|
||||||
@@ -241,7 +242,7 @@ uint8_t matrix_master_scan(void) {
|
|||||||
if( serial_transaction(mchanged) ) {
|
if( serial_transaction(mchanged) ) {
|
||||||
#endif
|
#endif
|
||||||
// turn on the indicator led when halves are disconnected
|
// turn on the indicator led when halves are disconnected
|
||||||
TXLED1;
|
writePinLow(D5);
|
||||||
|
|
||||||
error_count++;
|
error_count++;
|
||||||
|
|
||||||
@@ -254,7 +255,7 @@ uint8_t matrix_master_scan(void) {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// turn off the indicator led on no error
|
// turn off the indicator led on no error
|
||||||
TXLED0;
|
writePinHigh(D5);
|
||||||
error_count = 0;
|
error_count = 0;
|
||||||
}
|
}
|
||||||
matrix_scan_quantum();
|
matrix_scan_quantum();
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define TAPPING_TERM 300
|
#define TAPPING_TERM 200
|
||||||
|
|
||||||
#define MASTER_LEFT
|
#define MASTER_LEFT
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "matrix.h"
|
#include "matrix.h"
|
||||||
#include "split_util.h"
|
#include "split_util.h"
|
||||||
#include "pro_micro.h"
|
#include "quantum.h"
|
||||||
|
|
||||||
#ifdef USE_MATRIX_I2C
|
#ifdef USE_MATRIX_I2C
|
||||||
# include "i2c.h"
|
# include "i2c.h"
|
||||||
@@ -96,37 +96,38 @@ uint8_t matrix_cols(void)
|
|||||||
void tx_rx_leds_init(void)
|
void tx_rx_leds_init(void)
|
||||||
{
|
{
|
||||||
#ifndef NO_DEBUG_LEDS
|
#ifndef NO_DEBUG_LEDS
|
||||||
TX_RX_LED_INIT;
|
setPinOutput(B0);
|
||||||
TXLED0;
|
setPinOutput(D5);
|
||||||
RXLED0;
|
writePinHigh(B0);
|
||||||
|
writePinHigh(D5);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void tx_led_on(void)
|
void tx_led_on(void)
|
||||||
{
|
{
|
||||||
#ifndef NO_DEBUG_LEDS
|
#ifndef NO_DEBUG_LEDS
|
||||||
TXLED1;
|
writePinLow(D5);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void tx_led_off(void)
|
void tx_led_off(void)
|
||||||
{
|
{
|
||||||
#ifndef NO_DEBUG_LEDS
|
#ifndef NO_DEBUG_LEDS
|
||||||
TXLED0;
|
writePinHigh(D5);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void rx_led_on(void)
|
void rx_led_on(void)
|
||||||
{
|
{
|
||||||
#ifndef NO_DEBUG_LEDS
|
#ifndef NO_DEBUG_LEDS
|
||||||
RXLED1;
|
writePinLow(B0);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void rx_led_off(void)
|
void rx_led_off(void)
|
||||||
{
|
{
|
||||||
#ifndef NO_DEBUG_LEDS
|
#ifndef NO_DEBUG_LEDS
|
||||||
RXLED0;
|
writePinHigh(B0);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+17
-22
@@ -29,24 +29,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "matrix.h"
|
#include "matrix.h"
|
||||||
#include "split_util.h"
|
#include "split_util.h"
|
||||||
|
#include "quantum.h"
|
||||||
|
|
||||||
#include "serial.h"
|
#include "serial.h"
|
||||||
|
|
||||||
// from pro_micro.h
|
|
||||||
#define TX_RX_LED_INIT DDRD |= (1<<5), DDRB |= (1<<0)
|
|
||||||
|
|
||||||
#ifndef DISABLE_PROMICRO_LEDs
|
|
||||||
#define TXLED0 PORTD |= (1<<5)
|
|
||||||
#define TXLED1 PORTD &= ~(1<<5)
|
|
||||||
#define RXLED0 PORTB |= (1<<0)
|
|
||||||
#define RXLED1 PORTB &= ~(1<<0)
|
|
||||||
#else
|
|
||||||
#define TXLED0
|
|
||||||
#define TXLED1
|
|
||||||
#define RXLED0
|
|
||||||
#define RXLED1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef DEBOUNCE
|
#ifndef DEBOUNCE
|
||||||
# define DEBOUNCE 5
|
# define DEBOUNCE 5
|
||||||
#endif
|
#endif
|
||||||
@@ -108,11 +94,12 @@ void matrix_init(void) {
|
|||||||
unselect_rows();
|
unselect_rows();
|
||||||
init_cols();
|
init_cols();
|
||||||
|
|
||||||
TX_RX_LED_INIT;
|
setPinOutput(B0);
|
||||||
|
setPinOutput(D5);
|
||||||
|
|
||||||
#ifdef DISABLE_PROMICRO_LEDs
|
#ifdef DISABLE_PROMICRO_LEDs
|
||||||
PORTD |= (1<<5);
|
writePinHigh(B0);
|
||||||
PORTB |= (1<<0);
|
writePinHigh(D5);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// initialize matrix state: all keys off
|
// initialize matrix state: all keys off
|
||||||
@@ -158,10 +145,14 @@ int serial_transaction(void) {
|
|||||||
int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0;
|
int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0;
|
||||||
int ret=serial_update_buffers();
|
int ret=serial_update_buffers();
|
||||||
if (ret ) {
|
if (ret ) {
|
||||||
if(ret==2)RXLED1;
|
#ifndef DISABLE_PROMICRO_LEDs
|
||||||
|
if(ret==2) writePinLow(B0);
|
||||||
|
#endif
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
RXLED0;
|
#ifndef DISABLE_PROMICRO_LEDs
|
||||||
|
writePinHigh(B0);
|
||||||
|
#endif
|
||||||
for (int i = 0; i < ROWS_PER_HAND; ++i) {
|
for (int i = 0; i < ROWS_PER_HAND; ++i) {
|
||||||
matrix[slaveOffset+i] = serial_slave_buffer[i];
|
matrix[slaveOffset+i] = serial_slave_buffer[i];
|
||||||
}
|
}
|
||||||
@@ -197,8 +188,10 @@ uint8_t matrix_master_scan(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if( serial_transaction() ) {
|
if( serial_transaction() ) {
|
||||||
|
#ifndef DISABLE_PROMICRO_LEDs
|
||||||
// turn on the indicator led when halves are disconnected
|
// turn on the indicator led when halves are disconnected
|
||||||
TXLED1;
|
writePinLow(D5);
|
||||||
|
#endif
|
||||||
|
|
||||||
error_count++;
|
error_count++;
|
||||||
|
|
||||||
@@ -210,8 +203,10 @@ uint8_t matrix_master_scan(void) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
#ifndef DISABLE_PROMICRO_LEDs
|
||||||
// turn off the indicator led on no error
|
// turn off the indicator led on no error
|
||||||
TXLED0;
|
writePinHigh(D5);
|
||||||
|
#endif
|
||||||
error_count = 0;
|
error_count = 0;
|
||||||
}
|
}
|
||||||
matrix_scan_quantum();
|
matrix_scan_quantum();
|
||||||
|
|||||||
@@ -29,8 +29,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "matrix.h"
|
#include "matrix.h"
|
||||||
#include "split_util.h"
|
#include "split_util.h"
|
||||||
#include "pro_micro.h"
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
#include "quantum.h"
|
||||||
|
|
||||||
#ifdef USE_I2C
|
#ifdef USE_I2C
|
||||||
# include "i2c.h"
|
# include "i2c.h"
|
||||||
@@ -100,7 +100,8 @@ void matrix_init(void)
|
|||||||
unselect_rows();
|
unselect_rows();
|
||||||
init_cols();
|
init_cols();
|
||||||
|
|
||||||
TX_RX_LED_INIT;
|
setPinOutput(B0);
|
||||||
|
setPinOutput(D5);
|
||||||
|
|
||||||
// initialize matrix state: all keys off
|
// initialize matrix state: all keys off
|
||||||
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
|
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
|
||||||
@@ -201,7 +202,7 @@ uint8_t matrix_scan(void)
|
|||||||
if( serial_transaction() ) {
|
if( serial_transaction() ) {
|
||||||
#endif
|
#endif
|
||||||
// turn on the indicator led when halves are disconnected
|
// turn on the indicator led when halves are disconnected
|
||||||
TXLED1;
|
writePinLow(D5);
|
||||||
|
|
||||||
error_count++;
|
error_count++;
|
||||||
|
|
||||||
@@ -214,7 +215,7 @@ uint8_t matrix_scan(void)
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// turn off the indicator led on no error
|
// turn off the indicator led on no error
|
||||||
TXLED0;
|
writePinHigh(D5);
|
||||||
error_count = 0;
|
error_count = 0;
|
||||||
}
|
}
|
||||||
matrix_scan_quantum();
|
matrix_scan_quantum();
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "matrix.h"
|
#include "matrix.h"
|
||||||
#include "split_util.h"
|
#include "split_util.h"
|
||||||
#include "pro_micro.h"
|
#include "quantum.h"
|
||||||
|
|
||||||
#ifdef USE_MATRIX_I2C
|
#ifdef USE_MATRIX_I2C
|
||||||
# include "i2c.h"
|
# include "i2c.h"
|
||||||
@@ -99,9 +99,10 @@ void matrix_init(void)
|
|||||||
unselect_rows();
|
unselect_rows();
|
||||||
init_cols();
|
init_cols();
|
||||||
|
|
||||||
TX_RX_LED_INIT;
|
setPinOutput(B0);
|
||||||
TXLED0;
|
setPinOutput(D5);
|
||||||
RXLED0;
|
writePinHigh(B0);
|
||||||
|
writePinHigh(D5);
|
||||||
|
|
||||||
// initialize matrix state: all keys off
|
// initialize matrix state: all keys off
|
||||||
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
|
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
|
||||||
@@ -180,10 +181,10 @@ int serial_transaction(void) {
|
|||||||
int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0;
|
int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0;
|
||||||
int ret=serial_update_buffers();
|
int ret=serial_update_buffers();
|
||||||
if (ret ) {
|
if (ret ) {
|
||||||
if(ret==2)RXLED1;
|
if(ret==2) writePinLow(B0);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
RXLED0;
|
writePinHigh(B0);
|
||||||
for (int i = 0; i < ROWS_PER_HAND; ++i) {
|
for (int i = 0; i < ROWS_PER_HAND; ++i) {
|
||||||
matrix[slaveOffset+i] = serial_slave_buffer[i];
|
matrix[slaveOffset+i] = serial_slave_buffer[i];
|
||||||
}
|
}
|
||||||
@@ -235,7 +236,7 @@ uint8_t matrix_master_scan(void) {
|
|||||||
if( serial_transaction() ) {
|
if( serial_transaction() ) {
|
||||||
#endif
|
#endif
|
||||||
// turn on the indicator led when halves are disconnected
|
// turn on the indicator led when halves are disconnected
|
||||||
TXLED1;
|
writePinLow(D5);
|
||||||
|
|
||||||
error_count++;
|
error_count++;
|
||||||
|
|
||||||
@@ -248,7 +249,7 @@ uint8_t matrix_master_scan(void) {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// turn off the indicator led on no error
|
// turn off the indicator led on no error
|
||||||
TXLED0;
|
writePinHigh(D5);
|
||||||
error_count = 0;
|
error_count = 0;
|
||||||
}
|
}
|
||||||
matrix_scan_quantum();
|
matrix_scan_quantum();
|
||||||
|
|||||||
@@ -29,8 +29,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "matrix.h"
|
#include "matrix.h"
|
||||||
#include "split_util.h"
|
#include "split_util.h"
|
||||||
#include "pro_micro.h"
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
#include "quantum.h"
|
||||||
|
|
||||||
#ifdef USE_MATRIX_I2C
|
#ifdef USE_MATRIX_I2C
|
||||||
# include "i2c.h"
|
# include "i2c.h"
|
||||||
@@ -100,7 +100,8 @@ void matrix_init(void)
|
|||||||
unselect_rows();
|
unselect_rows();
|
||||||
init_cols();
|
init_cols();
|
||||||
|
|
||||||
TX_RX_LED_INIT;
|
setPinOutput(B0);
|
||||||
|
setPinOutput(D5);
|
||||||
|
|
||||||
// initialize matrix state: all keys off
|
// initialize matrix state: all keys off
|
||||||
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
|
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
|
||||||
@@ -201,7 +202,7 @@ uint8_t matrix_scan(void)
|
|||||||
if( serial_transaction() ) {
|
if( serial_transaction() ) {
|
||||||
#endif
|
#endif
|
||||||
// turn on the indicator led when halves are disconnected
|
// turn on the indicator led when halves are disconnected
|
||||||
TXLED1;
|
writePinLow(D5);
|
||||||
|
|
||||||
error_count++;
|
error_count++;
|
||||||
|
|
||||||
@@ -214,7 +215,7 @@ uint8_t matrix_scan(void)
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// turn off the indicator led on no error
|
// turn off the indicator led on no error
|
||||||
TXLED0;
|
writePinHigh(D5);
|
||||||
error_count = 0;
|
error_count = 0;
|
||||||
}
|
}
|
||||||
matrix_scan_quantum();
|
matrix_scan_quantum();
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "matrix.h"
|
#include "matrix.h"
|
||||||
#include "split_util.h"
|
#include "split_util.h"
|
||||||
#include "pro_micro.h"
|
#include "quantum.h"
|
||||||
|
|
||||||
#ifdef USE_MATRIX_I2C
|
#ifdef USE_MATRIX_I2C
|
||||||
# include "i2c.h"
|
# include "i2c.h"
|
||||||
@@ -100,9 +100,10 @@ void matrix_init(void)
|
|||||||
unselect_rows();
|
unselect_rows();
|
||||||
init_cols();
|
init_cols();
|
||||||
|
|
||||||
TX_RX_LED_INIT;
|
setPinOutput(B0);
|
||||||
TXLED0;
|
setPinOutput(D5);
|
||||||
RXLED0;
|
writePinHigh(B0);
|
||||||
|
writePinHigh(D5);
|
||||||
|
|
||||||
// initialize matrix state: all keys off
|
// initialize matrix state: all keys off
|
||||||
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
|
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
|
||||||
@@ -185,10 +186,10 @@ int serial_transaction(int master_changed) {
|
|||||||
int ret=serial_update_buffers();
|
int ret=serial_update_buffers();
|
||||||
#endif
|
#endif
|
||||||
if (ret ) {
|
if (ret ) {
|
||||||
if(ret==2) RXLED1;
|
if(ret==2) writePinLow(B0);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
RXLED0;
|
writePinHigh(B0);
|
||||||
memcpy(&matrix[slaveOffset],
|
memcpy(&matrix[slaveOffset],
|
||||||
(void *)serial_slave_buffer, sizeof(serial_slave_buffer));
|
(void *)serial_slave_buffer, sizeof(serial_slave_buffer));
|
||||||
return 0;
|
return 0;
|
||||||
@@ -239,7 +240,7 @@ uint8_t matrix_master_scan(void) {
|
|||||||
if( serial_transaction(mchanged) ) {
|
if( serial_transaction(mchanged) ) {
|
||||||
#endif
|
#endif
|
||||||
// turn on the indicator led when halves are disconnected
|
// turn on the indicator led when halves are disconnected
|
||||||
TXLED1;
|
writePinLow(D5);
|
||||||
|
|
||||||
error_count++;
|
error_count++;
|
||||||
|
|
||||||
@@ -252,7 +253,7 @@ uint8_t matrix_master_scan(void) {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// turn off the indicator led on no error
|
// turn off the indicator led on no error
|
||||||
TXLED0;
|
writePinHigh(D5);
|
||||||
error_count = 0;
|
error_count = 0;
|
||||||
}
|
}
|
||||||
matrix_scan_quantum();
|
matrix_scan_quantum();
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ MCU = atmega32u4
|
|||||||
# QMK DFU qmk-dfu
|
# QMK DFU qmk-dfu
|
||||||
# ATmega32A bootloadHID
|
# ATmega32A bootloadHID
|
||||||
# ATmega328P USBasp
|
# ATmega328P USBasp
|
||||||
BOOTLOADER = atmel-dfu
|
BOOTLOADER = caterina
|
||||||
|
|
||||||
# Build Options
|
# Build Options
|
||||||
# change yes to no to disable
|
# change yes to no to disable
|
||||||
|
|||||||
@@ -27,7 +27,8 @@ CUSTOM_MATRIX = yes # Custom matrix file
|
|||||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||||
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||||
NKRO_ENABLE = yes # USB Nkey Rollover
|
NKRO_ENABLE = yes # USB Nkey Rollover
|
||||||
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
|
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
|
||||||
|
BACKLIGHT_DRIVER = custom
|
||||||
MIDI_ENABLE = no # MIDI support
|
MIDI_ENABLE = no # MIDI support
|
||||||
UNICODE_ENABLE = no # Unicode
|
UNICODE_ENABLE = no # Unicode
|
||||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define TAPPING_TERM 300
|
#define TAPPING_TERM 200
|
||||||
|
|
||||||
#ifdef OLED_DRIVER_ENABLE
|
#ifdef OLED_DRIVER_ENABLE
|
||||||
#define OLED_DISPLAY_128X64
|
#define OLED_DISPLAY_128X64
|
||||||
|
|||||||
@@ -1,84 +0,0 @@
|
|||||||
/* Copyright 2020 ninjonas
|
|
||||||
*
|
|
||||||
* 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 "ninjonas.h"
|
|
||||||
|
|
||||||
#ifdef ENCODER_ENABLE
|
|
||||||
void encoder_update_user(uint8_t index, bool clockwise) {
|
|
||||||
if (index == 0) {
|
|
||||||
switch (get_highest_layer(layer_state)) {
|
|
||||||
case _LOWER:
|
|
||||||
if (clockwise) {
|
|
||||||
tap_code16(SGUI(KC_TAB));
|
|
||||||
} else {
|
|
||||||
tap_code16(LGUI(KC_TAB));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case _RAISE:
|
|
||||||
if (clockwise) {
|
|
||||||
tap_code(KC_PGUP);
|
|
||||||
} else {
|
|
||||||
tap_code(KC_PGDN);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case _ADJUST:
|
|
||||||
if (clockwise) {
|
|
||||||
rgblight_increase_hue();
|
|
||||||
} else {
|
|
||||||
rgblight_decrease_hue();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
if (clockwise) {
|
|
||||||
tap_code(KC_BRIU);
|
|
||||||
} else {
|
|
||||||
tap_code(KC_BRID);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} else if (index == 1) {
|
|
||||||
switch (get_highest_layer(layer_state)) {
|
|
||||||
case _LOWER:
|
|
||||||
if (clockwise) {
|
|
||||||
tap_code(KC_UP);
|
|
||||||
} else {
|
|
||||||
tap_code(KC_DOWN);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case _RAISE:
|
|
||||||
if (clockwise) {
|
|
||||||
tap_code16(LCTL(KC_TAB));
|
|
||||||
} else {
|
|
||||||
tap_code16(LCTL(LSFT(KC_TAB)));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case _ADJUST:
|
|
||||||
if (clockwise) {
|
|
||||||
rgblight_increase_val();
|
|
||||||
} else {
|
|
||||||
rgblight_decrease_val();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
if (clockwise) {
|
|
||||||
tap_code(KC_VOLU);
|
|
||||||
} else {
|
|
||||||
tap_code(KC_VOLD);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
@@ -24,7 +24,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||||||
// |--------+-----——-+——------+-——-----+——------+——-----| |------—+——------+——------+——------+——------+--------|
|
// |--------+-----——-+——------+-——-----+——------+——-----| |------—+——------+——------+——------+——------+--------|
|
||||||
_____________________QWERTY_L2______________________, _____________________QWERTY_R2______________________,
|
_____________________QWERTY_L2______________________, _____________________QWERTY_R2______________________,
|
||||||
// |--------+-----——-+——------+-——-----+——------+——-----+———-----------. ,——————————————+------—+——------+——------+——------+——------+--------|
|
// |--------+-----——-+——------+-——-----+——------+——-----+———-----------. ,——————————————+------—+——------+——------+——------+——------+--------|
|
||||||
_____________________QWERTY_L3______________________,XXXXXXX,KC_LALT, T_CPNU,XXXXXXX,_____________________QWERTY_R3______________________,
|
_____________________QWERTY_L3______________________,XXXXXXX,KC_LALT, T_CPAP,XXXXXXX,_____________________QWERTY_R3______________________,
|
||||||
// `--------------------------+--------+--------+-------+-------+------| |------+-------+-------+--------+--------+--------+--------+--------'
|
// `--------------------------+--------+--------+-------+-------+------| |------+-------+-------+--------+--------+--------+--------+--------'
|
||||||
_____________MOD_LEFT_____________,T_LBRC, T_RBRC,________MOD_RIGHT________,KC_MUTE
|
_____________MOD_LEFT_____________,T_LBRC, T_RBRC,________MOD_RIGHT________,KC_MUTE
|
||||||
// `----------------------------------------' `----------------------------------------'
|
// `----------------------------------------' `----------------------------------------'
|
||||||
@@ -36,7 +36,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||||||
// |--------+-----——-+——------+-——-----+——------+——-----| |------—+——------+——------+——------+——------+--------|
|
// |--------+-----——-+——------+-——-----+——------+——-----| |------—+——------+——------+——------+——------+--------|
|
||||||
_____________________DVORAK_L2______________________, _____________________DVORAK_R2______________________,
|
_____________________DVORAK_L2______________________, _____________________DVORAK_R2______________________,
|
||||||
// |--------+-----——-+——------+-——-----+——------+——-----+———-----------. ,——————————————+------—+——------+——------+——------+——------+--------|
|
// |--------+-----——-+——------+-——-----+——------+——-----+———-----------. ,——————————————+------—+——------+——------+——------+——------+--------|
|
||||||
_____________________DVORAK_L3______________________,XXXXXXX,KC_LALT, T_CPNU,XXXXXXX,_____________________DVORAK_R3______________________,
|
_____________________DVORAK_L3______________________,XXXXXXX,KC_LALT, T_CPAP,XXXXXXX,_____________________DVORAK_R3______________________,
|
||||||
// `--------------------------+--------+--------+-------+-------+------| |------+-------+-------+--------+--------+--------+--------+--------'
|
// `--------------------------+--------+--------+-------+-------+------| |------+-------+-------+--------+--------+--------+--------+--------'
|
||||||
_____________MOD_LEFT_____________,T_LBRC, T_RBRC,________MOD_RIGHT________,KC_MUTE
|
_____________MOD_LEFT_____________,T_LBRC, T_RBRC,________MOD_RIGHT________,KC_MUTE
|
||||||
// `----------------------------------------' `----------------------------------------'
|
// `----------------------------------------' `----------------------------------------'
|
||||||
@@ -48,7 +48,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||||||
// |--------+-----——-+——------+-——-----+——------+——-----| |------—+——------+——------+——------+——------+--------|
|
// |--------+-----——-+——------+-——-----+——------+——-----| |------—+——------+——------+——------+——------+--------|
|
||||||
_____________________COLEMAK_L2_____________________, _____________________COLEMAK_R2_____________________,
|
_____________________COLEMAK_L2_____________________, _____________________COLEMAK_R2_____________________,
|
||||||
// |--------+-----——-+——------+-——-----+——------+——-----+———-----------. ,——————————————+------—+——------+——------+——------+——------+--------|
|
// |--------+-----——-+——------+-——-----+——------+——-----+———-----------. ,——————————————+------—+——------+——------+——------+——------+--------|
|
||||||
_____________________COLEMAK_L3_____________________,XXXXXXX,KC_LALT, T_CPNU,XXXXXXX,_____________________COLEMAK_R3_____________________,
|
_____________________COLEMAK_L3_____________________,XXXXXXX,KC_LALT, T_CPAP,XXXXXXX,_____________________COLEMAK_R3_____________________,
|
||||||
// `--------------------------+--------+--------+-------+-------+------| |------+-------+-------+--------+--------+--------+--------+--------'
|
// `--------------------------+--------+--------+-------+-------+------| |------+-------+-------+--------+--------+--------+--------+--------'
|
||||||
_____________MOD_LEFT_____________,T_LBRC, T_RBRC,________MOD_RIGHT________,KC_MUTE
|
_____________MOD_LEFT_____________,T_LBRC, T_RBRC,________MOD_RIGHT________,KC_MUTE
|
||||||
// `----------------------------------------' `----------------------------------------'
|
// `----------------------------------------' `----------------------------------------'
|
||||||
|
|||||||
@@ -105,8 +105,12 @@ void oled_white_space(void){
|
|||||||
oled_write_P(PSTR(" "), false);
|
oled_write_P(PSTR(" "), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void oled_slash_separator(void){
|
||||||
|
oled_write_P(PSTR(" / "), false);
|
||||||
|
}
|
||||||
|
|
||||||
void render_layout_state(void) {
|
void render_layout_state(void) {
|
||||||
oled_write_P(PSTR("\nLayout: "), false);
|
oled_write_P(PSTR("Layout: "), false);
|
||||||
switch (biton32(default_layer_state)) {
|
switch (biton32(default_layer_state)) {
|
||||||
case _COLEMAK:
|
case _COLEMAK:
|
||||||
oled_write_P(PSTR("Colemak"), false);
|
oled_write_P(PSTR("Colemak"), false);
|
||||||
@@ -121,6 +125,37 @@ void render_layout_state(void) {
|
|||||||
oled_write_ln_P(PSTR("Undefined"), false);
|
oled_write_ln_P(PSTR("Undefined"), false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#ifdef ENCODER_ENABLE
|
||||||
|
static void render_encoder_state(void) {
|
||||||
|
oled_write_P(PSTR("\nEnc: "), false);
|
||||||
|
bool lower = layer_state_is(_LOWER) & !layer_state_is(_ADJUST);
|
||||||
|
bool raise = layer_state_is(_RAISE) & !layer_state_is(_ADJUST);
|
||||||
|
bool adjust = layer_state_is(_ADJUST);
|
||||||
|
|
||||||
|
if(lower){
|
||||||
|
oled_write_P(PSTR("APPSW"), left_encoder_rotated);
|
||||||
|
oled_slash_separator();
|
||||||
|
oled_write_P(PSTR("UPDN"), right_encoder_rotated);
|
||||||
|
} else if(raise){
|
||||||
|
oled_write_P(PSTR("PGUD"), left_encoder_rotated);
|
||||||
|
oled_slash_separator();
|
||||||
|
oled_write_P(PSTR("TABSW"), right_encoder_rotated);
|
||||||
|
} else if(adjust){
|
||||||
|
oled_write_P(PSTR("RHUE"), left_encoder_rotated);
|
||||||
|
oled_slash_separator();
|
||||||
|
oled_write_P(PSTR("RBRI"), right_encoder_rotated);
|
||||||
|
} else {
|
||||||
|
oled_write_P(PSTR("BRI"), left_encoder_rotated);
|
||||||
|
oled_slash_separator();
|
||||||
|
oled_write_P(PSTR("VOL"), right_encoder_rotated);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (timer_elapsed(encoder_rotated_timer) > 200) {
|
||||||
|
left_encoder_rotated = false;
|
||||||
|
right_encoder_rotated = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static void render_layer_state(void) {
|
static void render_layer_state(void) {
|
||||||
oled_write_P(PSTR("\nLayer:"), false);
|
oled_write_P(PSTR("\nLayer:"), false);
|
||||||
@@ -156,6 +191,9 @@ void render_mod_state(uint8_t modifiers) {
|
|||||||
static void render_status(void) {
|
static void render_status(void) {
|
||||||
render_qmk_logo();
|
render_qmk_logo();
|
||||||
render_layout_state();
|
render_layout_state();
|
||||||
|
#ifdef ENCODER_ENABLE
|
||||||
|
render_encoder_state();
|
||||||
|
#endif
|
||||||
render_layer_state();
|
render_layer_state();
|
||||||
render_mod_state(get_mods()|get_oneshot_mods());
|
render_mod_state(get_mods()|get_oneshot_mods());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,5 +3,4 @@ ENCODER_ENABLE = yes # Enables the use of one or more encoders
|
|||||||
RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
|
RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
|
||||||
LINK_TIME_OPTIMIZATION_ENABLE = yes
|
LINK_TIME_OPTIMIZATION_ENABLE = yes
|
||||||
|
|
||||||
SRC += encoder.c \
|
SRC += oled.c
|
||||||
oled.c
|
|
||||||
@@ -125,7 +125,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||||||
XXXXXXX, XXXXXXX, _____________MOUSE_1______________, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
XXXXXXX, XXXXXXX, _____________MOUSE_1______________, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||||
XXXXXXX, XXXXXXX, _____________MOUSE_2______________, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
XXXXXXX, XXXXXXX, _____________MOUSE_2______________, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||||
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||||
__________________________________, __________________________________
|
__________________________________, _______, _______, _______, K_CPRF
|
||||||
),
|
),
|
||||||
|
|
||||||
/* ADJUST
|
/* ADJUST
|
||||||
|
|||||||
@@ -1 +1,2 @@
|
|||||||
OLED_DRIVER_ENABLE = yes
|
OLED_DRIVER_ENABLE = yes
|
||||||
|
LINK_TIME_OPTIMIZATION_ENABLE = yes
|
||||||
@@ -30,7 +30,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "matrix.h"
|
#include "matrix.h"
|
||||||
#include "split_util.h"
|
#include "split_util.h"
|
||||||
#include "pro_micro.h"
|
#include "quantum.h"
|
||||||
|
|
||||||
#ifdef USE_MATRIX_I2C
|
#ifdef USE_MATRIX_I2C
|
||||||
# include "i2c.h"
|
# include "i2c.h"
|
||||||
@@ -101,9 +101,10 @@ void matrix_init(void)
|
|||||||
unselect_rows();
|
unselect_rows();
|
||||||
init_cols();
|
init_cols();
|
||||||
|
|
||||||
TX_RX_LED_INIT;
|
setPinOutput(B0);
|
||||||
TXLED0;
|
setPinOutput(D5);
|
||||||
RXLED0;
|
writePinHigh(B0);
|
||||||
|
writePinHigh(D5);
|
||||||
|
|
||||||
// initialize matrix state: all keys off
|
// initialize matrix state: all keys off
|
||||||
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
|
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
|
||||||
@@ -188,10 +189,10 @@ int serial_transaction(int master_changed) {
|
|||||||
int ret=serial_update_buffers();
|
int ret=serial_update_buffers();
|
||||||
#endif
|
#endif
|
||||||
if (ret ) {
|
if (ret ) {
|
||||||
if(ret==2) RXLED1;
|
if(ret==2) writePinLow(B0);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
RXLED0;
|
writePinHigh(B0);
|
||||||
memcpy(&matrix[slaveOffset],
|
memcpy(&matrix[slaveOffset],
|
||||||
(void *)serial_slave_buffer, SERIAL_SLAVE_BUFFER_LENGTH);
|
(void *)serial_slave_buffer, SERIAL_SLAVE_BUFFER_LENGTH);
|
||||||
return 0;
|
return 0;
|
||||||
@@ -240,7 +241,7 @@ uint8_t matrix_master_scan(void) {
|
|||||||
if( serial_transaction(mchanged) ) {
|
if( serial_transaction(mchanged) ) {
|
||||||
#endif
|
#endif
|
||||||
// turn on the indicator led when halves are disconnected
|
// turn on the indicator led when halves are disconnected
|
||||||
TXLED1;
|
writePinLow(D5);
|
||||||
|
|
||||||
error_count++;
|
error_count++;
|
||||||
|
|
||||||
@@ -253,7 +254,7 @@ uint8_t matrix_master_scan(void) {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// turn off the indicator led on no error
|
// turn off the indicator led on no error
|
||||||
TXLED0;
|
writePinHigh(D5);
|
||||||
error_count = 0;
|
error_count = 0;
|
||||||
}
|
}
|
||||||
matrix_scan_quantum();
|
matrix_scan_quantum();
|
||||||
|
|||||||
@@ -27,5 +27,5 @@
|
|||||||
#define USE_SERIAL_PD2
|
#define USE_SERIAL_PD2
|
||||||
|
|
||||||
#define TAPPING_FORCE_HOLD
|
#define TAPPING_FORCE_HOLD
|
||||||
#define TAPPING_TERM 300
|
#define TAPPING_TERM 200
|
||||||
#define RETRO_TAPPPING
|
#define RETRO_TAPPPING
|
||||||
@@ -31,7 +31,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||||||
//|---------+---------+---------+---------+---------+---------+---------| |---------+---------+---------+---------+---------+---------+---------|
|
//|---------+---------+---------+---------+---------+---------+---------| |---------+---------+---------+---------+---------+---------+---------|
|
||||||
_____________________QWERTY_L3______________________, LT_RAI, LT_LOW, _____________________QWERTY_R3______________________,
|
_____________________QWERTY_L3______________________, LT_RAI, LT_LOW, _____________________QWERTY_R3______________________,
|
||||||
//|---------+---------+---------+---------+---------+---------+---------| |---------+---------+---------+---------+---------+---------+---------|
|
//|---------+---------+---------+---------+---------+---------+---------| |---------+---------+---------+---------+---------+---------+---------|
|
||||||
________MOD_LEFT_________, K_LAPP, K_RAPP, ________MOD_RIGHT________
|
________MOD_LEFT_________, XXXXXXX, XXXXXXX, ________MOD_RIGHT________
|
||||||
//`---------------------------------------' `---------------------------------------'
|
//`---------------------------------------' `---------------------------------------'
|
||||||
),
|
),
|
||||||
|
|
||||||
@@ -43,7 +43,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||||||
//|---------+---------+---------+---------+---------+---------+---------| |---------+---------+---------+---------+---------+---------+---------|
|
//|---------+---------+---------+---------+---------+---------+---------| |---------+---------+---------+---------+---------+---------+---------|
|
||||||
_____________________DVORAK_L3______________________, LT_RAI, LT_LOW, _____________________DVORAK_R3______________________,
|
_____________________DVORAK_L3______________________, LT_RAI, LT_LOW, _____________________DVORAK_R3______________________,
|
||||||
//|---------+---------+---------+---------+---------+---------+---------| |---------+---------+---------+---------+---------+---------+---------|
|
//|---------+---------+---------+---------+---------+---------+---------| |---------+---------+---------+---------+---------+---------+---------|
|
||||||
________MOD_LEFT_________, K_LAPP, K_RAPP, ________MOD_RIGHT________
|
________MOD_LEFT_________, XXXXXXX, XXXXXXX, ________MOD_RIGHT________
|
||||||
//`---------------------------------------' `---------------------------------------'
|
//`---------------------------------------' `---------------------------------------'
|
||||||
),
|
),
|
||||||
|
|
||||||
@@ -55,7 +55,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||||||
//|---------+---------+---------+---------+---------+---------+---------| |---------+---------+---------+---------+---------+---------+---------|
|
//|---------+---------+---------+---------+---------+---------+---------| |---------+---------+---------+---------+---------+---------+---------|
|
||||||
_____________________COLEMAK_L3_____________________, LT_RAI, LT_LOW, _____________________COLEMAK_R3_____________________,
|
_____________________COLEMAK_L3_____________________, LT_RAI, LT_LOW, _____________________COLEMAK_R3_____________________,
|
||||||
//|---------+---------+---------+---------+---------+---------+---------| |---------+---------+---------+---------+---------+---------+---------|
|
//|---------+---------+---------+---------+---------+---------+---------| |---------+---------+---------+---------+---------+---------+---------|
|
||||||
________MOD_LEFT_________, K_LAPP, K_RAPP, ________MOD_RIGHT________
|
________MOD_LEFT_________, XXXXXXX, XXXXXXX, ________MOD_RIGHT________
|
||||||
//`---------------------------------------' `---------------------------------------'
|
//`---------------------------------------' `---------------------------------------'
|
||||||
),
|
),
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
#define DEFAULT_LAYER 0
|
||||||
|
#define HHKB_NAV_LAYER 1
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
[DEFAULT_LAYER] = LAYOUT_hhkb_arrow(
|
||||||
|
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_BSLS, KC_GRV,
|
||||||
|
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_BSPC,
|
||||||
|
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_SPC, KC_SPC, KC_RALT, KC_RGUI, _______, KC_MENU, KC_RCTL
|
||||||
|
),
|
||||||
|
|
||||||
|
[HHKB_NAV_LAYER] = LAYOUT_hhkb_arrow(
|
||||||
|
RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, _______, KC_DEL,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_ENT,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, KC_END, KC_PGDN, KC_DOWN, _______, _______,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||||
|
)
|
||||||
|
};
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
# cijanzen's keymap for the Bananasplit
|
||||||
|
## Layout Notes
|
||||||
|
|
||||||
|
Split right shift and split backspace. Second layer follows HHKB layer 2 layout.
|
||||||
|
|
||||||
|
Base layer:
|
||||||
|
```
|
||||||
|
-------------------------------------------------------------------------------------------
|
||||||
|
| Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | \ | ` |
|
||||||
|
-------------------------------------------------------------------------------------------
|
||||||
|
| Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] |Backspace|
|
||||||
|
-------------------------------------------------------------------------------------------
|
||||||
|
| Caps | A | S | D | F | G | H | J | K | L | ; | ' | Enter |
|
||||||
|
-------------------------------------------------------------------------------------------
|
||||||
|
| Shift | Z | X | C | V | B | N | M | , | . | / | Shift | Fn1 |
|
||||||
|
-------------------------------------------------------------------------------------------
|
||||||
|
| Ctrl | GUI | Alt | Space | Alt | GUI | App | Ctrl |
|
||||||
|
-------------------------------------------------------------------------------------------
|
||||||
|
```
|
||||||
|
|
||||||
|
Fn1 layer:
|
||||||
|
|
||||||
|
```
|
||||||
|
-------------------------------------------------------------------------------------------
|
||||||
|
|Reset| F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Ins | Del |
|
||||||
|
-------------------------------------------------------------------------------------------
|
||||||
|
| | | | | | | | |Pscr |Slck |Paus | Up | | Del |
|
||||||
|
-------------------------------------------------------------------------------------------
|
||||||
|
| | | | | | | | |Home |PgUp |Left |Right| Enter |
|
||||||
|
-------------------------------------------------------------------------------------------
|
||||||
|
| | | | | | | | |End |PgDn |Down | | |
|
||||||
|
-------------------------------------------------------------------------------------------
|
||||||
|
| | | | | | | | |
|
||||||
|
-------------------------------------------------------------------------------------------
|
||||||
|
```
|
||||||
@@ -0,0 +1,252 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2020 Koichi Katano
|
||||||
|
|
||||||
|
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 0x5967
|
||||||
|
#define DEVICE_VER 0x0001
|
||||||
|
#define MANUFACTURER Koichi Katano
|
||||||
|
#define PRODUCT Wallaby
|
||||||
|
#define DESCRIPTION A Tenkeyless PCB
|
||||||
|
|
||||||
|
/* key matrix size */
|
||||||
|
#define MATRIX_ROWS 6
|
||||||
|
#define MATRIX_COLS 17
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Keyboard Matrix Assignments
|
||||||
|
*
|
||||||
|
* Change this to how you wired your keyboard
|
||||||
|
* COLS: AVR pins used for columns, left to right
|
||||||
|
* ROWS: AVR pins used for rows, top to bottom
|
||||||
|
* DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
|
||||||
|
* ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#define MATRIX_ROW_PINS { B5, B4, B3, B2, B1, B0 }
|
||||||
|
#define MATRIX_COL_PINS { D5, C7, C6, D4, D0, E6, F0, F1, F4, F5, F6, F7, D7, D6, D1, D2, D3 }
|
||||||
|
#define UNUSED_PINS
|
||||||
|
|
||||||
|
/* COL2ROW, ROW2COL*/
|
||||||
|
#define DIODE_DIRECTION COL2ROW
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN.
|
||||||
|
*/
|
||||||
|
// #define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6
|
||||||
|
|
||||||
|
// #define BACKLIGHT_PIN B7
|
||||||
|
// #define BACKLIGHT_BREATHING
|
||||||
|
// #define BACKLIGHT_LEVELS 3
|
||||||
|
|
||||||
|
// #define RGB_DI_PIN E2
|
||||||
|
// #ifdef RGB_DI_PIN
|
||||||
|
// #define RGBLED_NUM 16
|
||||||
|
// #define RGBLIGHT_HUE_STEP 8
|
||||||
|
// #define RGBLIGHT_SAT_STEP 8
|
||||||
|
// #define RGBLIGHT_VAL_STEP 8
|
||||||
|
// #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */
|
||||||
|
// #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */
|
||||||
|
// /*== all animations enable ==*/
|
||||||
|
// #define RGBLIGHT_ANIMATIONS
|
||||||
|
// /*== or choose animations ==*/
|
||||||
|
// #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
|
||||||
|
// /*== customize breathing effect ==*/
|
||||||
|
// /*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/
|
||||||
|
// #define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64
|
||||||
|
// /*==== use exp() and sin() ====*/
|
||||||
|
// #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7
|
||||||
|
// #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
|
||||||
|
#define DEBOUNCE 5
|
||||||
|
|
||||||
|
/* define if matrix has ghost (lacks anti-ghosting diodes) */
|
||||||
|
//#define MATRIX_HAS_GHOST
|
||||||
|
|
||||||
|
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
||||||
|
#define LOCKING_SUPPORT_ENABLE
|
||||||
|
/* Locking resynchronize hack */
|
||||||
|
#define LOCKING_RESYNC_ENABLE
|
||||||
|
|
||||||
|
/* If defined, GRAVE_ESC will always act as ESC when CTRL is held.
|
||||||
|
* This is userful for the Windows task manager shortcut (ctrl+shift+esc).
|
||||||
|
*/
|
||||||
|
// #define GRAVE_ESC_CTRL_OVERRIDE
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Force NKRO
|
||||||
|
*
|
||||||
|
* Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
|
||||||
|
* state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
|
||||||
|
* makefile for this to work.)
|
||||||
|
*
|
||||||
|
* If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
|
||||||
|
* until the next keyboard reset.
|
||||||
|
*
|
||||||
|
* NKRO may prevent your keystrokes from being detected in the BIOS, but it is
|
||||||
|
* fully operational during normal computer usage.
|
||||||
|
*
|
||||||
|
* For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
|
||||||
|
* or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
|
||||||
|
* bootmagic, NKRO mode will always be enabled until it is toggled again during a
|
||||||
|
* power-up.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
//#define FORCE_NKRO
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Magic Key Options
|
||||||
|
*
|
||||||
|
* Magic keys are hotkey commands that allow control over firmware functions of
|
||||||
|
* the keyboard. They are best used in combination with the HID Listen program,
|
||||||
|
* found here: https://www.pjrc.com/teensy/hid_listen.html
|
||||||
|
*
|
||||||
|
* The options below allow the magic key functionality to be changed. This is
|
||||||
|
* useful if your keyboard/keypad is missing keys and you want magic key support.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* key combination for magic key command */
|
||||||
|
/* defined by default; to change, uncomment and set to the combination you want */
|
||||||
|
// #define IS_COMMAND() (get_mods() == MOD_MASK_SHIFT)
|
||||||
|
|
||||||
|
/* control how magic key switches layers */
|
||||||
|
//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true
|
||||||
|
//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true
|
||||||
|
//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false
|
||||||
|
|
||||||
|
/* override magic key keymap */
|
||||||
|
//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS
|
||||||
|
//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS
|
||||||
|
//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM
|
||||||
|
//#define MAGIC_KEY_HELP H
|
||||||
|
//#define MAGIC_KEY_HELP_ALT SLASH
|
||||||
|
//#define MAGIC_KEY_DEBUG D
|
||||||
|
//#define MAGIC_KEY_DEBUG_MATRIX X
|
||||||
|
//#define MAGIC_KEY_DEBUG_KBD K
|
||||||
|
//#define MAGIC_KEY_DEBUG_MOUSE M
|
||||||
|
//#define MAGIC_KEY_VERSION V
|
||||||
|
//#define MAGIC_KEY_STATUS S
|
||||||
|
//#define MAGIC_KEY_CONSOLE C
|
||||||
|
//#define MAGIC_KEY_LAYER0 0
|
||||||
|
//#define MAGIC_KEY_LAYER0_ALT GRAVE
|
||||||
|
//#define MAGIC_KEY_LAYER1 1
|
||||||
|
//#define MAGIC_KEY_LAYER2 2
|
||||||
|
//#define MAGIC_KEY_LAYER3 3
|
||||||
|
//#define MAGIC_KEY_LAYER4 4
|
||||||
|
//#define MAGIC_KEY_LAYER5 5
|
||||||
|
//#define MAGIC_KEY_LAYER6 6
|
||||||
|
//#define MAGIC_KEY_LAYER7 7
|
||||||
|
//#define MAGIC_KEY_LAYER8 8
|
||||||
|
//#define MAGIC_KEY_LAYER9 9
|
||||||
|
//#define MAGIC_KEY_BOOTLOADER B
|
||||||
|
//#define MAGIC_KEY_BOOTLOADER_ALT ESC
|
||||||
|
//#define MAGIC_KEY_LOCK CAPS
|
||||||
|
//#define MAGIC_KEY_EEPROM E
|
||||||
|
//#define MAGIC_KEY_EEPROM_CLEAR BSPACE
|
||||||
|
//#define MAGIC_KEY_NKRO N
|
||||||
|
//#define MAGIC_KEY_SLEEP_LED Z
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Feature disable options
|
||||||
|
* These options are also useful to firmware size reduction.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* disable debug print */
|
||||||
|
//#define NO_DEBUG
|
||||||
|
|
||||||
|
/* disable print */
|
||||||
|
//#define NO_PRINT
|
||||||
|
|
||||||
|
/* disable action features */
|
||||||
|
//#define NO_ACTION_LAYER
|
||||||
|
//#define NO_ACTION_TAPPING
|
||||||
|
//#define NO_ACTION_ONESHOT
|
||||||
|
|
||||||
|
/* disable these deprecated features by default */
|
||||||
|
#ifndef LINK_TIME_OPTIMIZATION_ENABLE
|
||||||
|
#define NO_ACTION_MACRO
|
||||||
|
#define NO_ACTION_FUNCTION
|
||||||
|
#endif
|
||||||
|
/*
|
||||||
|
* MIDI options
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Prevent use of disabled MIDI features in the keymap */
|
||||||
|
//#define MIDI_ENABLE_STRICT 1
|
||||||
|
|
||||||
|
/* enable basic MIDI features:
|
||||||
|
- MIDI notes can be sent when in Music mode is on
|
||||||
|
*/
|
||||||
|
//#define MIDI_BASIC
|
||||||
|
|
||||||
|
/* enable advanced MIDI features:
|
||||||
|
- MIDI notes can be added to the keymap
|
||||||
|
- Octave shift and transpose
|
||||||
|
- Virtual sustain, portamento, and modulation wheel
|
||||||
|
- etc.
|
||||||
|
*/
|
||||||
|
//#define MIDI_ADVANCED
|
||||||
|
|
||||||
|
/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
|
||||||
|
//#define MIDI_TONE_KEYCODE_OCTAVES 1
|
||||||
|
|
||||||
|
/*
|
||||||
|
* HD44780 LCD Display Configuration
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
#define LCD_LINES 2 //< number of visible lines of the display
|
||||||
|
#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display
|
||||||
|
|
||||||
|
#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode
|
||||||
|
|
||||||
|
#if LCD_IO_MODE
|
||||||
|
#define LCD_PORT PORTB //< port for the LCD lines
|
||||||
|
#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0
|
||||||
|
#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1
|
||||||
|
#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2
|
||||||
|
#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3
|
||||||
|
#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0
|
||||||
|
#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1
|
||||||
|
#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2
|
||||||
|
#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3
|
||||||
|
#define LCD_RS_PORT LCD_PORT //< port for RS line
|
||||||
|
#define LCD_RS_PIN 3 //< pin for RS line
|
||||||
|
#define LCD_RW_PORT LCD_PORT //< port for RW line
|
||||||
|
#define LCD_RW_PIN 2 //< pin for RW line
|
||||||
|
#define LCD_E_PORT LCD_PORT //< port for Enable line
|
||||||
|
#define LCD_E_PIN 1 //< pin for Enable line
|
||||||
|
#endif
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Bootmagic Lite key configuration */
|
||||||
|
// #define BOOTMAGIC_LITE_ROW 0
|
||||||
|
// #define BOOTMAGIC_LITE_COLUMN 0
|
||||||
@@ -0,0 +1,101 @@
|
|||||||
|
{
|
||||||
|
"keyboard_name": "Wallaby",
|
||||||
|
"url": "https://github.com/kkatano/wallaby",
|
||||||
|
"maintainer": "Koichi Katano",
|
||||||
|
"width": 18.26,
|
||||||
|
"height": 6.47,
|
||||||
|
"layouts": {
|
||||||
|
"LAYOUT_tkl_ansi": {
|
||||||
|
"key_count": 87,
|
||||||
|
"layout": [
|
||||||
|
{"label":"1", "x":0, "y":0},
|
||||||
|
{"label":"2", "x":2, "y":0},
|
||||||
|
{"label":"3", "x":3, "y":0},
|
||||||
|
{"label":"4", "x":4, "y":0},
|
||||||
|
{"label":"5", "x":5, "y":0},
|
||||||
|
{"label":"6", "x":6.5, "y":0},
|
||||||
|
{"label":"7", "x":7.5, "y":0},
|
||||||
|
{"label":"8", "x":8.5, "y":0},
|
||||||
|
{"label":"9", "x":9.5, "y":0},
|
||||||
|
{"label":"10", "x":11, "y":0},
|
||||||
|
{"label":"11", "x":12, "y":0},
|
||||||
|
{"label":"12", "x":13, "y":0},
|
||||||
|
{"label":"13", "x":14, "y":0},
|
||||||
|
{"label":"14", "x":15.26, "y":0},
|
||||||
|
{"label":"15", "x":16.26, "y":0},
|
||||||
|
{"label":"16", "x":17.26, "y":0},
|
||||||
|
{"label":"17", "x":0, "y":1.47},
|
||||||
|
{"label":"18", "x":1, "y":1.47},
|
||||||
|
{"label":"19", "x":2, "y":1.47},
|
||||||
|
{"label":"20", "x":3, "y":1.47},
|
||||||
|
{"label":"21", "x":4, "y":1.47},
|
||||||
|
{"label":"22", "x":5, "y":1.47},
|
||||||
|
{"label":"23", "x":6, "y":1.47},
|
||||||
|
{"label":"24", "x":7, "y":1.47},
|
||||||
|
{"label":"25", "x":8, "y":1.47},
|
||||||
|
{"label":"26", "x":9, "y":1.47},
|
||||||
|
{"label":"27", "x":10, "y":1.47},
|
||||||
|
{"label":"28", "x":11, "y":1.47},
|
||||||
|
{"label":"29", "x":12, "y":1.47},
|
||||||
|
{"label":"30", "x":13, "y":1.47, "w":2},
|
||||||
|
{"label":"31", "x":15.26, "y":1.47},
|
||||||
|
{"label":"32", "x":16.26, "y":1.47},
|
||||||
|
{"label":"33", "x":17.26, "y":1.47},
|
||||||
|
{"label":"34", "x":0, "y":2.47, "w":1.5},
|
||||||
|
{"label":"35", "x":1.5, "y":2.47},
|
||||||
|
{"label":"36", "x":2.5, "y":2.47},
|
||||||
|
{"label":"37", "x":3.5, "y":2.47},
|
||||||
|
{"label":"38", "x":4.5, "y":2.47},
|
||||||
|
{"label":"39", "x":5.5, "y":2.47},
|
||||||
|
{"label":"40", "x":6.5, "y":2.47},
|
||||||
|
{"label":"41", "x":7.5, "y":2.47},
|
||||||
|
{"label":"42", "x":8.5, "y":2.47},
|
||||||
|
{"label":"43", "x":9.5, "y":2.47},
|
||||||
|
{"label":"44", "x":10.5, "y":2.47},
|
||||||
|
{"label":"45", "x":11.5, "y":2.47},
|
||||||
|
{"label":"46", "x":12.5, "y":2.47},
|
||||||
|
{"label":"47", "x":13.5, "y":2.47, "w":1.5},
|
||||||
|
{"label":"48", "x":15.26, "y":2.47},
|
||||||
|
{"label":"49", "x":16.26, "y":2.47},
|
||||||
|
{"label":"50", "x":17.26, "y":2.47},
|
||||||
|
{"label":"51", "x":0, "y":3.47, "w":1.75},
|
||||||
|
{"label":"52", "x":1.75, "y":3.47},
|
||||||
|
{"label":"53", "x":2.75, "y":3.47},
|
||||||
|
{"label":"54", "x":3.75, "y":3.47},
|
||||||
|
{"label":"55", "x":4.75, "y":3.47},
|
||||||
|
{"label":"56", "x":5.75, "y":3.47},
|
||||||
|
{"label":"57", "x":6.75, "y":3.47},
|
||||||
|
{"label":"58", "x":7.75, "y":3.47},
|
||||||
|
{"label":"59", "x":8.75, "y":3.47},
|
||||||
|
{"label":"60", "x":9.75, "y":3.47},
|
||||||
|
{"label":"61", "x":10.75, "y":3.47},
|
||||||
|
{"label":"62", "x":11.75, "y":3.47},
|
||||||
|
{"label":"63", "x":12.75, "y":3.47, "w":2.25},
|
||||||
|
{"label":"64", "x":0, "y":4.47, "w":2.25},
|
||||||
|
{"label":"65", "x":2.25, "y":4.47},
|
||||||
|
{"label":"66", "x":3.25, "y":4.47},
|
||||||
|
{"label":"67", "x":4.25, "y":4.47},
|
||||||
|
{"label":"68", "x":5.25, "y":4.47},
|
||||||
|
{"label":"69", "x":6.25, "y":4.47},
|
||||||
|
{"label":"70", "x":7.25, "y":4.47},
|
||||||
|
{"label":"71", "x":8.25, "y":4.47},
|
||||||
|
{"label":"72", "x":9.25, "y":4.47},
|
||||||
|
{"label":"73", "x":10.25, "y":4.47},
|
||||||
|
{"label":"74", "x":11.25, "y":4.47},
|
||||||
|
{"label":"75", "x":12.25, "y":4.47, "w":2.75},
|
||||||
|
{"label":"76", "x":16.26, "y":4.47},
|
||||||
|
{"label":"77", "x":0, "y":5.47, "w":1.25},
|
||||||
|
{"label":"78", "x":1.25, "y":5.47, "w":1.25},
|
||||||
|
{"label":"79", "x":2.5, "y":5.47, "w":1.25},
|
||||||
|
{"label":"80", "x":3.75, "y":5.47, "w":6.25},
|
||||||
|
{"label":"81", "x":10, "y":5.47, "w":1.25},
|
||||||
|
{"label":"82", "x":11.25, "y":5.47, "w":1.25},
|
||||||
|
{"label":"83", "x":12.5, "y":5.47, "w":1.25},
|
||||||
|
{"label":"84", "x":13.75, "y":5.47, "w":1.25},
|
||||||
|
{"label":"85", "x":15.26, "y":5.47},
|
||||||
|
{"label":"86", "x":16.26, "y":5.47},
|
||||||
|
{"label":"87", "x":17.26, "y":5.47}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
/* Copyright 2020 Koichi Katano
|
||||||
|
*
|
||||||
|
* 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] = {
|
||||||
|
LAYOUT_tkl_ansi(
|
||||||
|
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS,
|
||||||
|
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP,
|
||||||
|
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN,
|
||||||
|
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
|
||||||
|
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP,
|
||||||
|
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
|
||||||
|
)
|
||||||
|
};
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
# The default keymap for wallaby
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
# wallaby
|
||||||
|
|
||||||
|
A Tenkeyless PCB for YMDK aluminium case compatible with Filco
|
||||||
|
|
||||||
|
* Keyboard Maintainer: [Koichi Katano](https://github.com/kkatano)
|
||||||
|
* Hardware Supported: Wallaby PCB
|
||||||
|
* Hardware Availability: https://github.com/kkatano/wallaby
|
||||||
|
|
||||||
|
Make example for this keyboard (after setting up your build environment):
|
||||||
|
|
||||||
|
make wallaby:default
|
||||||
|
|
||||||
|
See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
# MCU name
|
||||||
|
MCU = atmega32u4
|
||||||
|
|
||||||
|
# Bootloader selection
|
||||||
|
# Teensy halfkay
|
||||||
|
# Pro Micro caterina
|
||||||
|
# Atmel DFU atmel-dfu
|
||||||
|
# LUFA DFU lufa-dfu
|
||||||
|
# QMK DFU qmk-dfu
|
||||||
|
# ATmega32A bootloadHID
|
||||||
|
# ATmega328P USBasp
|
||||||
|
BOOTLOADER = atmel-dfu
|
||||||
|
|
||||||
|
# Build Options
|
||||||
|
# change yes to no to disable
|
||||||
|
#
|
||||||
|
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration
|
||||||
|
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
|
||||||
|
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||||
|
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||||
|
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||||
|
NKRO_ENABLE = no # USB Nkey Rollover
|
||||||
|
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
|
||||||
|
RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
|
||||||
|
MIDI_ENABLE = no # MIDI support
|
||||||
|
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||||
|
AUDIO_ENABLE = no # Audio output on port C6
|
||||||
|
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
|
||||||
|
HD44780_ENABLE = no # Enable support for HD44780 based LCDs
|
||||||
|
|
||||||
|
LAYOUTS = tkl_ansi
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
/* Copyright 2020 Koichi Katano
|
||||||
|
*
|
||||||
|
* 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 "wallaby.h"
|
||||||
|
|
||||||
|
bool led_update_kb(led_t led_state) {
|
||||||
|
if (led_update_user(led_state)) {
|
||||||
|
writePin(B6, led_state.caps_lock);
|
||||||
|
writePin(B7, led_state.scroll_lock);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
/* Copyright 2020 Koichi Katano
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "quantum.h"
|
||||||
|
|
||||||
|
/* This is a shortcut to help you visually see your layout.
|
||||||
|
*
|
||||||
|
* The first section contains all of the arguments representing the physical
|
||||||
|
* layout of the board and position of the keys.
|
||||||
|
*
|
||||||
|
* The second converts the arguments into a two-dimensional array which
|
||||||
|
* represents the switch matrix.
|
||||||
|
*/
|
||||||
|
#define LAYOUT_tkl_ansi( \
|
||||||
|
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0E, k0F, k0G, \
|
||||||
|
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E, k1F, k1G, \
|
||||||
|
k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, k2E, k2F, k2G, \
|
||||||
|
k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3D, \
|
||||||
|
k40, k42, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k4F, \
|
||||||
|
k50, k51, k52, k56, k5A, k5B, k5C, k5D, k5E, k5F, k5G \
|
||||||
|
) \
|
||||||
|
{ \
|
||||||
|
{ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, KC_NO, k0E, k0F, k0G }, \
|
||||||
|
{ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E, k1F, k1G }, \
|
||||||
|
{ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, k2E, k2F, k2G }, \
|
||||||
|
{ k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, KC_NO, k3D, KC_NO, KC_NO, KC_NO }, \
|
||||||
|
{ k40, KC_NO, k42, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, KC_NO, KC_NO, k4F, KC_NO }, \
|
||||||
|
{ k50, k51, k52, KC_NO, KC_NO, KC_NO, k56, KC_NO, KC_NO, KC_NO, k5A, k5B, k5C, k5D, k5E, k5F, k5G } \
|
||||||
|
}
|
||||||
@@ -0,0 +1,127 @@
|
|||||||
|
/* Copyright 2017 Wunder
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
|
||||||
|
// Layer shorthand
|
||||||
|
#define LOWER MO(_LOWER)
|
||||||
|
#define RAISE MO(_RAISE)
|
||||||
|
#define SYSTEM MO(_SYSTEM)
|
||||||
|
#define MPASTE LSFT(KC_INSERT)
|
||||||
|
|
||||||
|
enum xd75_layers {
|
||||||
|
_QWERTY,
|
||||||
|
_LOWER,
|
||||||
|
_RAISE,
|
||||||
|
_SYSTEM
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
|
||||||
|
/* QWERTY
|
||||||
|
* .--------------------------------------------------------------------------------------------------------------------------------------.
|
||||||
|
* | ESC | 1 | 2 | 3 | 4 | 5 | - | ` | = | 6 | 7 | 8 | 9 | 0 | BACKSP |
|
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
|
||||||
|
* | TAB | Q | W | E | R | T | [ | \ | ] | Y | U | I | O | P | ' |
|
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------|
|
||||||
|
* | CAP LK | A | S | D | F | G | INSERT | HOME | PG UP | H | J | K | L | ; | ENTER |
|
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------|
|
||||||
|
* | LSHIFT | Z | X | C | V | B | DEL | END | PG DN | N | M | , | . | / | RSHIFT |
|
||||||
|
* |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+-----------------+--------+--------|
|
||||||
|
* | LCTRL | GUI | MENU | ALT | LOWER | SPACE | SPACE | SPACE | SPACE | SPACE | RAISE | LEFT | DOWN | UP | RIGHT |
|
||||||
|
* '--------------------------------------------------------------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
|
||||||
|
[_QWERTY] = LAYOUT_ortho_5x15( /* QWERTY */
|
||||||
|
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_MINS, KC_GRV, KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,
|
||||||
|
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, KC_BSLS, KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_QUOT,
|
||||||
|
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_INS, KC_HOME, KC_PGUP, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT,
|
||||||
|
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_DEL, KC_END, KC_PGDN, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
|
||||||
|
KC_LCTL, KC_LGUI, KC_MENU, KC_LALT, LOWER, KC_SPC, KC_SPC, KC_SPC, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT
|
||||||
|
),
|
||||||
|
|
||||||
|
/* SYSTEM
|
||||||
|
* .--------------------------------------------------------------------------------------------------------------------------------------.
|
||||||
|
* | RESET | DEBUG | | | | | | | | | | | | | |
|
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
|
||||||
|
* | | | | | | |RGB_TOG |RGB_VAI |RGB VAD | | | PASTE | PR SCR | SCR LK | PAUSE |
|
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
|
||||||
|
* | | | | | | |RGB_MOD |RGB_SAI |RGB_HUI | | | | | | |
|
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
|
||||||
|
* | | | | | | | |RGB_SAD |RGB_HUD | | | | | | |
|
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
|
||||||
|
* | | | | | | | | | | | | | | | |
|
||||||
|
* '--------------------------------------------------------------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
|
||||||
|
[_SYSTEM] = LAYOUT_ortho_5x15( /* FUNCTION */
|
||||||
|
RESET, DEBUG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||||
|
_______, _______, _______, _______, _______, _______, RGB_TOG, RGB_VAI, RGB_VAD, _______, _______, MPASTE, KC_PSCR, KC_SLCK, KC_PAUSE,
|
||||||
|
_______, _______, _______, _______, _______, _______, RGB_MOD, RGB_SAI, RGB_HUI, _______, _______, _______, _______, _______, _______,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, RGB_SAD, RGB_HUD, _______, _______, _______, _______, _______, _______,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||||
|
),
|
||||||
|
|
||||||
|
/* LOWER
|
||||||
|
* .--------------------------------------------------------------------------------------------------------------------------------------.
|
||||||
|
* | | | | | | | | | | | | | | | |
|
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
|
||||||
|
* | ~ | ! | @ | # | $ | % | | | | ^ | & | * | ( | ) | ' |
|
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------|
|
||||||
|
* | DELETE | F1 | F2 | F3 | F4 | F5 | | | | F6 | _ | + | { | } | | |
|
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------|
|
||||||
|
* | | F7 | F8 | F9 | F10 | F11 | | | | F12 | ISO ~ | ISO | | Home | End | |
|
||||||
|
* |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+-----------------+--------+--------|
|
||||||
|
* | | | | | | | | | | | | Next | Vol- | Vol+ | Play |
|
||||||
|
* '--------------------------------------------------------------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
|
||||||
|
[_LOWER] = LAYOUT_ortho_5x15( /* LOWER */
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||||
|
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_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, _______, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE,
|
||||||
|
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, _______, _______, KC_F12,S(KC_NUHS),S(KC_NUBS),KC_HOME,KC_END, _______,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY
|
||||||
|
),
|
||||||
|
|
||||||
|
/* RAISE
|
||||||
|
* .--------------------------------------------------------------------------------------------------------------------------------------.
|
||||||
|
* | | | | | | | | | | | | | | | |
|
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
|
||||||
|
* | ` | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | ' |
|
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------|
|
||||||
|
* | | F1 | F2 | F3 | F4 | F5 | | | | F6 | - | = | [ | ] | \ |
|
||||||
|
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------|
|
||||||
|
* | | F7 | F8 | F9 | F10 | F11 | | | | F12 | ISO # | ISO / | Pg Up | Pg Dn | |
|
||||||
|
* |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+-----------------+--------+--------|
|
||||||
|
* | | | | | | | | | | | | Next | Vol- | Vol+ | Play |
|
||||||
|
* '--------------------------------------------------------------------------------------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
|
||||||
|
[_RAISE] = LAYOUT_ortho_5x15( /* QWERTY */
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||||
|
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, _______, _______, _______, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,
|
||||||
|
_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, _______, KC_F6, KC_MINUS,KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS,
|
||||||
|
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, _______, _______, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY
|
||||||
|
)
|
||||||
|
};
|
||||||
|
|
||||||
|
// SYSTEM layer toggle
|
||||||
|
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||||
|
return update_tri_layer_state(state, _LOWER, _RAISE, _SYSTEM);
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
# A OLKB-like layout for XD75
|
||||||
@@ -30,7 +30,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "matrix.h"
|
#include "matrix.h"
|
||||||
#include "split_util.h"
|
#include "split_util.h"
|
||||||
#include "pro_micro.h"
|
#include "quantum.h"
|
||||||
|
|
||||||
#ifdef USE_MATRIX_I2C
|
#ifdef USE_MATRIX_I2C
|
||||||
# include "i2c.h"
|
# include "i2c.h"
|
||||||
@@ -102,9 +102,10 @@ void matrix_init(void)
|
|||||||
unselect_rows();
|
unselect_rows();
|
||||||
init_cols();
|
init_cols();
|
||||||
|
|
||||||
TX_RX_LED_INIT;
|
setPinOutput(B0);
|
||||||
TXLED0;
|
setPinOutput(D5);
|
||||||
RXLED0;
|
writePinHigh(D5);
|
||||||
|
writePinHigh(B0);
|
||||||
|
|
||||||
// initialize matrix state: all keys off
|
// initialize matrix state: all keys off
|
||||||
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
|
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
|
||||||
@@ -189,10 +190,10 @@ int serial_transaction(int master_changed) {
|
|||||||
int ret=serial_update_buffers();
|
int ret=serial_update_buffers();
|
||||||
#endif
|
#endif
|
||||||
if (ret ) {
|
if (ret ) {
|
||||||
if(ret==2) RXLED1;
|
if(ret==2) writePinLow(B0);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
RXLED0;
|
writePinHigh(B0);
|
||||||
memcpy(&matrix[slaveOffset],
|
memcpy(&matrix[slaveOffset],
|
||||||
(void *)serial_slave_buffer, SERIAL_SLAVE_BUFFER_LENGTH);
|
(void *)serial_slave_buffer, SERIAL_SLAVE_BUFFER_LENGTH);
|
||||||
return 0;
|
return 0;
|
||||||
@@ -241,7 +242,7 @@ uint8_t matrix_master_scan(void) {
|
|||||||
if( serial_transaction(mchanged) ) {
|
if( serial_transaction(mchanged) ) {
|
||||||
#endif
|
#endif
|
||||||
// turn on the indicator led when halves are disconnected
|
// turn on the indicator led when halves are disconnected
|
||||||
TXLED1;
|
writePinLow(D5);
|
||||||
|
|
||||||
error_count++;
|
error_count++;
|
||||||
|
|
||||||
@@ -254,7 +255,7 @@ uint8_t matrix_master_scan(void) {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// turn off the indicator led on no error
|
// turn off the indicator led on no error
|
||||||
TXLED0;
|
writePinHigh(D5);
|
||||||
error_count = 0;
|
error_count = 0;
|
||||||
}
|
}
|
||||||
matrix_scan_quantum();
|
matrix_scan_quantum();
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "matrix.h"
|
#include "matrix.h"
|
||||||
#include "split_util.h"
|
#include "split_util.h"
|
||||||
#include "pro_micro.h"
|
#include "quantum.h"
|
||||||
|
|
||||||
#ifdef USE_MATRIX_I2C
|
#ifdef USE_MATRIX_I2C
|
||||||
# include "i2c.h"
|
# include "i2c.h"
|
||||||
@@ -102,9 +102,10 @@ void matrix_init(void)
|
|||||||
unselect_rows();
|
unselect_rows();
|
||||||
init_cols();
|
init_cols();
|
||||||
|
|
||||||
TX_RX_LED_INIT;
|
setPinOutput(B0);
|
||||||
TXLED0;
|
setPinOutput(D5);
|
||||||
RXLED0;
|
writePinHigh(D5);
|
||||||
|
writePinHigh(B0);
|
||||||
|
|
||||||
// initialize matrix state: all keys off
|
// initialize matrix state: all keys off
|
||||||
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
|
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
|
||||||
@@ -189,10 +190,10 @@ int serial_transaction(int master_changed) {
|
|||||||
int ret=serial_update_buffers();
|
int ret=serial_update_buffers();
|
||||||
#endif
|
#endif
|
||||||
if (ret ) {
|
if (ret ) {
|
||||||
if(ret==2) RXLED1;
|
if(ret==2) writePinLow(B0);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
RXLED0;
|
writePinHigh(B0);
|
||||||
memcpy(&matrix[slaveOffset],
|
memcpy(&matrix[slaveOffset],
|
||||||
(void *)serial_slave_buffer, sizeof(serial_slave_buffer));
|
(void *)serial_slave_buffer, sizeof(serial_slave_buffer));
|
||||||
return 0;
|
return 0;
|
||||||
@@ -240,7 +241,7 @@ uint8_t matrix_master_scan(void) {
|
|||||||
if( serial_transaction(mchanged) ) {
|
if( serial_transaction(mchanged) ) {
|
||||||
#endif
|
#endif
|
||||||
// turn on the indicator led when halves are disconnected
|
// turn on the indicator led when halves are disconnected
|
||||||
TXLED1;
|
writePinLow(D5);
|
||||||
|
|
||||||
error_count++;
|
error_count++;
|
||||||
|
|
||||||
@@ -253,7 +254,7 @@ uint8_t matrix_master_scan(void) {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// turn off the indicator led on no error
|
// turn off the indicator led on no error
|
||||||
TXLED0;
|
writePinHigh(D5);
|
||||||
error_count = 0;
|
error_count = 0;
|
||||||
}
|
}
|
||||||
matrix_scan_quantum();
|
matrix_scan_quantum();
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "matrix.h"
|
#include "matrix.h"
|
||||||
#include "split_util.h"
|
#include "split_util.h"
|
||||||
#include "pro_micro.h"
|
#include "quantum.h"
|
||||||
|
|
||||||
#ifdef USE_MATRIX_I2C
|
#ifdef USE_MATRIX_I2C
|
||||||
# include "i2c.h"
|
# include "i2c.h"
|
||||||
@@ -102,9 +102,10 @@ void matrix_init(void)
|
|||||||
unselect_rows();
|
unselect_rows();
|
||||||
init_cols();
|
init_cols();
|
||||||
|
|
||||||
TX_RX_LED_INIT;
|
setPinOutput(B0);
|
||||||
TXLED0;
|
setPinOutput(D5);
|
||||||
RXLED0;
|
writePinHigh(B0);
|
||||||
|
writePinHigh(D5);
|
||||||
|
|
||||||
// initialize matrix state: all keys off
|
// initialize matrix state: all keys off
|
||||||
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
|
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
|
||||||
@@ -189,10 +190,10 @@ int serial_transaction(int master_changed) {
|
|||||||
int ret=serial_update_buffers();
|
int ret=serial_update_buffers();
|
||||||
#endif
|
#endif
|
||||||
if (ret ) {
|
if (ret ) {
|
||||||
if(ret==2) RXLED1;
|
if(ret==2) writePinLow(B0);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
RXLED0;
|
writePinHigh(B0);
|
||||||
memcpy(&matrix[slaveOffset],
|
memcpy(&matrix[slaveOffset],
|
||||||
(void *)serial_slave_buffer, sizeof(serial_slave_buffer));
|
(void *)serial_slave_buffer, sizeof(serial_slave_buffer));
|
||||||
return 0;
|
return 0;
|
||||||
@@ -240,7 +241,7 @@ uint8_t matrix_master_scan(void) {
|
|||||||
if( serial_transaction(mchanged) ) {
|
if( serial_transaction(mchanged) ) {
|
||||||
#endif
|
#endif
|
||||||
// turn on the indicator led when halves are disconnected
|
// turn on the indicator led when halves are disconnected
|
||||||
TXLED1;
|
writePinLow(D5);
|
||||||
|
|
||||||
error_count++;
|
error_count++;
|
||||||
|
|
||||||
@@ -253,7 +254,7 @@ uint8_t matrix_master_scan(void) {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// turn off the indicator led on no error
|
// turn off the indicator led on no error
|
||||||
TXLED0;
|
writePinHigh(D5);
|
||||||
error_count = 0;
|
error_count = 0;
|
||||||
}
|
}
|
||||||
matrix_scan_quantum();
|
matrix_scan_quantum();
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
We list each subcommand here explicitly because all the reliable ways of searching for modules are slow and delay startup.
|
We list each subcommand here explicitly because all the reliable ways of searching for modules are slow and delay startup.
|
||||||
"""
|
"""
|
||||||
|
from milc import cli
|
||||||
|
|
||||||
from . import cformat
|
from . import cformat
|
||||||
from . import compile
|
from . import compile
|
||||||
from . import config
|
from . import config
|
||||||
@@ -16,3 +18,6 @@ from . import kle2json
|
|||||||
from . import new
|
from . import new
|
||||||
from . import pyformat
|
from . import pyformat
|
||||||
from . import pytest
|
from . import pytest
|
||||||
|
|
||||||
|
if not hasattr(cli, 'config_source'):
|
||||||
|
cli.log.warning("Your QMK CLI is out of date. Please upgrade with `pip3 install --upgrade qmk` or by using your package manager.")
|
||||||
@@ -8,13 +8,17 @@ from argparse import FileType
|
|||||||
from milc import cli
|
from milc import cli
|
||||||
|
|
||||||
import qmk.path
|
import qmk.path
|
||||||
from qmk.commands import compile_configurator_json, create_make_command, find_keyboard_keymap, parse_configurator_json
|
from qmk.decorators import automagic_keyboard, automagic_keymap
|
||||||
|
from qmk.commands import compile_configurator_json, create_make_command, parse_configurator_json
|
||||||
|
|
||||||
|
|
||||||
@cli.argument('filename', nargs='?', arg_only=True, type=FileType('r'), help='The configurator export to compile')
|
@cli.argument('filename', nargs='?', arg_only=True, type=FileType('r'), help='The configurator export to compile')
|
||||||
@cli.argument('-kb', '--keyboard', help='The keyboard to build a firmware for. Ignored when a configurator export is supplied.')
|
@cli.argument('-kb', '--keyboard', help='The keyboard to build a firmware for. Ignored when a configurator export is supplied.')
|
||||||
@cli.argument('-km', '--keymap', help='The keymap to build a firmware for. Ignored when a configurator export is supplied.')
|
@cli.argument('-km', '--keymap', help='The keymap to build a firmware for. Ignored when a configurator export is supplied.')
|
||||||
|
@cli.argument('-n', '--dry-run', arg_only=True, action='store_true', help="Don't actually build, just show the make command to be run.")
|
||||||
@cli.subcommand('Compile a QMK Firmware.')
|
@cli.subcommand('Compile a QMK Firmware.')
|
||||||
|
@automagic_keyboard
|
||||||
|
@automagic_keymap
|
||||||
def compile(cli):
|
def compile(cli):
|
||||||
"""Compile a QMK Firmware.
|
"""Compile a QMK Firmware.
|
||||||
|
|
||||||
@@ -22,8 +26,10 @@ def compile(cli):
|
|||||||
|
|
||||||
If a keyboard and keymap are provided this command will build a firmware based on that.
|
If a keyboard and keymap are provided this command will build a firmware based on that.
|
||||||
"""
|
"""
|
||||||
|
command = None
|
||||||
|
|
||||||
if cli.args.filename:
|
if cli.args.filename:
|
||||||
# If a configurator JSON was provided skip straight to compiling it
|
# If a configurator JSON was provided generate a keymap and compile it
|
||||||
# FIXME(skullydazed): add code to check and warn if the keymap already exists when compiling a json keymap.
|
# FIXME(skullydazed): add code to check and warn if the keymap already exists when compiling a json keymap.
|
||||||
user_keymap = parse_configurator_json(cli.args.filename)
|
user_keymap = parse_configurator_json(cli.args.filename)
|
||||||
keymap_path = qmk.path.keymap(user_keymap['keyboard'])
|
keymap_path = qmk.path.keymap(user_keymap['keyboard'])
|
||||||
@@ -32,16 +38,23 @@ def compile(cli):
|
|||||||
cli.log.info('Wrote keymap to {fg_cyan}%s/%s/keymap.c', keymap_path, user_keymap['keymap'])
|
cli.log.info('Wrote keymap to {fg_cyan}%s/%s/keymap.c', keymap_path, user_keymap['keymap'])
|
||||||
|
|
||||||
else:
|
else:
|
||||||
# Perform the action the user specified
|
if cli.config.compile.keyboard and cli.config.compile.keymap:
|
||||||
user_keyboard, user_keymap = find_keyboard_keymap()
|
|
||||||
if user_keyboard and user_keymap:
|
|
||||||
# Generate the make command for a specific keyboard/keymap.
|
# Generate the make command for a specific keyboard/keymap.
|
||||||
command = create_make_command(user_keyboard, user_keymap)
|
command = create_make_command(cli.config.compile.keyboard, cli.config.compile.keymap)
|
||||||
|
|
||||||
else:
|
elif not cli.config.compile.keyboard:
|
||||||
cli.log.error('You must supply a configurator export, both `--keyboard` and `--keymap`, or be in a directory for a keyboard or keymap.')
|
cli.log.error('Could not determine keyboard!')
|
||||||
cli.echo('usage: qmk compile [-h] [-b] [-kb KEYBOARD] [-km KEYMAP] [filename]')
|
elif not cli.config.compile.keymap:
|
||||||
return False
|
cli.log.error('Could not determine keymap!')
|
||||||
|
|
||||||
cli.log.info('Compiling keymap with {fg_cyan}%s\n\n', ' '.join(command))
|
# Compile the firmware, if we're able to
|
||||||
subprocess.run(command)
|
if command:
|
||||||
|
cli.log.info('Compiling keymap with {fg_cyan}%s', ' '.join(command))
|
||||||
|
if not cli.args.dry_run:
|
||||||
|
cli.echo('\n')
|
||||||
|
subprocess.run(command)
|
||||||
|
|
||||||
|
else:
|
||||||
|
cli.log.error('You must supply a configurator export, both `--keyboard` and `--keymap`, or be in a directory for a keyboard or keymap.')
|
||||||
|
cli.echo('usage: qmk compile [-h] [-b] [-kb KEYBOARD] [-km KEYMAP] [filename]')
|
||||||
|
return False
|
||||||
+30
-17
@@ -6,9 +6,11 @@ A bootloader must be specified.
|
|||||||
import subprocess
|
import subprocess
|
||||||
from argparse import FileType
|
from argparse import FileType
|
||||||
|
|
||||||
import qmk.path
|
|
||||||
from milc import cli
|
from milc import cli
|
||||||
from qmk.commands import compile_configurator_json, create_make_command, find_keyboard_keymap, parse_configurator_json
|
|
||||||
|
import qmk.path
|
||||||
|
from qmk.decorators import automagic_keyboard, automagic_keymap
|
||||||
|
from qmk.commands import compile_configurator_json, create_make_command, parse_configurator_json
|
||||||
|
|
||||||
|
|
||||||
def print_bootloader_help():
|
def print_bootloader_help():
|
||||||
@@ -28,12 +30,15 @@ def print_bootloader_help():
|
|||||||
cli.echo('For more info, visit https://docs.qmk.fm/#/flashing')
|
cli.echo('For more info, visit https://docs.qmk.fm/#/flashing')
|
||||||
|
|
||||||
|
|
||||||
@cli.argument('-bl', '--bootloader', default='flash', help='The flash command, corresponding to qmk\'s make options of bootloaders.')
|
|
||||||
@cli.argument('filename', nargs='?', arg_only=True, type=FileType('r'), help='The configurator export JSON to compile.')
|
@cli.argument('filename', nargs='?', arg_only=True, type=FileType('r'), help='The configurator export JSON to compile.')
|
||||||
|
@cli.argument('-b', '--bootloaders', action='store_true', help='List the available bootloaders.')
|
||||||
|
@cli.argument('-bl', '--bootloader', default='flash', help='The flash command, corresponding to qmk\'s make options of bootloaders.')
|
||||||
@cli.argument('-km', '--keymap', help='The keymap to build a firmware for. Use this if you dont have a configurator file. Ignored when a configurator file is supplied.')
|
@cli.argument('-km', '--keymap', help='The keymap to build a firmware for. Use this if you dont have a configurator file. Ignored when a configurator file is supplied.')
|
||||||
@cli.argument('-kb', '--keyboard', help='The keyboard to build a firmware for. Use this if you dont have a configurator file. Ignored when a configurator file is supplied.')
|
@cli.argument('-kb', '--keyboard', help='The keyboard to build a firmware for. Use this if you dont have a configurator file. Ignored when a configurator file is supplied.')
|
||||||
@cli.argument('-b', '--bootloaders', action='store_true', help='List the available bootloaders.')
|
@cli.argument('-n', '--dry-run', arg_only=True, action='store_true', help="Don't actually build, just show the make command to be run.")
|
||||||
@cli.subcommand('QMK Flash.')
|
@cli.subcommand('QMK Flash.')
|
||||||
|
@automagic_keyboard
|
||||||
|
@automagic_keymap
|
||||||
def flash(cli):
|
def flash(cli):
|
||||||
"""Compile and or flash QMK Firmware or keyboard/layout
|
"""Compile and or flash QMK Firmware or keyboard/layout
|
||||||
|
|
||||||
@@ -42,12 +47,13 @@ def flash(cli):
|
|||||||
|
|
||||||
If no file is supplied, keymap and keyboard are expected.
|
If no file is supplied, keymap and keyboard are expected.
|
||||||
|
|
||||||
If bootloader is omitted, the one according to the rules.mk will be used.
|
If bootloader is omitted the make system will use the configured bootloader for that keyboard.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
command = ''
|
||||||
|
|
||||||
if cli.args.bootloaders:
|
if cli.args.bootloaders:
|
||||||
# Provide usage and list bootloaders
|
# Provide usage and list bootloaders
|
||||||
cli.echo('usage: qmk flash [-h] [-b] [-kb KEYBOARD] [-km KEYMAP] [-bl BOOTLOADER] [filename]')
|
cli.echo('usage: qmk flash [-h] [-b] [-n] [-kb KEYBOARD] [-km KEYMAP] [-bl BOOTLOADER] [filename]')
|
||||||
print_bootloader_help()
|
print_bootloader_help()
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@@ -60,16 +66,23 @@ def flash(cli):
|
|||||||
cli.log.info('Wrote keymap to {fg_cyan}%s/%s/keymap.c', keymap_path, user_keymap['keymap'])
|
cli.log.info('Wrote keymap to {fg_cyan}%s/%s/keymap.c', keymap_path, user_keymap['keymap'])
|
||||||
|
|
||||||
else:
|
else:
|
||||||
# Perform the action the user specified
|
if cli.config.flash.keyboard and cli.config.flash.keymap:
|
||||||
user_keyboard, user_keymap = find_keyboard_keymap()
|
|
||||||
if user_keyboard and user_keymap:
|
|
||||||
# Generate the make command for a specific keyboard/keymap.
|
# Generate the make command for a specific keyboard/keymap.
|
||||||
command = create_make_command(user_keyboard, user_keymap, cli.args.bootloader)
|
command = create_make_command(cli.config.flash.keyboard, cli.config.flash.keymap, cli.args.bootloader)
|
||||||
|
|
||||||
else:
|
elif not cli.config.flash.keyboard:
|
||||||
cli.log.error('You must supply a configurator export or both `--keyboard` and `--keymap`.')
|
cli.log.error('Could not determine keyboard!')
|
||||||
cli.echo('usage: qmk flash [-h] [-b] [-kb KEYBOARD] [-km KEYMAP] [-bl BOOTLOADER] [filename]')
|
elif not cli.config.flash.keymap:
|
||||||
return False
|
cli.log.error('Could not determine keymap!')
|
||||||
|
|
||||||
cli.log.info('Flashing keymap with {fg_cyan}%s\n\n', ' '.join(command))
|
# Compile the firmware, if we're able to
|
||||||
subprocess.run(command)
|
if command:
|
||||||
|
cli.log.info('Compiling keymap with {fg_cyan}%s', ' '.join(command))
|
||||||
|
if not cli.args.dry_run:
|
||||||
|
cli.echo('\n')
|
||||||
|
subprocess.run(command)
|
||||||
|
|
||||||
|
else:
|
||||||
|
cli.log.error('You must supply a configurator export, both `--keyboard` and `--keymap`, or be in a directory for a keyboard or keymap.')
|
||||||
|
cli.echo('usage: qmk flash [-h] [-b] [-n] [-kb KEYBOARD] [-km KEYMAP] [-bl BOOTLOADER] [filename]')
|
||||||
|
return False
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
"""Generate a keymap.c from a configurator export.
|
"""Generate a keymap.c from a configurator export.
|
||||||
"""
|
"""
|
||||||
import json
|
import json
|
||||||
from pathlib import Path
|
|
||||||
|
|
||||||
from milc import cli
|
from milc import cli
|
||||||
|
|
||||||
@@ -9,7 +8,7 @@ import qmk.keymap
|
|||||||
import qmk.path
|
import qmk.path
|
||||||
|
|
||||||
|
|
||||||
@cli.argument('-o', '--output', arg_only=True, type=Path, help='File to write to')
|
@cli.argument('-o', '--output', arg_only=True, type=qmk.path.normpath, help='File to write to')
|
||||||
@cli.argument('-q', '--quiet', arg_only=True, action='store_true', help="Quiet mode, only output error messages")
|
@cli.argument('-q', '--quiet', arg_only=True, action='store_true', help="Quiet mode, only output error messages")
|
||||||
@cli.argument('filename', arg_only=True, help='Configurator JSON file')
|
@cli.argument('filename', arg_only=True, help='Configurator JSON file')
|
||||||
@cli.subcommand('Creates a keymap.c from a QMK Configurator export.')
|
@cli.subcommand('Creates a keymap.c from a QMK Configurator export.')
|
||||||
|
|||||||
@@ -1,12 +1,15 @@
|
|||||||
"""List the keymaps for a specific keyboard
|
"""List the keymaps for a specific keyboard
|
||||||
"""
|
"""
|
||||||
from milc import cli
|
from milc import cli
|
||||||
|
|
||||||
import qmk.keymap
|
import qmk.keymap
|
||||||
|
from qmk.decorators import automagic_keyboard
|
||||||
from qmk.errors import NoSuchKeyboardError
|
from qmk.errors import NoSuchKeyboardError
|
||||||
|
|
||||||
|
|
||||||
@cli.argument("-kb", "--keyboard", help="Specify keyboard name. Example: 1upkeyboards/1up60hse")
|
@cli.argument("-kb", "--keyboard", help="Specify keyboard name. Example: 1upkeyboards/1up60hse")
|
||||||
@cli.subcommand("List the keymaps for a specific keyboard")
|
@cli.subcommand("List the keymaps for a specific keyboard")
|
||||||
|
@automagic_keyboard
|
||||||
def list_keymaps(cli):
|
def list_keymaps(cli):
|
||||||
"""List the keymaps for a specific keyboard
|
"""List the keymaps for a specific keyboard
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -4,12 +4,15 @@ import shutil
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
import qmk.path
|
import qmk.path
|
||||||
|
from qmk.decorators import automagic_keyboard, automagic_keymap
|
||||||
from milc import cli
|
from milc import cli
|
||||||
|
|
||||||
|
|
||||||
@cli.argument('-kb', '--keyboard', help='Specify keyboard name. Example: 1upkeyboards/1up60hse')
|
@cli.argument('-kb', '--keyboard', help='Specify keyboard name. Example: 1upkeyboards/1up60hse')
|
||||||
@cli.argument('-km', '--keymap', help='Specify the name for the new keymap directory')
|
@cli.argument('-km', '--keymap', help='Specify the name for the new keymap directory')
|
||||||
@cli.subcommand('Creates a new keymap for the keyboard of your choosing')
|
@cli.subcommand('Creates a new keymap for the keyboard of your choosing')
|
||||||
|
@automagic_keyboard
|
||||||
|
@automagic_keymap
|
||||||
def new_keymap(cli):
|
def new_keymap(cli):
|
||||||
"""Creates a new keymap for the keyboard of your choosing.
|
"""Creates a new keymap for the keyboard of your choosing.
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -1,12 +1,8 @@
|
|||||||
"""Helper functions for commands.
|
"""Helper functions for commands.
|
||||||
"""
|
"""
|
||||||
import json
|
import json
|
||||||
from pathlib import Path
|
|
||||||
|
|
||||||
from milc import cli
|
|
||||||
|
|
||||||
import qmk.keymap
|
import qmk.keymap
|
||||||
from qmk.path import is_keyboard, is_keymap_dir, under_qmk_firmware
|
|
||||||
|
|
||||||
|
|
||||||
def create_make_command(keyboard, keymap, target=None):
|
def create_make_command(keyboard, keymap, target=None):
|
||||||
@@ -59,71 +55,6 @@ def compile_configurator_json(user_keymap, bootloader=None):
|
|||||||
return create_make_command(user_keymap['keyboard'], user_keymap['keymap'], bootloader)
|
return create_make_command(user_keymap['keyboard'], user_keymap['keymap'], bootloader)
|
||||||
|
|
||||||
|
|
||||||
def find_keyboard_keymap():
|
|
||||||
"""Returns `(keyboard_name, keymap_name)` based on the user's current environment.
|
|
||||||
|
|
||||||
This determines the keyboard and keymap name using the following precedence order:
|
|
||||||
|
|
||||||
* Command line flags (--keyboard and --keymap)
|
|
||||||
* Current working directory
|
|
||||||
* `keyboards/<keyboard_name>`
|
|
||||||
* `keyboards/<keyboard_name>/keymaps/<keymap_name>`
|
|
||||||
* `layouts/**/<keymap_name>`
|
|
||||||
* `users/<keymap_name>`
|
|
||||||
* Configuration
|
|
||||||
* cli.config.<subcommand>.keyboard
|
|
||||||
* cli.config.<subcommand>.keymap
|
|
||||||
"""
|
|
||||||
# Check to make sure their copy of MILC supports config_source
|
|
||||||
if not hasattr(cli, 'config_source'):
|
|
||||||
cli.log.error("Your QMK CLI is out of date. Please upgrade using pip3 or your package manager.")
|
|
||||||
exit(1)
|
|
||||||
|
|
||||||
# State variables
|
|
||||||
relative_cwd = under_qmk_firmware()
|
|
||||||
keyboard_name = ""
|
|
||||||
keymap_name = ""
|
|
||||||
|
|
||||||
# If the keyboard or keymap are passed as arguments use that in preference to anything else
|
|
||||||
if cli.config_source[cli._entrypoint.__name__]['keyboard'] == 'argument':
|
|
||||||
keyboard_name = cli.config[cli._entrypoint.__name__]['keyboard']
|
|
||||||
if cli.config_source[cli._entrypoint.__name__]['keymap'] == 'argument':
|
|
||||||
keymap_name = cli.config[cli._entrypoint.__name__]['keymap']
|
|
||||||
|
|
||||||
if not keyboard_name or not keymap_name:
|
|
||||||
# If we don't have a keyboard_name and keymap_name from arguments try to derive one or both
|
|
||||||
if relative_cwd and relative_cwd.parts and relative_cwd.parts[0] == 'keyboards':
|
|
||||||
# Try to determine the keyboard and/or keymap name
|
|
||||||
current_path = Path('/'.join(relative_cwd.parts[1:]))
|
|
||||||
|
|
||||||
if current_path.parts[-2] == 'keymaps':
|
|
||||||
if not keymap_name:
|
|
||||||
keymap_name = current_path.parts[-1]
|
|
||||||
if not keyboard_name:
|
|
||||||
keyboard_name = '/'.join(current_path.parts[:-2])
|
|
||||||
elif not keyboard_name and is_keyboard(current_path):
|
|
||||||
keyboard_name = str(current_path)
|
|
||||||
|
|
||||||
elif relative_cwd and relative_cwd.parts and relative_cwd.parts[0] == 'layouts':
|
|
||||||
# Try to determine the keymap name from the community layout
|
|
||||||
if is_keymap_dir(relative_cwd) and not keymap_name:
|
|
||||||
keymap_name = relative_cwd.name
|
|
||||||
|
|
||||||
elif relative_cwd and relative_cwd.parts and relative_cwd.parts[0] == 'users':
|
|
||||||
# Try to determine the keymap name based on which userspace they're in
|
|
||||||
if not keymap_name and len(relative_cwd.parts) > 1:
|
|
||||||
keymap_name = relative_cwd.parts[1]
|
|
||||||
|
|
||||||
# If we still don't have a keyboard and keymap check the config
|
|
||||||
if not keyboard_name and cli.config[cli._entrypoint.__name__]['keyboard']:
|
|
||||||
keyboard_name = cli.config[cli._entrypoint.__name__]['keyboard']
|
|
||||||
|
|
||||||
if not keymap_name and cli.config[cli._entrypoint.__name__]['keymap']:
|
|
||||||
keymap_name = cli.config[cli._entrypoint.__name__]['keymap']
|
|
||||||
|
|
||||||
return (keyboard_name, keymap_name)
|
|
||||||
|
|
||||||
|
|
||||||
def parse_configurator_json(configurator_file):
|
def parse_configurator_json(configurator_file):
|
||||||
"""Open and parse a configurator json export
|
"""Open and parse a configurator json export
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -0,0 +1,85 @@
|
|||||||
|
"""Helpful decorators that subcommands can use.
|
||||||
|
"""
|
||||||
|
import functools
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
from milc import cli
|
||||||
|
|
||||||
|
from qmk.path import is_keyboard, is_keymap_dir, under_qmk_firmware
|
||||||
|
|
||||||
|
|
||||||
|
def automagic_keyboard(func):
|
||||||
|
"""Sets `cli.config.<subcommand>.keyboard` based on environment.
|
||||||
|
|
||||||
|
This will rewrite cli.config.<subcommand>.keyboard if the user did not pass `--keyboard` and the directory they are currently in is a keyboard or keymap directory.
|
||||||
|
"""
|
||||||
|
@functools.wraps(func)
|
||||||
|
def wrapper(*args, **kwargs):
|
||||||
|
# Check to make sure their copy of MILC supports config_source
|
||||||
|
if not hasattr(cli, 'config_source'):
|
||||||
|
cli.log.error("This subcommand requires a newer version of the QMK CLI. Please upgrade using `pip3 install --upgrade qmk` or your package manager.")
|
||||||
|
exit(1)
|
||||||
|
|
||||||
|
# Ensure that `--keyboard` was not passed and CWD is under `qmk_firmware/keyboards`
|
||||||
|
if cli.config_source[cli._entrypoint.__name__]['keyboard'] != 'argument':
|
||||||
|
relative_cwd = under_qmk_firmware()
|
||||||
|
|
||||||
|
if relative_cwd and len(relative_cwd.parts) > 1 and relative_cwd.parts[0] == 'keyboards':
|
||||||
|
# Attempt to extract the keyboard name from the current directory
|
||||||
|
current_path = Path('/'.join(relative_cwd.parts[1:]))
|
||||||
|
|
||||||
|
if 'keymaps' in current_path.parts:
|
||||||
|
# Strip current_path of anything after `keymaps`
|
||||||
|
keymap_index = len(current_path.parts) - current_path.parts.index('keymaps') - 1
|
||||||
|
current_path = current_path.parents[keymap_index]
|
||||||
|
|
||||||
|
if is_keyboard(current_path):
|
||||||
|
cli.config[cli._entrypoint.__name__]['keyboard'] = str(current_path)
|
||||||
|
cli.config_source[cli._entrypoint.__name__]['keyboard'] = 'keyboard_directory'
|
||||||
|
|
||||||
|
return func(*args, **kwargs)
|
||||||
|
|
||||||
|
return wrapper
|
||||||
|
|
||||||
|
|
||||||
|
def automagic_keymap(func):
|
||||||
|
"""Sets `cli.config.<subcommand>.keymap` based on environment.
|
||||||
|
|
||||||
|
This will rewrite cli.config.<subcommand>.keymap if the user did not pass `--keymap` and the directory they are currently in is a keymap, layout, or user directory.
|
||||||
|
"""
|
||||||
|
@functools.wraps(func)
|
||||||
|
def wrapper(*args, **kwargs):
|
||||||
|
# Check to make sure their copy of MILC supports config_source
|
||||||
|
if not hasattr(cli, 'config_source'):
|
||||||
|
cli.log.error("This subcommand requires a newer version of the QMK CLI. Please upgrade using `pip3 install --upgrade qmk` or your package manager.")
|
||||||
|
exit(1)
|
||||||
|
|
||||||
|
# Ensure that `--keymap` was not passed and that we're under `qmk_firmware`
|
||||||
|
if cli.config_source[cli._entrypoint.__name__]['keymap'] != 'argument':
|
||||||
|
relative_cwd = under_qmk_firmware()
|
||||||
|
|
||||||
|
if relative_cwd and len(relative_cwd.parts) > 1:
|
||||||
|
# If we're in `qmk_firmware/keyboards` and `keymaps` is in our path, try to find the keyboard name.
|
||||||
|
if relative_cwd.parts[0] == 'keyboards' and 'keymaps' in relative_cwd.parts:
|
||||||
|
current_path = Path('/'.join(relative_cwd.parts[1:])) # Strip 'keyboards' from the front
|
||||||
|
|
||||||
|
if 'keymaps' in current_path.parts and current_path.name != 'keymaps':
|
||||||
|
while current_path.parent.name != 'keymaps':
|
||||||
|
current_path = current_path.parent
|
||||||
|
cli.config[cli._entrypoint.__name__]['keymap'] = current_path.name
|
||||||
|
cli.config_source[cli._entrypoint.__name__]['keyboard'] = 'keymap_directory'
|
||||||
|
|
||||||
|
# If we're in `qmk_firmware/layouts` guess the name from the community keymap they're in
|
||||||
|
elif relative_cwd.parts[0] == 'layouts' and is_keymap_dir(relative_cwd):
|
||||||
|
cli.config[cli._entrypoint.__name__]['keymap'] = relative_cwd.name
|
||||||
|
cli.config_source[cli._entrypoint.__name__]['keyboard'] = 'layouts_directory'
|
||||||
|
|
||||||
|
# If we're in `qmk_firmware/users` guess the name from the userspace they're in
|
||||||
|
elif relative_cwd.parts[0] == 'users':
|
||||||
|
# Guess the keymap name based on which userspace they're in
|
||||||
|
cli.config[cli._entrypoint.__name__]['keymap'] = relative_cwd.parts[1]
|
||||||
|
cli.config_source[cli._entrypoint.__name__]['keyboard'] = 'users_directory'
|
||||||
|
|
||||||
|
return func(*args, **kwargs)
|
||||||
|
|
||||||
|
return wrapper
|
||||||
@@ -65,7 +65,7 @@ def normpath(path):
|
|||||||
path = Path(path)
|
path = Path(path)
|
||||||
|
|
||||||
if path.is_absolute():
|
if path.is_absolute():
|
||||||
return Path(path)
|
return path
|
||||||
|
|
||||||
return Path(os.environ['ORIG_CWD']) / path
|
return Path(os.environ['ORIG_CWD']) / path
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
// This is the default EEPROM max address to use for dynamic keymaps.
|
// This is the default EEPROM max address to use for dynamic keymaps.
|
||||||
// The default is the ATmega32u4 EEPROM max address.
|
// The default is the ATmega32u4 EEPROM max address.
|
||||||
// Explicitly override it if the keyboard uses a microcontroller with
|
// Explicitly override it if the keyboard uses a microcontroller with
|
||||||
// more EEPROM *and* it makes sense to increase it.
|
// more EEPROM *and* it makes sense to increase it.
|
||||||
#ifndef DYNAMIC_KEYMAP_EEPROM_MAX_ADDR
|
#ifndef DYNAMIC_KEYMAP_EEPROM_MAX_ADDR
|
||||||
# define DYNAMIC_KEYMAP_EEPROM_MAX_ADDR 1023
|
# define DYNAMIC_KEYMAP_EEPROM_MAX_ADDR 1023
|
||||||
@@ -210,9 +210,9 @@ void dynamic_keymap_macro_send(uint8_t id) {
|
|||||||
++p;
|
++p;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send the macro string one or two chars at a time
|
// Send the macro string one or three chars at a time
|
||||||
// by making temporary 1 or 2 char strings
|
// by making temporary 1 or 3 char strings
|
||||||
char data[3] = {0, 0, 0};
|
char data[4] = {0, 0, 0, 0};
|
||||||
// We already checked there was a null at the end of
|
// We already checked there was a null at the end of
|
||||||
// the buffer, so this cannot go past the end
|
// the buffer, so this cannot go past the end
|
||||||
while (1) {
|
while (1) {
|
||||||
@@ -223,10 +223,12 @@ void dynamic_keymap_macro_send(uint8_t id) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// If the char is magic (tap, down, up),
|
// If the char is magic (tap, down, up),
|
||||||
// add the next char (key to use) and send a 2 char string.
|
// add the next char (key to use) and send a 3 char string.
|
||||||
if (data[0] == SS_TAP_CODE || data[0] == SS_DOWN_CODE || data[0] == SS_UP_CODE) {
|
if (data[0] == SS_TAP_CODE || data[0] == SS_DOWN_CODE || data[0] == SS_UP_CODE) {
|
||||||
data[1] = eeprom_read_byte(p++);
|
data[1] = data[0];
|
||||||
if (data[1] == 0) {
|
data[0] = SS_QMK_PREFIX;
|
||||||
|
data[2] = eeprom_read_byte(p++);
|
||||||
|
if (data[2] == 0) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,151 @@
|
|||||||
|
/* Copyright 2020
|
||||||
|
*
|
||||||
|
* 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 "keymap.h"
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
|
|
||||||
|
/*
|
||||||
|
* ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐
|
||||||
|
* │ \ │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ ' │ « │ │
|
||||||
|
* ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤
|
||||||
|
* │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ + │ ´ │ │
|
||||||
|
* ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │
|
||||||
|
* │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ Ç │ º │ ~ │ │
|
||||||
|
* ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤
|
||||||
|
* │ │ < │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ - │ │
|
||||||
|
* ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤
|
||||||
|
* │ │ │ │ │ │ │ │ │
|
||||||
|
* └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘
|
||||||
|
*/
|
||||||
|
// Row 1
|
||||||
|
#define PT_BSLS KC_GRV // (backslash)
|
||||||
|
#define PT_1 KC_1 // 1
|
||||||
|
#define PT_2 KC_2 // 2
|
||||||
|
#define PT_3 KC_3 // 3
|
||||||
|
#define PT_4 KC_4 // 4
|
||||||
|
#define PT_5 KC_5 // 5
|
||||||
|
#define PT_6 KC_6 // 6
|
||||||
|
#define PT_7 KC_7 // 7
|
||||||
|
#define PT_8 KC_8 // 8
|
||||||
|
#define PT_9 KC_9 // 9
|
||||||
|
#define PT_0 KC_0 // 0
|
||||||
|
#define PT_QUOT KC_MINS // '
|
||||||
|
#define PT_LDAQ KC_EQL // «
|
||||||
|
// Row 2
|
||||||
|
#define PT_Q KC_Q // Q
|
||||||
|
#define PT_W KC_W // W
|
||||||
|
#define PT_E KC_E // E
|
||||||
|
#define PT_R KC_R // R
|
||||||
|
#define PT_T KC_T // T
|
||||||
|
#define PT_Y KC_Y // Y
|
||||||
|
#define PT_U KC_U // U
|
||||||
|
#define PT_I KC_I // I
|
||||||
|
#define PT_O KC_O // O
|
||||||
|
#define PT_P KC_P // P
|
||||||
|
#define PT_PLUS KC_LBRC // +
|
||||||
|
#define PT_ACUT KC_RBRC // ´ (dead)
|
||||||
|
// Row 3
|
||||||
|
#define PT_A KC_A // A
|
||||||
|
#define PT_S KC_S // S
|
||||||
|
#define PT_D KC_D // D
|
||||||
|
#define PT_F KC_F // F
|
||||||
|
#define PT_G KC_G // G
|
||||||
|
#define PT_H KC_H // H
|
||||||
|
#define PT_J KC_J // J
|
||||||
|
#define PT_K KC_K // K
|
||||||
|
#define PT_L KC_L // L
|
||||||
|
#define PT_CCED KC_SCLN // Ç
|
||||||
|
#define PT_MORD KC_QUOT // º
|
||||||
|
#define PT_TILD KC_NUHS // ~ (dead)
|
||||||
|
// Row 4
|
||||||
|
#define PT_LABK KC_NUBS // <
|
||||||
|
#define PT_Z KC_Z // Z
|
||||||
|
#define PT_X KC_X // X
|
||||||
|
#define PT_C KC_C // C
|
||||||
|
#define PT_V KC_V // V
|
||||||
|
#define PT_B KC_B // B
|
||||||
|
#define PT_N KC_N // N
|
||||||
|
#define PT_M KC_M // M
|
||||||
|
#define PT_COMM KC_COMM // ,
|
||||||
|
#define PT_DOT KC_DOT // .
|
||||||
|
#define PT_MINS KC_SLSH // -
|
||||||
|
|
||||||
|
/* Shifted symbols
|
||||||
|
* ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐
|
||||||
|
* │ | │ ! │ " │ # │ $ │ % │ & │ / │ ( │ ) │ = │ ? │ » │ │
|
||||||
|
* ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤
|
||||||
|
* │ │ │ │ │ │ │ │ │ │ │ │ * │ ` │ │
|
||||||
|
* ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │
|
||||||
|
* │ │ │ │ │ │ │ │ │ │ │ │ ª │ ^ │ │
|
||||||
|
* ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤
|
||||||
|
* │ │ > │ │ │ │ │ │ │ │ ; │ : │ _ │ │
|
||||||
|
* ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤
|
||||||
|
* │ │ │ │ │ │ │ │ │
|
||||||
|
* └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘
|
||||||
|
*/
|
||||||
|
// Row 1
|
||||||
|
#define PT_PIPE S(PT_BSLS) // |
|
||||||
|
#define PT_EXLM S(PT_1) // !
|
||||||
|
#define PT_DQUO S(PT_2) // "
|
||||||
|
#define PT_HASH S(PT_3) // #
|
||||||
|
#define PT_DLR S(PT_4) // $
|
||||||
|
#define PT_PERC S(PT_5) // %
|
||||||
|
#define PT_AMPR S(PT_6) // &
|
||||||
|
#define PT_SLSH S(PT_7) // /
|
||||||
|
#define PT_LPRN S(PT_8) // (
|
||||||
|
#define PT_RPRN S(PT_9) // )
|
||||||
|
#define PT_EQL S(PT_0) // =
|
||||||
|
#define PT_QUES S(PT_QUOT) // ?
|
||||||
|
#define PT_RDAQ S(PT_LDAQ) // »
|
||||||
|
// Row 2
|
||||||
|
#define PT_ASTR S(PT_PLUS) // *
|
||||||
|
#define PT_GRV S(PT_ACUT) // ` (dead)
|
||||||
|
// Row 3
|
||||||
|
#define PT_FORD S(PT_MORD) // ª
|
||||||
|
#define PT_CIRC S(PT_TILD) // ^ (dead)
|
||||||
|
// Row 4
|
||||||
|
#define PT_RABK S(PT_LABK) // >
|
||||||
|
#define PT_SCLN S(PT_COMM) // ;
|
||||||
|
#define PT_COLN S(PT_DOT) // :
|
||||||
|
#define PT_UNDS S(PT_MINS) // _
|
||||||
|
|
||||||
|
/* AltGr symbols
|
||||||
|
* ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐
|
||||||
|
* │ │ │ @ │ £ │ § │ │ │ { │ [ │ ] │ } │ │ │ │
|
||||||
|
* ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤
|
||||||
|
* │ │ │ │ € │ │ │ │ │ │ │ │ ¨ │ │ │
|
||||||
|
* ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │
|
||||||
|
* │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
|
||||||
|
* ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤
|
||||||
|
* │ │ │ │ │ │ │ │ │ │ │ │ │ │
|
||||||
|
* ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤
|
||||||
|
* │ │ │ │ │ │ │ │ │
|
||||||
|
* └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘
|
||||||
|
*/
|
||||||
|
// Row 1
|
||||||
|
#define PT_AT ALGR(PT_2) // @
|
||||||
|
#define PT_PND ALGR(PT_3) // £
|
||||||
|
#define PT_SECT ALGR(PT_4) // §
|
||||||
|
#define PT_LCBR ALGR(PT_7) // {
|
||||||
|
#define PT_LBRC ALGR(PT_8) // [
|
||||||
|
#define PT_RBRC ALGR(PT_9) // ]
|
||||||
|
#define PT_RCBR ALGR(PT_0) // }
|
||||||
|
// Row 2
|
||||||
|
#define PT_DIAE ALGR(PT_PLUS) // ¨ (dead)
|
||||||
|
#define PT_EURO ALGR(PT_E) // €
|
||||||
@@ -13,61 +13,150 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#ifndef KEYMAP_SPANISH_H
|
|
||||||
#define KEYMAP_SPANISH_H
|
#pragma once
|
||||||
|
|
||||||
#include "keymap.h"
|
#include "keymap.h"
|
||||||
|
|
||||||
// Normal characters
|
// clang-format off
|
||||||
#define ES_OVRR KC_GRV
|
|
||||||
#define ES_APOS KC_MINS
|
|
||||||
#define ES_IEXL KC_EQL
|
|
||||||
|
|
||||||
#define ES_GRV KC_LBRC
|
/*
|
||||||
#define ES_PLUS KC_RBRC
|
* ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐
|
||||||
|
* │ º │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ ' │ ¡ │ │
|
||||||
|
* ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤
|
||||||
|
* │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ ` │ + │ │
|
||||||
|
* ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │
|
||||||
|
* │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ Ñ │ ´ │ Ç │ │
|
||||||
|
* ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤
|
||||||
|
* │ │ < │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ - │ │
|
||||||
|
* ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤
|
||||||
|
* │ │ │ │ │ │ │ │ │
|
||||||
|
* └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘
|
||||||
|
*/
|
||||||
|
// Row 1
|
||||||
|
#define ES_MORD KC_GRV // º
|
||||||
|
#define ES_1 KC_1 // 1
|
||||||
|
#define ES_2 KC_2 // 2
|
||||||
|
#define ES_3 KC_3 // 3
|
||||||
|
#define ES_4 KC_4 // 4
|
||||||
|
#define ES_5 KC_5 // 5
|
||||||
|
#define ES_6 KC_6 // 6
|
||||||
|
#define ES_7 KC_7 // 7
|
||||||
|
#define ES_8 KC_8 // 8
|
||||||
|
#define ES_9 KC_9 // 9
|
||||||
|
#define ES_0 KC_0 // 0
|
||||||
|
#define ES_QUOT KC_MINS // '
|
||||||
|
#define ES_IEXL KC_EQL // ¡
|
||||||
|
// Row 2
|
||||||
|
#define ES_Q KC_Q // Q
|
||||||
|
#define ES_W KC_W // W
|
||||||
|
#define ES_E KC_E // E
|
||||||
|
#define ES_R KC_R // R
|
||||||
|
#define ES_T KC_T // T
|
||||||
|
#define ES_Y KC_Y // Y
|
||||||
|
#define ES_U KC_U // U
|
||||||
|
#define ES_I KC_I // I
|
||||||
|
#define ES_O KC_O // O
|
||||||
|
#define ES_P KC_P // P
|
||||||
|
#define ES_GRV KC_LBRC // ` (dead)
|
||||||
|
#define ES_PLUS KC_RBRC // +
|
||||||
|
// Row 3
|
||||||
|
#define ES_A KC_A // A
|
||||||
|
#define ES_S KC_S // S
|
||||||
|
#define ES_D KC_D // D
|
||||||
|
#define ES_F KC_F // F
|
||||||
|
#define ES_G KC_G // G
|
||||||
|
#define ES_H KC_H // H
|
||||||
|
#define ES_J KC_J // J
|
||||||
|
#define ES_K KC_K // K
|
||||||
|
#define ES_L KC_L // L
|
||||||
|
#define ES_NTIL KC_SCLN // Ñ
|
||||||
|
#define ES_ACUT KC_QUOT // ´ (dead)
|
||||||
|
#define ES_CCED KC_NUHS // Ç
|
||||||
|
// Row 4
|
||||||
|
#define ES_LABK KC_NUBS // <
|
||||||
|
#define ES_Z KC_Z // Z
|
||||||
|
#define ES_X KC_X // X
|
||||||
|
#define ES_C KC_C // C
|
||||||
|
#define ES_V KC_V // V
|
||||||
|
#define ES_B KC_B // B
|
||||||
|
#define ES_N KC_N // N
|
||||||
|
#define ES_M KC_M // M
|
||||||
|
#define ES_COMM KC_COMM // ,
|
||||||
|
#define ES_DOT KC_DOT // .
|
||||||
|
#define ES_MINS KC_SLSH // -
|
||||||
|
|
||||||
#define ES_NTIL KC_SCLN
|
/* Shifted symbols
|
||||||
#define ES_ACUT KC_QUOT
|
* ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐
|
||||||
#define ES_CCED KC_NUHS
|
* │ ª │ ! │ " │ · │ $ │ % │ & │ / │ ( │ ) │ = │ ? │ ¿ │ │
|
||||||
|
* ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤
|
||||||
|
* │ │ │ │ │ │ │ │ │ │ │ │ ^ │ * │ │
|
||||||
|
* ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │
|
||||||
|
* │ │ │ │ │ │ │ │ │ │ │ │ ¨ │ │ │
|
||||||
|
* ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤
|
||||||
|
* │ │ > │ │ │ │ │ │ │ │ ; │ : │ _ │ │
|
||||||
|
* ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤
|
||||||
|
* │ │ │ │ │ │ │ │ │
|
||||||
|
* └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘
|
||||||
|
*/
|
||||||
|
// Row 1
|
||||||
|
#define ES_FORD S(ES_MORD) // ª
|
||||||
|
#define ES_EXLM S(ES_1) // !
|
||||||
|
#define ES_DQUO S(ES_2) // "
|
||||||
|
#define ES_BULT S(ES_3) // ·
|
||||||
|
#define ES_DLR S(ES_4) // $
|
||||||
|
#define ES_PERC S(ES_5) // %
|
||||||
|
#define ES_AMPR S(ES_6) // &
|
||||||
|
#define ES_SLSH S(ES_7) // /
|
||||||
|
#define ES_LPRN S(ES_8) // (
|
||||||
|
#define ES_RPRN S(ES_9) // )
|
||||||
|
#define ES_EQL S(ES_0) // =
|
||||||
|
#define ES_QUES S(ES_QUOT) // ?
|
||||||
|
#define ES_IQUE S(ES_IEXL) // ¿
|
||||||
|
// Row 2
|
||||||
|
#define ES_CIRC S(ES_GRV) // ^ (dead)
|
||||||
|
#define ES_ASTR S(ES_PLUS) // *
|
||||||
|
// Row 3
|
||||||
|
#define ES_DIAE S(ES_GRV) // ¨ (dead)
|
||||||
|
// Row 4
|
||||||
|
#define ES_RABK S(ES_LABK) // >
|
||||||
|
#define ES_SCLN S(KC_COMM) // ;
|
||||||
|
#define ES_COLN S(KC_DOT) // :
|
||||||
|
#define ES_UNDS S(ES_MINS) // _
|
||||||
|
|
||||||
#define ES_LESS KC_NUBS
|
/* AltGr symbols
|
||||||
#define ES_MINS KC_SLSH
|
* ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐
|
||||||
|
* │ \ │ | │ @ │ # │ ~ │ € │ ¬ │ │ │ │ │ │ │ │
|
||||||
|
* ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤
|
||||||
|
* │ │ │ │ │ │ │ │ │ │ │ │ [ │ ] │ │
|
||||||
|
* ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │
|
||||||
|
* │ │ │ │ │ │ │ │ │ │ │ │ { │ } │ │
|
||||||
|
* ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤
|
||||||
|
* │ │ │ │ │ │ │ │ │ │ │ │ │ │
|
||||||
|
* ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤
|
||||||
|
* │ │ │ │ │ │ │ │ │
|
||||||
|
* └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘
|
||||||
|
*/
|
||||||
|
// Row 1
|
||||||
|
#define ES_BSLS ALGR(ES_MORD) // (backslash)
|
||||||
|
#define ES_PIPE ALGR(ES_1) // |
|
||||||
|
#define ES_AT ALGR(ES_2) // @
|
||||||
|
#define ES_HASH ALGR(ES_3) // #
|
||||||
|
#define ES_TILD ALGR(ES_4) // ~
|
||||||
|
#define ES_EURO ALGR(ES_5) // €
|
||||||
|
#define ES_NOT ALGR(ES_6) // ¬
|
||||||
|
// Row 2
|
||||||
|
#define ES_LBRC ALGR(ES_GRV) // [
|
||||||
|
#define ES_RBRC ALGR(ES_PLUS) // ]
|
||||||
|
// Row 3
|
||||||
|
#define ES_LCBR ALGR(ES_ACUT) // {
|
||||||
|
#define ES_RCBR ALGR(ES_CCED) // }
|
||||||
|
|
||||||
// Shifted characters
|
// DEPRECATED
|
||||||
#define ES_ASML LSFT(ES_OVRR)
|
#define ES_OVRR ES_MORD
|
||||||
#define ES_QUOT LSFT(KC_2)
|
#define ES_APOS ES_QUOT
|
||||||
#define ES_OVDT LSFT(KC_3)
|
#define ES_LESS ES_LABK
|
||||||
#define ES_AMPR LSFT(KC_6)
|
#define ES_ASML ES_FORD
|
||||||
#define ES_SLSH LSFT(KC_7)
|
#define ES_OVDT ES_BULT
|
||||||
#define ES_LPRN LSFT(KC_8)
|
#define ES_UMLT ES_DIAE
|
||||||
#define ES_RPRN LSFT(KC_9)
|
#define ES_GRTR ES_RABK
|
||||||
#define ES_EQL LSFT(KC_0)
|
|
||||||
#define ES_QUES LSFT(ES_APOS)
|
|
||||||
#define ES_IQUE LSFT(ES_IEXL)
|
|
||||||
|
|
||||||
#define ES_CIRC LSFT(ES_GRV)
|
|
||||||
#define ES_ASTR LSFT(ES_PLUS)
|
|
||||||
|
|
||||||
#define ES_UMLT LSFT(ES_GRV)
|
|
||||||
|
|
||||||
#define ES_GRTR LSFT(ES_LESS)
|
|
||||||
#define ES_SCLN LSFT(KC_COMM)
|
|
||||||
#define ES_COLN LSFT(KC_DOT)
|
|
||||||
#define ES_UNDS LSFT(ES_MINS)
|
|
||||||
|
|
||||||
// Alt Gr-ed characters
|
|
||||||
#define ES_BSLS ALGR(ES_OVRR)
|
|
||||||
#define ES_PIPE ALGR(KC_1)
|
|
||||||
#define ES_AT ALGR(KC_2)
|
|
||||||
#define ES_HASH ALGR(KC_3)
|
|
||||||
#define ES_TILD ALGR(ES_NTIL)
|
|
||||||
#define ES_EURO ALGR(KC_5)
|
|
||||||
#define ES_NOT ALGR(KC_6)
|
|
||||||
|
|
||||||
#define ES_LBRC ALGR(ES_GRV)
|
|
||||||
#define ES_RBRC ALGR(ES_PLUS)
|
|
||||||
|
|
||||||
#define ES_LCBR ALGR(ES_ACUT)
|
|
||||||
#define ES_RCBR ALGR(ES_CCED)
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -14,74 +14,165 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef KEYMAP_SWEDISH_H
|
#pragma once
|
||||||
#define KEYMAP_SWEDISH_H
|
|
||||||
|
|
||||||
#include "keymap.h"
|
#include "keymap.h"
|
||||||
|
|
||||||
// Normal characters
|
// clang-format off
|
||||||
#define SE_HALF KC_GRV
|
|
||||||
#define SE_PLUS KC_MINS
|
|
||||||
#define SE_ACUT KC_EQL
|
|
||||||
|
|
||||||
#define SE_AM KC_LBRC
|
/*
|
||||||
#define SE_QUOT KC_RBRC // this is the "umlaut" char on Nordic keyboards, Apple layout
|
* ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐
|
||||||
#define SE_AE KC_QUOT // ä
|
* │ § │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ + │ ´ │ │
|
||||||
#define SE_OSLH KC_SCLN // ö
|
* ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤
|
||||||
#define SE_APOS KC_NUHS
|
* │ │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ Å │ ¨ │ │
|
||||||
|
* ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │
|
||||||
|
* │ │ A │ S │ D │ F │ G │ H │ J │ K │ L │ Ö │ Ä │ ' │ │
|
||||||
|
* ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤
|
||||||
|
* │ │ < │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ - │ │
|
||||||
|
* ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤
|
||||||
|
* │ │ │ │ │ │ │ │ │
|
||||||
|
* └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘
|
||||||
|
*/
|
||||||
|
// Row 1
|
||||||
|
#define SE_SECT KC_GRV // §
|
||||||
|
#define SE_1 KC_1 // 1
|
||||||
|
#define SE_2 KC_2 // 2
|
||||||
|
#define SE_3 KC_3 // 3
|
||||||
|
#define SE_4 KC_4 // 4
|
||||||
|
#define SE_5 KC_5 // 5
|
||||||
|
#define SE_6 KC_6 // 6
|
||||||
|
#define SE_7 KC_7 // 7
|
||||||
|
#define SE_8 KC_8 // 8
|
||||||
|
#define SE_9 KC_9 // 9
|
||||||
|
#define SE_0 KC_0 // 0
|
||||||
|
#define SE_PLUS KC_MINS // +
|
||||||
|
#define SE_ACUT KC_EQL // ´ (dead)
|
||||||
|
// Row 2
|
||||||
|
#define SE_Q KC_Q // Q
|
||||||
|
#define SE_W KC_W // W
|
||||||
|
#define SE_E KC_E // E
|
||||||
|
#define SE_R KC_R // R
|
||||||
|
#define SE_T KC_T // T
|
||||||
|
#define SE_Y KC_Y // Y
|
||||||
|
#define SE_U KC_U // U
|
||||||
|
#define SE_I KC_I // I
|
||||||
|
#define SE_O KC_O // O
|
||||||
|
#define SE_P KC_P // P
|
||||||
|
#define SE_ARNG KC_LBRC // Å
|
||||||
|
#define SE_DIAE KC_RBRC // ¨ (dead)
|
||||||
|
// Row 3
|
||||||
|
#define SE_A KC_A // A
|
||||||
|
#define SE_S KC_S // S
|
||||||
|
#define SE_D KC_D // D
|
||||||
|
#define SE_F KC_F // F
|
||||||
|
#define SE_G KC_G // G
|
||||||
|
#define SE_H KC_H // H
|
||||||
|
#define SE_J KC_J // J
|
||||||
|
#define SE_K KC_K // K
|
||||||
|
#define SE_L KC_L // L
|
||||||
|
#define SE_ODIA KC_SCLN // Ö
|
||||||
|
#define SE_ADIA KC_QUOT // Ä
|
||||||
|
#define SE_QUOT KC_NUHS // '
|
||||||
|
// Row 4
|
||||||
|
#define SE_LABK KC_NUBS // <
|
||||||
|
#define SE_Z KC_Z // Z
|
||||||
|
#define SE_X KC_X // X
|
||||||
|
#define SE_C KC_C // C
|
||||||
|
#define SE_V KC_V // V
|
||||||
|
#define SE_B KC_B // B
|
||||||
|
#define SE_N KC_N // N
|
||||||
|
#define SE_M KC_M // M
|
||||||
|
#define SE_COMM KC_COMM // ,
|
||||||
|
#define SE_DOT KC_DOT // .
|
||||||
|
#define SE_MINS KC_SLSH // -
|
||||||
|
|
||||||
#define SE_LESS KC_NUBS
|
/* Shifted symbols
|
||||||
#define SE_MINS KC_SLSH
|
* ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐
|
||||||
|
* │ ½ │ ! │ " │ # │ ¤ │ % │ & │ / │ ( │ ) │ = │ ? │ ` │ │
|
||||||
|
* ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤
|
||||||
|
* │ │ │ │ │ │ │ │ │ │ │ │ │ ^ │ │
|
||||||
|
* ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │
|
||||||
|
* │ │ │ │ │ │ │ │ │ │ │ │ │ * │ │
|
||||||
|
* ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤
|
||||||
|
* │ │ > │ │ │ │ │ │ │ │ ; │ : │ _ │ │
|
||||||
|
* ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤
|
||||||
|
* │ │ │ │ │ │ │ │ │
|
||||||
|
* └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘
|
||||||
|
*/
|
||||||
|
// Row 1
|
||||||
|
#define SE_HALF S(SE_SECT) // ½
|
||||||
|
#define SE_EXLM S(SE_1) // !
|
||||||
|
#define SE_DQUO S(SE_2) // "
|
||||||
|
#define SE_HASH S(SE_3) // #
|
||||||
|
#define SE_CURR S(SE_4) // ¤
|
||||||
|
#define SE_PERC S(SE_5) // %
|
||||||
|
#define SE_AMPR S(SE_6) // &
|
||||||
|
#define SE_SLSH S(SE_7) // /
|
||||||
|
#define SE_LPRN S(SE_8) // (
|
||||||
|
#define SE_RPRN S(SE_9) // )
|
||||||
|
#define SE_EQL S(SE_0) // =
|
||||||
|
#define SE_QUES S(SE_PLUS) // ?
|
||||||
|
#define SE_GRV S(SE_ACUT) // ` (dead)
|
||||||
|
// Row 2
|
||||||
|
#define SE_CIRC S(SE_DIAE) // ^ (dead)
|
||||||
|
// Row 3
|
||||||
|
#define SE_ASTR S(SE_QUOT) // *
|
||||||
|
// Row 4
|
||||||
|
#define SE_RABK S(SE_LABK) // >
|
||||||
|
#define SE_SCLN S(SE_COMM) // ;
|
||||||
|
#define SE_COLN S(SE_DOT) // :
|
||||||
|
#define SE_UNDS S(SE_MINS) // _
|
||||||
|
|
||||||
// Shifted characters
|
/* AltGr symbols
|
||||||
#define SE_SECT LSFT(SE_HALF)
|
* ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐
|
||||||
#define SE_QUO2 LSFT(KC_2)
|
* │ │ │ @ │ £ │ $ │ € │ │ { │ [ │ ] │ } │ \ │ │ │
|
||||||
#define SE_BULT LSFT(KC_4)
|
* ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤
|
||||||
#define SE_AMPR LSFT(KC_6)
|
* │ │ │ │ │ │ │ │ │ │ │ │ │ ~ │ │
|
||||||
#define SE_SLSH LSFT(KC_7)
|
* ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │
|
||||||
#define SE_LPRN LSFT(KC_8)
|
* │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
|
||||||
#define SE_RPRN LSFT(KC_9)
|
* ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤
|
||||||
#define SE_EQL LSFT(KC_0)
|
* │ │ | │ │ │ │ │ │ │ µ │ │ │ │ │
|
||||||
#define SE_QUES LSFT(SE_PLUS)
|
* ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤
|
||||||
#define SE_GRV LSFT(SE_ACUT)
|
* │ │ │ │ │ │ │ │ │
|
||||||
|
* └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘
|
||||||
|
*/
|
||||||
|
// Row 1
|
||||||
|
#define SE_AT ALGR(SE_2) // @
|
||||||
|
#define SE_PND ALGR(SE_3) // £
|
||||||
|
#define SE_DLR ALGR(SE_4) // $
|
||||||
|
#define SE_EURO ALGR(SE_5) // €
|
||||||
|
#define SE_LCBR ALGR(SE_7) // {
|
||||||
|
#define SE_LBRC ALGR(SE_8) // [
|
||||||
|
#define SE_RBRC ALGR(SE_9) // ]
|
||||||
|
#define SE_RCBR ALGR(SE_0) // }
|
||||||
|
#define SE_BSLS ALGR(SE_PLUS) // (backslash)
|
||||||
|
// Row 2
|
||||||
|
#define SE_TILD ALGR(SE_DIAE) // ~ (dead)
|
||||||
|
// Row 4
|
||||||
|
#define SE_PIPE ALGR(SE_LABK) // |
|
||||||
|
#define SE_MICR ALGR(SE_M) // µ
|
||||||
|
|
||||||
#define SE_CIRC LSFT(KC_RBRC) // ^
|
// DEPRECATED
|
||||||
|
#include "keymap_nordic.h"
|
||||||
|
|
||||||
#define SE_GRTR LSFT(SE_LESS)
|
#undef NO_AE
|
||||||
#define SE_SCLN LSFT(KC_COMM)
|
#undef NO_CIRC
|
||||||
#define SE_COLN LSFT(KC_DOT)
|
#undef NO_OSLH
|
||||||
#define SE_UNDS LSFT(SE_MINS)
|
|
||||||
|
|
||||||
// Alt Gr-ed characters
|
#define NO_AE SE_AE
|
||||||
#define SE_AT ALGR(KC_2)
|
#define NO_CIRC SE_CIRC
|
||||||
#define SE_PND ALGR(KC_3)
|
#define NO_OSLH SE_ODIA
|
||||||
#define SE_DLR ALGR(KC_4)
|
#define NO_AA SE_ARNG
|
||||||
#define SE_LCBR ALGR(KC_7)
|
#define NO_ASTR SE_ASTR
|
||||||
#define SE_LBRC ALGR(KC_8)
|
// Swedish macOS symbols (not vetted)
|
||||||
#define SE_RBRC ALGR(KC_9)
|
#define NO_ACUT_MAC SE_ACUT
|
||||||
#define SE_RCBR ALGR(KC_0)
|
#define NO_APOS_MAC SE_LABK
|
||||||
#define SE_PIPE ALGR(KC_NUBS)
|
#define NO_AT_MAC SE_ADIA
|
||||||
|
#define NO_BSLS_MAC S(SE_LCBR)
|
||||||
#define SE_EURO ALGR(KC_E)
|
#define NO_DLR_MAC SE_CURR
|
||||||
#define SE_TILD ALGR(SE_QUOT)
|
#define NO_GRV_MAC SE_BSLS
|
||||||
|
#define NO_GRTR_MAC SE_HALF
|
||||||
#define SE_BSLS ALGR(KC_MINS)
|
#define NO_LCBR_MAC S(SE_LBRC)
|
||||||
#define SE_MU ALGR(KC_M)
|
#define NO_LESS_MAC SE_SECT
|
||||||
|
#define NO_PIPE_MAC SE_LCBR
|
||||||
#define SE_AA KC_LBRC // å
|
#define NO_RCBR_MAC S(SE_RBRC)
|
||||||
#define SE_ASTR LSFT(KC_BSLS) // *
|
|
||||||
|
|
||||||
// Norwegian unique MAC characters (not vetted for Swedish)
|
|
||||||
#define SE_ACUT_MAC KC_EQL // =
|
|
||||||
#define SE_APOS_MAC KC_NUBS // '
|
|
||||||
#define SE_AT_MAC KC_BSLS // @
|
|
||||||
#define SE_BSLS_MAC ALGR(LSFT(KC_7)) // '\'
|
|
||||||
#define SE_DLR_MAC ALGR(KC_4) // $
|
|
||||||
#define SE_GRV_MAC ALGR(SE_BSLS) // `
|
|
||||||
#define SE_GRTR_MAC LSFT(KC_GRV) // >
|
|
||||||
#define SE_LCBR_MAC ALGR(LSFT(KC_8)) // {
|
|
||||||
#define SE_LESS_MAC KC_GRV // <
|
|
||||||
#define SE_PIPE_MAC ALGR(KC_7) // |
|
|
||||||
#define SE_RCBR_MAC ALGR(LSFT(KC_9)) // }
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -0,0 +1,100 @@
|
|||||||
|
/* Copyright 2020
|
||||||
|
*
|
||||||
|
* 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/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Sendstring lookup tables for Portuguese layouts
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "keymap_portuguese.h"
|
||||||
|
#include "quantum.h"
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
|
|
||||||
|
const uint8_t ascii_to_shift_lut[16] PROGMEM = {
|
||||||
|
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
|
||||||
|
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
|
||||||
|
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
|
||||||
|
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
|
||||||
|
|
||||||
|
KCLUT_ENTRY(0, 1, 1, 1, 1, 1, 1, 0),
|
||||||
|
KCLUT_ENTRY(1, 1, 1, 0, 0, 0, 0, 1),
|
||||||
|
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
|
||||||
|
KCLUT_ENTRY(0, 0, 1, 1, 0, 1, 1, 1),
|
||||||
|
KCLUT_ENTRY(0, 1, 1, 1, 1, 1, 1, 1),
|
||||||
|
KCLUT_ENTRY(1, 1, 1, 1, 1, 1, 1, 1),
|
||||||
|
KCLUT_ENTRY(1, 1, 1, 1, 1, 1, 1, 1),
|
||||||
|
KCLUT_ENTRY(1, 1, 1, 0, 0, 0, 1, 1),
|
||||||
|
KCLUT_ENTRY(1, 0, 0, 0, 0, 0, 0, 0),
|
||||||
|
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
|
||||||
|
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
|
||||||
|
KCLUT_ENTRY(0, 0, 0, 0, 1, 0, 0, 0),
|
||||||
|
};
|
||||||
|
|
||||||
|
const uint8_t ascii_to_altgr_lut[16] PROGMEM = {
|
||||||
|
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
|
||||||
|
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
|
||||||
|
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
|
||||||
|
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
|
||||||
|
|
||||||
|
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
|
||||||
|
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
|
||||||
|
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
|
||||||
|
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
|
||||||
|
KCLUT_ENTRY(1, 0, 0, 0, 0, 0, 0, 0),
|
||||||
|
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
|
||||||
|
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
|
||||||
|
KCLUT_ENTRY(0, 0, 0, 1, 0, 1, 0, 0),
|
||||||
|
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
|
||||||
|
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
|
||||||
|
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
|
||||||
|
KCLUT_ENTRY(0, 0, 0, 1, 0, 1, 0, 0),
|
||||||
|
};
|
||||||
|
|
||||||
|
const uint8_t ascii_to_keycode_lut[128] PROGMEM = {
|
||||||
|
// NUL SOH STX ETX EOT ENQ ACK BEL
|
||||||
|
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||||
|
// BS TAB LF VT FF CR SO SI
|
||||||
|
KC_BSPC, KC_TAB, KC_ENT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||||
|
// DLE DC1 DC2 DC3 DC4 NAK SYN ETB
|
||||||
|
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||||
|
// CAN EM SUB ESC FS GS RS US
|
||||||
|
XXXXXXX, XXXXXXX, XXXXXXX, KC_ESC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||||
|
|
||||||
|
// ! " # $ % & '
|
||||||
|
KC_SPC, PT_1, PT_2, PT_3, PT_4, PT_5, PT_6, PT_QUOT,
|
||||||
|
// ( ) * + , - . /
|
||||||
|
PT_8, PT_9, PT_PLUS, PT_PLUS, PT_COMM, PT_MINS, PT_DOT, PT_7,
|
||||||
|
// 0 1 2 3 4 5 6 7
|
||||||
|
PT_0, PT_1, PT_2, PT_3, PT_4, PT_5, PT_6, PT_7,
|
||||||
|
// 8 9 : ; < = > ?
|
||||||
|
PT_8, PT_9, PT_DOT, PT_COMM, PT_LABK, PT_0, PT_LABK, PT_QUOT,
|
||||||
|
// @ A B C D E F G
|
||||||
|
PT_2, PT_A, PT_B, PT_C, PT_D, PT_E, PT_F, PT_G,
|
||||||
|
// H I J K L M N O
|
||||||
|
PT_H, PT_I, PT_J, PT_K, PT_L, PT_M, PT_N, PT_O,
|
||||||
|
// P Q R S T U V W
|
||||||
|
PT_P, PT_Q, PT_R, PT_S, PT_T, PT_U, PT_V, PT_W,
|
||||||
|
// X Y Z [ \ ] ^ _
|
||||||
|
PT_X, PT_Y, PT_Z, PT_8, PT_BSLS, PT_9, PT_TILD, PT_MINS,
|
||||||
|
// ` a b c d e f g
|
||||||
|
PT_ACUT, PT_A, PT_B, PT_C, PT_D, PT_E, PT_F, PT_G,
|
||||||
|
// h i j k l m n o
|
||||||
|
PT_H, PT_I, PT_J, PT_K, PT_L, PT_M, PT_N, PT_O,
|
||||||
|
// p q r s t u v w
|
||||||
|
PT_P, PT_Q, PT_R, PT_S, PT_T, PT_U, PT_V, PT_W,
|
||||||
|
// x y z { | } ~ DEL
|
||||||
|
PT_X, PT_Y, PT_Z, PT_7, PT_BSLS, PT_0, PT_TILD, KC_DEL
|
||||||
|
};
|
||||||
@@ -40,7 +40,7 @@ const uint8_t ascii_to_shift_lut[16] PROGMEM = {
|
|||||||
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
|
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
|
||||||
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
|
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
|
||||||
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
|
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
|
||||||
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
|
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0)
|
||||||
};
|
};
|
||||||
|
|
||||||
const uint8_t ascii_to_altgr_lut[16] PROGMEM = {
|
const uint8_t ascii_to_altgr_lut[16] PROGMEM = {
|
||||||
@@ -60,7 +60,7 @@ const uint8_t ascii_to_altgr_lut[16] PROGMEM = {
|
|||||||
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
|
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
|
||||||
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
|
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
|
||||||
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
|
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
|
||||||
KCLUT_ENTRY(0, 0, 0, 1, 1, 1, 1, 0),
|
KCLUT_ENTRY(0, 0, 0, 1, 1, 1, 1, 0)
|
||||||
};
|
};
|
||||||
|
|
||||||
const uint8_t ascii_to_keycode_lut[128] PROGMEM = {
|
const uint8_t ascii_to_keycode_lut[128] PROGMEM = {
|
||||||
@@ -74,27 +74,27 @@ const uint8_t ascii_to_keycode_lut[128] PROGMEM = {
|
|||||||
XXXXXXX, XXXXXXX, XXXXXXX, KC_ESC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
XXXXXXX, XXXXXXX, XXXXXXX, KC_ESC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||||
|
|
||||||
// ! " # $ % & '
|
// ! " # $ % & '
|
||||||
KC_SPC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, ES_APOS,
|
KC_SPC, ES_1, ES_2, ES_3, ES_4, ES_5, ES_6, ES_QUOT,
|
||||||
// ( ) * + , - . /
|
// ( ) * + , - . /
|
||||||
KC_8, KC_9, ES_PLUS, ES_PLUS, KC_COMM, ES_MINS, KC_DOT, KC_7,
|
ES_8, ES_9, ES_PLUS, ES_PLUS, ES_COMM, ES_MINS, ES_DOT, ES_7,
|
||||||
// 0 1 2 3 4 5 6 7
|
// 0 1 2 3 4 5 6 7
|
||||||
KC_0, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7,
|
ES_0, ES_1, ES_2, ES_3, ES_4, ES_5, ES_6, ES_7,
|
||||||
// 8 9 : ; < = > ?
|
// 8 9 : ; < = > ?
|
||||||
KC_8, KC_9, KC_DOT, KC_COMM, ES_LESS, KC_0, ES_LESS, ES_APOS,
|
ES_8, ES_9, ES_DOT, ES_COMM, ES_LABK, ES_0, ES_LABK, ES_QUOT,
|
||||||
// @ A B C D E F G
|
// @ A B C D E F G
|
||||||
KC_2, KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G,
|
ES_2, ES_A, ES_B, ES_C, ES_D, ES_E, ES_F, ES_G,
|
||||||
// H I J K L M N O
|
// H I J K L M N O
|
||||||
KC_H, KC_I, KC_J, KC_K, KC_L, KC_M, KC_N, KC_O,
|
ES_H, ES_I, ES_J, ES_K, ES_L, ES_M, ES_N, ES_O,
|
||||||
// P Q R S T U V W
|
// P Q R S T U V W
|
||||||
KC_P, KC_Q, KC_R, KC_S, KC_T, KC_U, KC_V, KC_W,
|
ES_P, ES_Q, ES_R, ES_S, ES_T, ES_U, ES_V, ES_W,
|
||||||
// X Y Z [ \ ] ^ _
|
// X Y Z [ \ ] ^ _
|
||||||
KC_X, KC_Y, KC_Z, ES_GRV, ES_OVRR, ES_PLUS, ES_GRV, ES_MINS,
|
ES_X, ES_Y, ES_Z, ES_GRV, ES_MORD, ES_PLUS, ES_GRV, ES_MINS,
|
||||||
// ` a b c d e f g
|
// ` a b c d e f g
|
||||||
ES_GRV, KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G,
|
ES_GRV, ES_A, ES_B, ES_C, ES_D, ES_E, ES_F, ES_G,
|
||||||
// h i j k l m n o
|
// h i j k l m n o
|
||||||
KC_H, KC_I, KC_J, KC_K, KC_L, KC_M, KC_N, KC_O,
|
ES_H, ES_I, ES_J, ES_K, ES_L, ES_M, ES_N, ES_O,
|
||||||
// p q r s t u v w
|
// p q r s t u v w
|
||||||
KC_P, KC_Q, KC_R, KC_S, KC_T, KC_U, KC_V, KC_W,
|
ES_P, ES_Q, ES_R, ES_S, ES_T, ES_U, ES_V, ES_W,
|
||||||
// x y z { | } ~ DEL
|
// x y z { | } ~ DEL
|
||||||
KC_X, KC_Y, KC_Z, ES_ACUT, KC_1, ES_CCED, ES_NTIL, KC_DEL
|
ES_X, ES_Y, ES_Z, ES_ACUT, ES_1, ES_CCED, ES_NTIL, KC_DEL
|
||||||
};
|
};
|
||||||
@@ -0,0 +1,100 @@
|
|||||||
|
/* Copyright 2019
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Sendstring lookup tables for Swedish layouts
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "keymap_swedish.h"
|
||||||
|
#include "quantum.h"
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
|
|
||||||
|
const uint8_t ascii_to_shift_lut[16] PROGMEM = {
|
||||||
|
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
|
||||||
|
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
|
||||||
|
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
|
||||||
|
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
|
||||||
|
|
||||||
|
KCLUT_ENTRY(0, 1, 1, 1, 0, 1, 1, 0),
|
||||||
|
KCLUT_ENTRY(1, 1, 1, 0, 0, 0, 0, 1),
|
||||||
|
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
|
||||||
|
KCLUT_ENTRY(0, 0, 1, 1, 0, 1, 1, 1),
|
||||||
|
KCLUT_ENTRY(0, 1, 1, 1, 1, 1, 1, 1),
|
||||||
|
KCLUT_ENTRY(1, 1, 1, 1, 1, 1, 1, 1),
|
||||||
|
KCLUT_ENTRY(1, 1, 1, 1, 1, 1, 1, 1),
|
||||||
|
KCLUT_ENTRY(1, 1, 1, 0, 0, 0, 1, 1),
|
||||||
|
KCLUT_ENTRY(1, 0, 0, 0, 0, 0, 0, 0),
|
||||||
|
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
|
||||||
|
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
|
||||||
|
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0)
|
||||||
|
};
|
||||||
|
|
||||||
|
const uint8_t ascii_to_altgr_lut[16] PROGMEM = {
|
||||||
|
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
|
||||||
|
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
|
||||||
|
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
|
||||||
|
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
|
||||||
|
|
||||||
|
KCLUT_ENTRY(0, 0, 0, 0, 1, 0, 0, 0),
|
||||||
|
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
|
||||||
|
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
|
||||||
|
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
|
||||||
|
KCLUT_ENTRY(1, 0, 0, 0, 0, 0, 0, 0),
|
||||||
|
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
|
||||||
|
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
|
||||||
|
KCLUT_ENTRY(0, 0, 0, 1, 1, 1, 0, 0),
|
||||||
|
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
|
||||||
|
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
|
||||||
|
KCLUT_ENTRY(0, 0, 0, 0, 0, 0, 0, 0),
|
||||||
|
KCLUT_ENTRY(0, 0, 0, 1, 1, 1, 1, 0)
|
||||||
|
};
|
||||||
|
|
||||||
|
const uint8_t ascii_to_keycode_lut[128] PROGMEM = {
|
||||||
|
// NUL SOH STX ETX EOT ENQ ACK BEL
|
||||||
|
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||||
|
// BS TAB LF VT FF CR SO SI
|
||||||
|
KC_BSPC, KC_TAB, KC_ENT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||||
|
// DLE DC1 DC2 DC3 DC4 NAK SYN ETB
|
||||||
|
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||||
|
// CAN EM SUB ESC FS GS RS US
|
||||||
|
XXXXXXX, XXXXXXX, XXXXXXX, KC_ESC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||||
|
|
||||||
|
// ! " # $ % & '
|
||||||
|
KC_SPC, SE_1, SE_2, SE_3, SE_4, SE_5, SE_6, SE_QUOT,
|
||||||
|
// ( ) * + , - . /
|
||||||
|
SE_8, SE_9, SE_QUOT, SE_PLUS, SE_COMM, SE_MINS, SE_DOT, SE_7,
|
||||||
|
// 0 1 2 3 4 5 6 7
|
||||||
|
SE_0, SE_1, SE_2, SE_3, SE_4, SE_5, SE_6, SE_7,
|
||||||
|
// 8 9 : ; < = > ?
|
||||||
|
SE_8, SE_9, SE_DOT, SE_COMM, SE_LABK, SE_0, SE_LABK, SE_PLUS,
|
||||||
|
// @ A B C D E F G
|
||||||
|
SE_2, SE_A, SE_B, SE_C, SE_D, SE_E, SE_F, SE_G,
|
||||||
|
// H I J K L M N O
|
||||||
|
SE_H, SE_I, SE_J, SE_K, SE_L, SE_M, SE_N, SE_O,
|
||||||
|
// P Q R S T U V W
|
||||||
|
SE_P, SE_Q, SE_R, SE_S, SE_T, SE_U, SE_V, SE_W,
|
||||||
|
// X Y Z [ \ ] ^ _
|
||||||
|
SE_X, SE_Y, SE_Z, SE_8, SE_PLUS, SE_9, SE_DIAE, SE_MINS,
|
||||||
|
// ` a b c d e f g
|
||||||
|
SE_ACUT, SE_A, SE_B, SE_C, SE_D, SE_E, SE_F, SE_G,
|
||||||
|
// h i j k l m n o
|
||||||
|
SE_H, SE_I, SE_J, SE_K, SE_L, SE_M, SE_N, SE_O,
|
||||||
|
// p q r s t u v w
|
||||||
|
SE_P, SE_Q, SE_R, SE_S, SE_T, SE_U, SE_V, SE_W,
|
||||||
|
// x y z { | } ~ DEL
|
||||||
|
SE_X, SE_Y, SE_Z, SE_7, SE_LABK, SE_0, SE_DIAE, KC_DEL
|
||||||
|
};
|
||||||
@@ -28,7 +28,7 @@ const uint16_t PROGMEM
|
|||||||
{
|
{
|
||||||
// 0 1 2 3 4 5 6 7 8 9
|
// 0 1 2 3 4 5 6 7 8 9
|
||||||
{KC_A, KC_B, KC_NO, KC_LSFT, KC_RSFT, KC_LCTL, COMBO1, SFT_T(KC_P), M(0), KC_NO},
|
{KC_A, KC_B, KC_NO, KC_LSFT, KC_RSFT, KC_LCTL, COMBO1, SFT_T(KC_P), M(0), KC_NO},
|
||||||
{KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO},
|
{KC_EQL, KC_PLUS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO},
|
||||||
{KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO},
|
{KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO},
|
||||||
{KC_C, KC_D, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO},
|
{KC_C, KC_D, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
#include "test_common.hpp"
|
#include "test_common.hpp"
|
||||||
|
|
||||||
using testing::_;
|
using testing::_;
|
||||||
|
using testing::InSequence;
|
||||||
using testing::Return;
|
using testing::Return;
|
||||||
|
|
||||||
class KeyPress : public TestFixture {};
|
class KeyPress : public TestFixture {};
|
||||||
@@ -121,4 +122,119 @@ TEST_F(KeyPress, RightShiftLeftControlAndCharWithTheSameKey) {
|
|||||||
EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_RSFT, KC_RCTRL)));
|
EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_RSFT, KC_RCTRL)));
|
||||||
EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport()));
|
EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport()));
|
||||||
keyboard_task();
|
keyboard_task();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_F(KeyPress, PressPlusEqualReleaseBeforePress) {
|
||||||
|
TestDriver driver;
|
||||||
|
InSequence s;
|
||||||
|
|
||||||
|
press_key(1, 1); // KC_PLUS
|
||||||
|
EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT)));
|
||||||
|
EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT, KC_EQL)));
|
||||||
|
run_one_scan_loop();
|
||||||
|
testing::Mock::VerifyAndClearExpectations(&driver);
|
||||||
|
|
||||||
|
release_key(1, 1); // KC_PLUS
|
||||||
|
EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT)));
|
||||||
|
EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport()));
|
||||||
|
run_one_scan_loop();
|
||||||
|
testing::Mock::VerifyAndClearExpectations(&driver);
|
||||||
|
|
||||||
|
press_key(0, 1); // KC_EQL
|
||||||
|
EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_EQL)));
|
||||||
|
run_one_scan_loop();
|
||||||
|
testing::Mock::VerifyAndClearExpectations(&driver);
|
||||||
|
|
||||||
|
release_key(0, 1); // KC_EQL
|
||||||
|
EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport()));
|
||||||
|
run_one_scan_loop();
|
||||||
|
testing::Mock::VerifyAndClearExpectations(&driver);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_F(KeyPress, PressPlusEqualDontReleaseBeforePress) {
|
||||||
|
TestDriver driver;
|
||||||
|
InSequence s;
|
||||||
|
|
||||||
|
press_key(1, 1); // KC_PLUS
|
||||||
|
EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT)));
|
||||||
|
EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT, KC_EQL)));
|
||||||
|
run_one_scan_loop();
|
||||||
|
testing::Mock::VerifyAndClearExpectations(&driver);
|
||||||
|
|
||||||
|
press_key(0, 1); // KC_EQL
|
||||||
|
EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport()));
|
||||||
|
EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_EQL)));
|
||||||
|
run_one_scan_loop();
|
||||||
|
testing::Mock::VerifyAndClearExpectations(&driver);
|
||||||
|
|
||||||
|
release_key(1, 1); // KC_PLS
|
||||||
|
// BUG: Should really still return KC_EQL, but this is fine too
|
||||||
|
// It's also called twice for some reason
|
||||||
|
EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())).Times(2);
|
||||||
|
run_one_scan_loop();
|
||||||
|
testing::Mock::VerifyAndClearExpectations(&driver);
|
||||||
|
|
||||||
|
release_key(0, 1); // KC_EQL
|
||||||
|
EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport()));
|
||||||
|
run_one_scan_loop();
|
||||||
|
testing::Mock::VerifyAndClearExpectations(&driver);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_F(KeyPress, PressEqualPlusReleaseBeforePress) {
|
||||||
|
TestDriver driver;
|
||||||
|
InSequence s;
|
||||||
|
|
||||||
|
press_key(0, 1); // KC_EQL
|
||||||
|
EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_EQL)));
|
||||||
|
run_one_scan_loop();
|
||||||
|
testing::Mock::VerifyAndClearExpectations(&driver);
|
||||||
|
|
||||||
|
release_key(0, 1); // KQ_EQL
|
||||||
|
EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport()));
|
||||||
|
run_one_scan_loop();
|
||||||
|
testing::Mock::VerifyAndClearExpectations(&driver);
|
||||||
|
|
||||||
|
press_key(1, 1); // KC_PLUS
|
||||||
|
EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT)));
|
||||||
|
EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT, KC_EQL)));
|
||||||
|
run_one_scan_loop();
|
||||||
|
testing::Mock::VerifyAndClearExpectations(&driver);
|
||||||
|
|
||||||
|
release_key(1, 1); // KC_PLUS
|
||||||
|
EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT)));
|
||||||
|
EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport()));
|
||||||
|
run_one_scan_loop();
|
||||||
|
testing::Mock::VerifyAndClearExpectations(&driver);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST_F(KeyPress, PressEqualPlusDontReleaseBeforePress) {
|
||||||
|
TestDriver driver;
|
||||||
|
InSequence s;
|
||||||
|
|
||||||
|
press_key(0, 1); // KC_EQL
|
||||||
|
EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_EQL)));
|
||||||
|
run_one_scan_loop();
|
||||||
|
testing::Mock::VerifyAndClearExpectations(&driver);
|
||||||
|
|
||||||
|
press_key(1, 1); // KC_PLUS
|
||||||
|
// BUG: The sequence is a bit strange, but it works, the end result is that
|
||||||
|
// KC_PLUS is sent
|
||||||
|
EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT, KC_EQL)));
|
||||||
|
EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT)));
|
||||||
|
EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT, KC_EQL)));
|
||||||
|
run_one_scan_loop();
|
||||||
|
testing::Mock::VerifyAndClearExpectations(&driver);
|
||||||
|
|
||||||
|
release_key(0, 1); // KC_EQL
|
||||||
|
// I guess it's fine to still report shift here
|
||||||
|
EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT)));
|
||||||
|
run_one_scan_loop();
|
||||||
|
testing::Mock::VerifyAndClearExpectations(&driver);
|
||||||
|
|
||||||
|
release_key(1, 1); // KC_PLUS
|
||||||
|
// This report is not needed
|
||||||
|
EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport(KC_LSFT)));
|
||||||
|
EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport()));
|
||||||
|
run_one_scan_loop();
|
||||||
|
testing::Mock::VerifyAndClearExpectations(&driver);
|
||||||
|
}
|
||||||
@@ -32,14 +32,15 @@ TestFixture::TestFixture() {}
|
|||||||
|
|
||||||
TestFixture::~TestFixture() {
|
TestFixture::~TestFixture() {
|
||||||
TestDriver driver;
|
TestDriver driver;
|
||||||
layer_clear();
|
|
||||||
clear_all_keys();
|
|
||||||
// Run for a while to make sure all keys are completely released
|
// Run for a while to make sure all keys are completely released
|
||||||
EXPECT_CALL(driver, send_keyboard_mock(_)).Times(AnyNumber());
|
EXPECT_CALL(driver, send_keyboard_mock(_)).Times(AnyNumber());
|
||||||
|
layer_clear();
|
||||||
|
clear_all_keys();
|
||||||
idle_for(TAPPING_TERM + 10);
|
idle_for(TAPPING_TERM + 10);
|
||||||
testing::Mock::VerifyAndClearExpectations(&driver);
|
testing::Mock::VerifyAndClearExpectations(&driver);
|
||||||
// Verify that the matrix really is cleared
|
// Verify that the matrix really is cleared
|
||||||
EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())).Times(Between(0, 1));
|
EXPECT_CALL(driver, send_keyboard_mock(KeyboardReport())).Times(0);
|
||||||
|
idle_for(TAPPING_TERM + 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TestFixture::run_one_scan_loop() {
|
void TestFixture::run_one_scan_loop() {
|
||||||
|
|||||||
@@ -754,6 +754,13 @@ void register_code(uint8_t code) {
|
|||||||
*/
|
*/
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
|
// Force a new key press if the key is already pressed
|
||||||
|
// without this, keys with the same keycode, but different
|
||||||
|
// modifiers will be reported incorrectly, see issue #1708
|
||||||
|
if (is_key_pressed(keyboard_report, code)) {
|
||||||
|
del_key(code);
|
||||||
|
send_keyboard_report();
|
||||||
|
}
|
||||||
add_key(code);
|
add_key(code);
|
||||||
send_keyboard_report();
|
send_keyboard_report();
|
||||||
}
|
}
|
||||||
|
|||||||
+53
-25
@@ -39,6 +39,9 @@ static uint16_t last_timer = 0;
|
|||||||
|
|
||||||
#ifndef MK_3_SPEED
|
#ifndef MK_3_SPEED
|
||||||
|
|
||||||
|
static uint16_t last_timer_c = 0;
|
||||||
|
static uint16_t last_timer_w = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Mouse keys acceleration algorithm
|
* Mouse keys acceleration algorithm
|
||||||
* http://en.wikipedia.org/wiki/Mouse_keys
|
* http://en.wikipedia.org/wiki/Mouse_keys
|
||||||
@@ -56,6 +59,10 @@ uint8_t mk_time_to_max = MOUSEKEY_TIME_TO_MAX;
|
|||||||
/* ramp used to reach maximum pointer speed (NOT SUPPORTED) */
|
/* ramp used to reach maximum pointer speed (NOT SUPPORTED) */
|
||||||
// int8_t mk_curve = 0;
|
// int8_t mk_curve = 0;
|
||||||
/* wheel params */
|
/* wheel params */
|
||||||
|
/* milliseconds between the initial key press and first repeated motion event (0-2550) */
|
||||||
|
uint8_t mk_wheel_delay = MOUSEKEY_WHEEL_DELAY / 10;
|
||||||
|
/* milliseconds between repeated motion events (0-255) */
|
||||||
|
uint8_t mk_wheel_interval = MOUSEKEY_WHEEL_INTERVAL;
|
||||||
uint8_t mk_wheel_max_speed = MOUSEKEY_WHEEL_MAX_SPEED;
|
uint8_t mk_wheel_max_speed = MOUSEKEY_WHEEL_MAX_SPEED;
|
||||||
uint8_t mk_wheel_time_to_max = MOUSEKEY_WHEEL_TIME_TO_MAX;
|
uint8_t mk_wheel_time_to_max = MOUSEKEY_WHEEL_TIME_TO_MAX;
|
||||||
|
|
||||||
@@ -96,33 +103,54 @@ static uint8_t wheel_unit(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void mousekey_task(void) {
|
void mousekey_task(void) {
|
||||||
if (timer_elapsed(last_timer) < (mousekey_repeat ? mk_interval : mk_delay * 10)) {
|
// report cursor and scroll movement independently
|
||||||
return;
|
report_mouse_t const tmpmr = mouse_report;
|
||||||
}
|
if ((mouse_report.x || mouse_report.y) && timer_elapsed(last_timer_c) > (mousekey_repeat ? mk_interval : mk_delay * 10)) {
|
||||||
if (mouse_report.x == 0 && mouse_report.y == 0 && mouse_report.v == 0 && mouse_report.h == 0) {
|
if (mousekey_repeat != UINT8_MAX) mousekey_repeat++;
|
||||||
return;
|
mouse_report.v = 0;
|
||||||
}
|
mouse_report.h = 0;
|
||||||
if (mousekey_repeat != UINT8_MAX) mousekey_repeat++;
|
if (mouse_report.x > 0) mouse_report.x = move_unit();
|
||||||
if (mouse_report.x > 0) mouse_report.x = move_unit();
|
if (mouse_report.x < 0) mouse_report.x = move_unit() * -1;
|
||||||
if (mouse_report.x < 0) mouse_report.x = move_unit() * -1;
|
if (mouse_report.y > 0) mouse_report.y = move_unit();
|
||||||
if (mouse_report.y > 0) mouse_report.y = move_unit();
|
if (mouse_report.y < 0) mouse_report.y = move_unit() * -1;
|
||||||
if (mouse_report.y < 0) mouse_report.y = move_unit() * -1;
|
/* diagonal move [1/sqrt(2)] */
|
||||||
/* diagonal move [1/sqrt(2)] */
|
if (mouse_report.x && mouse_report.y) {
|
||||||
if (mouse_report.x && mouse_report.y) {
|
mouse_report.x = times_inv_sqrt2(mouse_report.x);
|
||||||
mouse_report.x = times_inv_sqrt2(mouse_report.x);
|
if (mouse_report.x == 0) {
|
||||||
if (mouse_report.x == 0) {
|
mouse_report.x = 1;
|
||||||
mouse_report.x = 1;
|
}
|
||||||
}
|
mouse_report.y = times_inv_sqrt2(mouse_report.y);
|
||||||
mouse_report.y = times_inv_sqrt2(mouse_report.y);
|
if (mouse_report.y == 0) {
|
||||||
if (mouse_report.y == 0) {
|
mouse_report.y = 1;
|
||||||
mouse_report.y = 1;
|
}
|
||||||
}
|
}
|
||||||
|
mousekey_send();
|
||||||
|
last_timer_c = last_timer;
|
||||||
|
mouse_report = tmpmr;
|
||||||
|
}
|
||||||
|
if ((mouse_report.v || mouse_report.h) && timer_elapsed(last_timer_w) > (mousekey_repeat ? mk_wheel_interval : mk_wheel_delay * 10)) {
|
||||||
|
if (mousekey_repeat != UINT8_MAX) mousekey_repeat++;
|
||||||
|
mouse_report.x = 0;
|
||||||
|
mouse_report.y = 0;
|
||||||
|
if (mouse_report.v > 0) mouse_report.v = wheel_unit();
|
||||||
|
if (mouse_report.v < 0) mouse_report.v = wheel_unit() * -1;
|
||||||
|
if (mouse_report.h > 0) mouse_report.h = wheel_unit();
|
||||||
|
if (mouse_report.h < 0) mouse_report.h = wheel_unit() * -1;
|
||||||
|
/* diagonal move [1/sqrt(2)] */
|
||||||
|
if (mouse_report.v && mouse_report.h) {
|
||||||
|
mouse_report.v = times_inv_sqrt2(mouse_report.v);
|
||||||
|
if (mouse_report.v == 0) {
|
||||||
|
mouse_report.v = 1;
|
||||||
|
}
|
||||||
|
mouse_report.h = times_inv_sqrt2(mouse_report.h);
|
||||||
|
if (mouse_report.h == 0) {
|
||||||
|
mouse_report.h = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mousekey_send();
|
||||||
|
last_timer_w = last_timer;
|
||||||
|
mouse_report = tmpmr;
|
||||||
}
|
}
|
||||||
if (mouse_report.v > 0) mouse_report.v = wheel_unit();
|
|
||||||
if (mouse_report.v < 0) mouse_report.v = wheel_unit() * -1;
|
|
||||||
if (mouse_report.h > 0) mouse_report.h = wheel_unit();
|
|
||||||
if (mouse_report.h < 0) mouse_report.h = wheel_unit() * -1;
|
|
||||||
mousekey_send();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void mousekey_on(uint8_t code) {
|
void mousekey_on(uint8_t code) {
|
||||||
|
|||||||
@@ -55,6 +55,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
# ifndef MOUSEKEY_TIME_TO_MAX
|
# ifndef MOUSEKEY_TIME_TO_MAX
|
||||||
# define MOUSEKEY_TIME_TO_MAX 20
|
# define MOUSEKEY_TIME_TO_MAX 20
|
||||||
# endif
|
# endif
|
||||||
|
# ifndef MOUSEKEY_WHEEL_DELAY
|
||||||
|
# define MOUSEKEY_WHEEL_DELAY 300
|
||||||
|
# endif
|
||||||
|
# ifndef MOUSEKEY_WHEEL_INTERVAL
|
||||||
|
# define MOUSEKEY_WHEEL_INTERVAL 100
|
||||||
|
# endif
|
||||||
# ifndef MOUSEKEY_WHEEL_MAX_SPEED
|
# ifndef MOUSEKEY_WHEEL_MAX_SPEED
|
||||||
# define MOUSEKEY_WHEEL_MAX_SPEED 8
|
# define MOUSEKEY_WHEEL_MAX_SPEED 8
|
||||||
# endif
|
# endif
|
||||||
|
|||||||
@@ -68,6 +68,32 @@ uint8_t get_first_key(report_keyboard_t* keyboard_report) {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** \brief Checks if a key is pressed in the report
|
||||||
|
*
|
||||||
|
* Returns true if the keyboard_report reports that the key is pressed, otherwise false
|
||||||
|
* Note: The function doesn't support modifers currently, and it returns false for KC_NO
|
||||||
|
*/
|
||||||
|
bool is_key_pressed(report_keyboard_t* keyboard_report, uint8_t key) {
|
||||||
|
if (key == KC_NO) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
#ifdef NKRO_ENABLE
|
||||||
|
if (keyboard_protocol && keymap_config.nkro) {
|
||||||
|
if ((key >> 3) < KEYBOARD_REPORT_BITS) {
|
||||||
|
return keyboard_report->nkro.bits[key >> 3] & 1 << (key & 7);
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
for (int i = 0; i < KEYBOARD_REPORT_KEYS; i++) {
|
||||||
|
if (keyboard_report->keys[i] == key) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/** \brief add key byte
|
/** \brief add key byte
|
||||||
*
|
*
|
||||||
* FIXME: Needs doc
|
* FIXME: Needs doc
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#define REPORT_H
|
#define REPORT_H
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#include <stdbool.h>
|
||||||
#include "keycode.h"
|
#include "keycode.h"
|
||||||
|
|
||||||
/* report id */
|
/* report id */
|
||||||
@@ -236,6 +237,7 @@ static inline uint16_t KEYCODE2CONSUMER(uint8_t key) {
|
|||||||
|
|
||||||
uint8_t has_anykey(report_keyboard_t* keyboard_report);
|
uint8_t has_anykey(report_keyboard_t* keyboard_report);
|
||||||
uint8_t get_first_key(report_keyboard_t* keyboard_report);
|
uint8_t get_first_key(report_keyboard_t* keyboard_report);
|
||||||
|
bool is_key_pressed(report_keyboard_t* keyboard_report, uint8_t key);
|
||||||
|
|
||||||
void add_key_byte(report_keyboard_t* keyboard_report, uint8_t code);
|
void add_key_byte(report_keyboard_t* keyboard_report, uint8_t code);
|
||||||
void del_key_byte(report_keyboard_t* keyboard_report, uint8_t code);
|
void del_key_byte(report_keyboard_t* keyboard_report, uint8_t code);
|
||||||
|
|||||||
+12
-13
@@ -23,8 +23,6 @@ See: https://docs.qmk.fm/#/feature_userspace
|
|||||||
|K_LOCK | MacOS shortcut to execute lock command Cmd + CTRL + Q |
|
|K_LOCK | MacOS shortcut to execute lock command Cmd + CTRL + Q |
|
||||||
|K_CSCN | MacOS shortcut to copy a portion of the screen to the clipboard |
|
|K_CSCN | MacOS shortcut to copy a portion of the screen to the clipboard |
|
||||||
|K_MDSH | MacOS shortcut to get em-dash `–` |
|
|K_MDSH | MacOS shortcut to get em-dash `–` |
|
||||||
|K_RAPP | MacOS shortcut to switch apps to the right |
|
|
||||||
|K_LAPP | MacOS shortcut to switch apps to the left |
|
|
||||||
|K_CPRF | Cmd + Shift + M. Used for switching Google Chrome profiles |
|
|K_CPRF | Cmd + Shift + M. Used for switching Google Chrome profiles |
|
||||||
|
|
||||||
### [Layers](ninjonas.h)
|
### [Layers](ninjonas.h)
|
||||||
@@ -32,17 +30,12 @@ See: https://docs.qmk.fm/#/feature_userspace
|
|||||||
|---|---|
|
|---|---|
|
||||||
|LT_LOW | Tap for ENTER, hold for RAISE |
|
|LT_LOW | Tap for ENTER, hold for RAISE |
|
||||||
|LT_RAI | Tap for SPACE, hold for LOWER |
|
|LT_RAI | Tap for SPACE, hold for LOWER |
|
||||||
|LT_LOW + LT_RAI | Hold for ADJUST |
|
|
||||||
|LM_LOW | Dedicated key to momentarily toggle to use LOWER layer |
|
|
||||||
|LM_RAI | Dedicated key to momentarily toggle to use RAISE layer |
|
|
||||||
|LG_LOW | Press to toggle LOWER layer |
|
|
||||||
|LG_RAI | Press to toggle RAISE layer |
|
|
||||||
|
|
||||||
### [Mod-Taps](ninjonas.h)
|
### [Mod-Taps](ninjonas.h)
|
||||||
|Code | Description |
|
|Code | Description |
|
||||||
|---|---|
|
|---|---|
|
||||||
|MT_DEL | Tap for Delete, hold for Cmd + ALT + SHIFT |
|
|MT_DEL | Tap for Delete, hold for ALT + SHIFT |
|
||||||
|MT_EQL | Tap for =, hold for ALT + SHIFT |
|
|MT_EQL | Tap for =, SHIFT |
|
||||||
|
|
||||||
### [Layout Blocks](ninjonas.h)
|
### [Layout Blocks](ninjonas.h)
|
||||||
Predefined keyboard layout templates to speed up configuring split keyboards
|
Predefined keyboard layout templates to speed up configuring split keyboards
|
||||||
@@ -72,7 +65,6 @@ Predefined keyboard layout templates to speed up configuring split keyboards
|
|||||||
|M_SHFT | Sends Cmd + alt + shift to a keycode to activate [ShiftIt](https://github.com/fikovnik/ShiftIt) |
|
|M_SHFT | Sends Cmd + alt + shift to a keycode to activate [ShiftIt](https://github.com/fikovnik/ShiftIt) |
|
||||||
|M_CODE | Opens [Visual Studio Code](https://code.visualstudio.com/) on current directory |
|
|M_CODE | Opens [Visual Studio Code](https://code.visualstudio.com/) on current directory |
|
||||||
|M_TERM | Launches Spotlight and calls Terminal |
|
|M_TERM | Launches Spotlight and calls Terminal |
|
||||||
|M_COPA | Single key copy/paste |
|
|
||||||
|M_XXX1 to M_XXX5 | Reserved for secret macros see [Secrets](#secrets) |
|
|M_XXX1 to M_XXX5 | Reserved for secret macros see [Secrets](#secrets) |
|
||||||
|
|
||||||
### [Tap-Dance](tap_dances.h)
|
### [Tap-Dance](tap_dances.h)
|
||||||
@@ -84,11 +76,18 @@ Predefined keyboard layout templates to speed up configuring split keyboards
|
|||||||
|T_TAB | Tap once for TAB, double for CTRL + TAB |
|
|T_TAB | Tap once for TAB, double for CTRL + TAB |
|
||||||
|T_GRV | Tap once for GRV, double for Cmd + GRV |
|
|T_GRV | Tap once for GRV, double for Cmd + GRV |
|
||||||
|T_GUI | Tap once for Cmd, double to open spotlight |
|
|T_GUI | Tap once for Cmd, double to open spotlight |
|
||||||
|T_W | Tap for W, double tap for Cmd + W |
|
|T_CPAP | Tap for Cmd + V, hold for Cmd + C, double tap to open [Line](https://line.me/en/) app, triple tap for itunes. |
|
||||||
|T_Q | Tap for Q, double tap for Cmd + Q |
|
|
||||||
|T_CPNU | Tap for Cmd + V, hold for Cmd + C, double tap for NUMPAD layer |
|
|
||||||
|T_Y | Tap for Y, double tap for NUMPAD layer |
|
|T_Y | Tap for Y, double tap for NUMPAD layer |
|
||||||
|
|
||||||
|
### [Combos](combos.h)
|
||||||
|
|Code | Description |
|
||||||
|
|---|---|
|
||||||
|
|EQ_QUIT | Press E + Q will trigger Cmd + Q |
|
||||||
|
|RW_CLOSE | Press R + W will trigger Cmd + W|
|
||||||
|
|ET_TAB | Press E + T will trigger Cmd + T|
|
||||||
|
|ZC_COPY | Press Z + C will trigger Cmd + C|
|
||||||
|
|XV_PASTE | Press X + V will trigger Cmd + V|
|
||||||
|
|
||||||
### Secrets
|
### Secrets
|
||||||
There's times where you have macros you don't want to share like emails, an address you need but you always forget, passwords 😱, & and private strings. Based off [drashna's secret macros](https://github.com/qmk/qmk_firmware/blob/master/users/drashna/readme_secrets.md), it's now possible to do this. All you need to do is create a `secrets.c` file. Below is an example of how this is used.
|
There's times where you have macros you don't want to share like emails, an address you need but you always forget, passwords 😱, & and private strings. Based off [drashna's secret macros](https://github.com/qmk/qmk_firmware/blob/master/users/drashna/readme_secrets.md), it's now possible to do this. All you need to do is create a `secrets.c` file. Below is an example of how this is used.
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,55 @@
|
|||||||
|
#include "ninjonas.h"
|
||||||
|
|
||||||
|
#ifdef COMBO_ENABLE
|
||||||
|
enum combo_events {
|
||||||
|
EQ_QUIT,
|
||||||
|
RW_CLOSE,
|
||||||
|
QT_TAB,
|
||||||
|
ZC_COPY,
|
||||||
|
XV_PASTE
|
||||||
|
};
|
||||||
|
|
||||||
|
const uint16_t PROGMEM quit_combo[] = {KC_E, KC_Q, COMBO_END};
|
||||||
|
const uint16_t PROGMEM close_combo[] = {KC_R, KC_W, COMBO_END};
|
||||||
|
const uint16_t PROGMEM tab_combo[] = {KC_Q, KC_T, COMBO_END};
|
||||||
|
const uint16_t PROGMEM copy_combo[] = {KC_Z, KC_C, COMBO_END};
|
||||||
|
const uint16_t PROGMEM paste_combo[] = {KC_X, KC_V, COMBO_END};
|
||||||
|
|
||||||
|
combo_t key_combos[COMBO_COUNT] = {
|
||||||
|
[EQ_QUIT] = COMBO_ACTION(quit_combo),
|
||||||
|
[RW_CLOSE] = COMBO_ACTION(close_combo),
|
||||||
|
[QT_TAB] = COMBO_ACTION(tab_combo),
|
||||||
|
[ZC_COPY] = COMBO_ACTION(copy_combo),
|
||||||
|
[XV_PASTE] = COMBO_ACTION(paste_combo),
|
||||||
|
};
|
||||||
|
|
||||||
|
void process_combo_event(uint8_t combo_index, bool pressed) {
|
||||||
|
switch(combo_index) {
|
||||||
|
case EQ_QUIT:
|
||||||
|
if (pressed) {
|
||||||
|
tap_code16(LGUI(KC_Q));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case RW_CLOSE:
|
||||||
|
if (pressed) {
|
||||||
|
tap_code16(LGUI(KC_W));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case QT_TAB:
|
||||||
|
if (pressed) {
|
||||||
|
tap_code16(LGUI(KC_T));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case ZC_COPY:
|
||||||
|
if (pressed) {
|
||||||
|
tap_code16(LGUI(KC_C));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case XV_PASTE:
|
||||||
|
if (pressed) {
|
||||||
|
tap_code16(LGUI(KC_V));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
#ifdef TAPPING_TERM
|
#ifdef TAPPING_TERM
|
||||||
#undef TAPPING_TERM
|
#undef TAPPING_TERM
|
||||||
#define TAPPING_TERM 300
|
#define TAPPING_TERM 200
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Mouse Settings: Smoothing out mouse movement on keypress
|
// Mouse Settings: Smoothing out mouse movement on keypress
|
||||||
@@ -11,4 +11,11 @@
|
|||||||
#define MOUSEKEY_DELAY 0
|
#define MOUSEKEY_DELAY 0
|
||||||
#define MOUSEKEY_TIME_TO_MAX 60
|
#define MOUSEKEY_TIME_TO_MAX 60
|
||||||
#define MOUSEKEY_MAX_SPEED 7
|
#define MOUSEKEY_MAX_SPEED 7
|
||||||
#define MOUSEKEY_WHEEL_DELAY 0
|
#define MOUSEKEY_WHEEL_DELAY 0
|
||||||
|
|
||||||
|
#ifdef COMBO_ENABLE
|
||||||
|
#undef COMBO_COUNT
|
||||||
|
#undef COMBO_TERM
|
||||||
|
#define COMBO_COUNT 5
|
||||||
|
#define COMBO_TERM 60
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,104 @@
|
|||||||
|
/* Copyright 2020 ninjonas
|
||||||
|
*
|
||||||
|
* 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 "ninjonas.h"
|
||||||
|
|
||||||
|
#ifdef ENCODER_ENABLE
|
||||||
|
void left_encoder_cw(void) {
|
||||||
|
switch (get_highest_layer(layer_state)) {
|
||||||
|
case _LOWER:
|
||||||
|
tap_code16(LGUI(KC_TAB));
|
||||||
|
break;
|
||||||
|
case _RAISE:
|
||||||
|
tap_code(KC_PGDN);
|
||||||
|
break;
|
||||||
|
case _ADJUST:
|
||||||
|
rgblight_decrease_hue();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
tap_code(KC_BRID);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
void left_encoder_acw(void) {
|
||||||
|
switch (get_highest_layer(layer_state)) {
|
||||||
|
case _LOWER:
|
||||||
|
tap_code16(SGUI(KC_TAB));
|
||||||
|
break;
|
||||||
|
case _RAISE:
|
||||||
|
tap_code(KC_PGUP);
|
||||||
|
break;
|
||||||
|
case _ADJUST:
|
||||||
|
rgblight_increase_hue();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
tap_code(KC_BRIU);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
void right_encoder_cw(void) {
|
||||||
|
switch (get_highest_layer(layer_state)) {
|
||||||
|
case _LOWER:
|
||||||
|
tap_code(KC_DOWN);
|
||||||
|
break;
|
||||||
|
case _RAISE:
|
||||||
|
tap_code16(LCTL(LSFT(KC_TAB)));
|
||||||
|
break;
|
||||||
|
case _ADJUST:
|
||||||
|
rgblight_decrease_val();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
tap_code(KC_VOLD);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
void right_encoder_acw(void) {
|
||||||
|
switch (get_highest_layer(layer_state)) {
|
||||||
|
case _LOWER:
|
||||||
|
tap_code(KC_UP);
|
||||||
|
break;
|
||||||
|
case _RAISE:
|
||||||
|
tap_code16(LCTL(KC_TAB));
|
||||||
|
break;
|
||||||
|
case _ADJUST:
|
||||||
|
rgblight_increase_val();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
tap_code(KC_VOLU);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void encoder_update_user(uint8_t index, bool clockwise) {
|
||||||
|
encoder_rotated_timer = timer_read();
|
||||||
|
if (index == 0) {
|
||||||
|
left_encoder_rotated = true;
|
||||||
|
if (clockwise) {
|
||||||
|
left_encoder_cw();
|
||||||
|
} else {
|
||||||
|
left_encoder_acw();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (index == 1) {
|
||||||
|
right_encoder_rotated = true;
|
||||||
|
if (clockwise) {
|
||||||
|
right_encoder_cw();
|
||||||
|
} else {
|
||||||
|
right_encoder_acw();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
+11
-12
@@ -27,6 +27,12 @@
|
|||||||
#include "split_util.h"
|
#include "split_util.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef ENCODER_ENABLE
|
||||||
|
bool left_encoder_rotated;
|
||||||
|
bool right_encoder_rotated;
|
||||||
|
uint16_t encoder_rotated_timer;
|
||||||
|
#endif
|
||||||
|
|
||||||
#define _QWERTY 0
|
#define _QWERTY 0
|
||||||
#define _DVORAK 1
|
#define _DVORAK 1
|
||||||
#define _COLEMAK 2
|
#define _COLEMAK 2
|
||||||
@@ -40,24 +46,17 @@
|
|||||||
#define K_CSCN LGUI(LCTL(LSFT(KC_4))) // Copy a portion of the screen to the clipboard
|
#define K_CSCN LGUI(LCTL(LSFT(KC_4))) // Copy a portion of the screen to the clipboard
|
||||||
#define K_CPRF LGUI(LSFT(KC_M)) // Cmd + Shift + M. Used for switching Google Chrome profiles
|
#define K_CPRF LGUI(LSFT(KC_M)) // Cmd + Shift + M. Used for switching Google Chrome profiles
|
||||||
#define K_MDSH LSFT(LALT(KC_MINS))
|
#define K_MDSH LSFT(LALT(KC_MINS))
|
||||||
#define K_LAPP SGUI(KC_TAB) // Cmd + Shift + Tab
|
|
||||||
#define K_RAPP LGUI(KC_TAB) // Cmd + Tab
|
|
||||||
|
|
||||||
// Layer Keys
|
// Layer Keys
|
||||||
#define LM_LOW MO(_LOWER)
|
|
||||||
#define LM_RAI MO(_RAISE)
|
|
||||||
#define LG_LOW TG(_LOWER)
|
|
||||||
#define LG_RAI TG(_RAISE)
|
|
||||||
#define LG_NUM TG(_NUMPAD)
|
|
||||||
#define LT_LOW LT(_LOWER, KC_ENT)
|
#define LT_LOW LT(_LOWER, KC_ENT)
|
||||||
#define LT_RAI LT(_RAISE, KC_SPC)
|
#define LT_RAI LT(_RAISE, KC_SPC)
|
||||||
|
|
||||||
// Mod-Tap Keys
|
// Mod-Tap Keys
|
||||||
#define MT_DEL MT(MOD_LGUI | MOD_LALT | MOD_LSFT, KC_DEL)
|
#define MT_DEL MT(MOD_LALT | MOD_LSFT, KC_DEL)
|
||||||
#define MT_EQL MT(MOD_LALT | MOD_LSFT, KC_EQL)
|
#define MT_EQL MT(MOD_RSFT, KC_EQL)
|
||||||
|
|
||||||
// Layout blocks
|
// Layout blocks
|
||||||
#define _____________________QWERTY_L1______________________ T_TAB, T_Q, KC_W, KC_E, KC_R, KC_T
|
#define _____________________QWERTY_L1______________________ T_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T
|
||||||
#define _____________________QWERTY_L2______________________ T_ESC, KC_A, KC_S, KC_D, KC_F, KC_G
|
#define _____________________QWERTY_L2______________________ T_ESC, KC_A, KC_S, KC_D, KC_F, KC_G
|
||||||
#define _____________________QWERTY_L3______________________ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B
|
#define _____________________QWERTY_L3______________________ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B
|
||||||
|
|
||||||
@@ -130,7 +129,7 @@
|
|||||||
#define __________________________________ _______, _______, _______, _______
|
#define __________________________________ _______, _______, _______, _______
|
||||||
|
|
||||||
#define _____________MOD_LEFT_____________ KC_LALT, T_GUI, KC_LCTL, LT_RAI
|
#define _____________MOD_LEFT_____________ KC_LALT, T_GUI, KC_LCTL, LT_RAI
|
||||||
#define _____________MOD_RIGHT____________ LT_LOW, KC_BSPC, MT_DEL, T_CPNU
|
#define _____________MOD_RIGHT____________ LT_LOW, KC_BSPC, MT_DEL, T_CPAP
|
||||||
|
|
||||||
#define _________MEDIA_1_________ KC_BRIU, KC_MPLY, KC_MUTE
|
#define _________MEDIA_1_________ KC_BRIU, KC_MPLY, KC_MUTE
|
||||||
#define _________MEDIA_2_________ KC_BRID, KC_MFFD, KC__VOLUP
|
#define _________MEDIA_2_________ KC_BRID, KC_MFFD, KC__VOLUP
|
||||||
@@ -141,7 +140,7 @@
|
|||||||
#define ________MOD_RIGHT________ LT_LOW, KC_BSPC, MT_DEL
|
#define ________MOD_RIGHT________ LT_LOW, KC_BSPC, MT_DEL
|
||||||
#else
|
#else
|
||||||
#define ________MOD_LEFT_________ KC_LALT, T_GUI, KC_LCTL
|
#define ________MOD_LEFT_________ KC_LALT, T_GUI, KC_LCTL
|
||||||
#define ________MOD_RIGHT________ KC_BSPC, MT_DEL, T_CPNU
|
#define ________MOD_RIGHT________ KC_BSPC, MT_DEL, T_CPAP
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Layout wrappers
|
// Layout wrappers
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
#include "ninjonas.h"
|
#include "ninjonas.h"
|
||||||
|
|
||||||
uint16_t copy_paste_timer;
|
|
||||||
|
|
||||||
__attribute__((weak))
|
__attribute__((weak))
|
||||||
bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { return true; }
|
bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { return true; }
|
||||||
|
|
||||||
@@ -92,18 +90,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// Single key copy/paste
|
|
||||||
case M_COPA:
|
|
||||||
if (record->event.pressed) {
|
|
||||||
copy_paste_timer = timer_read();
|
|
||||||
} else {
|
|
||||||
if (timer_elapsed(copy_paste_timer) > TAPPING_TERM) {
|
|
||||||
tap_code16(LGUI(KC_C)); // Hold Cmd + C
|
|
||||||
} else {
|
|
||||||
tap_code16(LGUI(KC_V)); // Tap Cmd + V
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// BEGIN: Layer macros
|
// BEGIN: Layer macros
|
||||||
case QWERTY:
|
case QWERTY:
|
||||||
if (record->event.pressed) {
|
if (record->event.pressed) {
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ enum custom_keycodes {
|
|||||||
M_VRSN,
|
M_VRSN,
|
||||||
M_CODE,
|
M_CODE,
|
||||||
M_TERM,
|
M_TERM,
|
||||||
M_COPA,
|
|
||||||
// Secret Macros
|
// Secret Macros
|
||||||
M_XXX1,
|
M_XXX1,
|
||||||
M_XXX2,
|
M_XXX2,
|
||||||
|
|||||||
@@ -2,11 +2,14 @@ BOOTMAGIC_ENABLE = no # Disable Boot Magic (https://beta.docs.qmk.fm/featu
|
|||||||
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
|
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
|
||||||
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
|
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
|
||||||
TAP_DANCE_ENABLE = yes # Enable Tap Dance.
|
TAP_DANCE_ENABLE = yes # Enable Tap Dance.
|
||||||
|
COMBO_ENABLE = yes # Enable Combos
|
||||||
|
|
||||||
SRC += ninjonas.c \
|
SRC += ninjonas.c \
|
||||||
process_records.c \
|
process_records.c \
|
||||||
tap_dances.c \
|
tap_dances.c \
|
||||||
oled.c
|
oled.c \
|
||||||
|
encoder.c \
|
||||||
|
combos.c
|
||||||
|
|
||||||
ifneq ("$(wildcard $(USER_PATH)/secrets.c)","")
|
ifneq ("$(wildcard $(USER_PATH)/secrets.c)","")
|
||||||
SRC += secrets.c
|
SRC += secrets.c
|
||||||
|
|||||||
+40
-26
@@ -2,28 +2,41 @@
|
|||||||
|
|
||||||
//// BEGIN: Advanced Tap Dances
|
//// BEGIN: Advanced Tap Dances
|
||||||
int cur_dance (qk_tap_dance_state_t *state) {
|
int cur_dance (qk_tap_dance_state_t *state) {
|
||||||
if (state->count == 1) {
|
if (state->count == 1) {
|
||||||
if (!state->pressed) {
|
if (state->interrupted || !state->pressed) return SINGLE_TAP;
|
||||||
return SINGLE_TAP;
|
//key has not been interrupted, but they key is still held. Means you want to send a 'HOLD'.
|
||||||
} else {
|
else return SINGLE_HOLD;
|
||||||
return SINGLE_HOLD;
|
|
||||||
}
|
|
||||||
} else if (state->count == 2) {
|
|
||||||
return DOUBLE_TAP;
|
|
||||||
}
|
}
|
||||||
else return 8;
|
else if (state->count == 2) {
|
||||||
|
/*
|
||||||
|
* DOUBLE_SINGLE_TAP is to distinguish between typing "pepper", and actually wanting a double tap
|
||||||
|
* action when hitting 'pp'. Suggested use case for this return value is when you want to send two
|
||||||
|
* keystrokes of the key, and not the 'double tap' action/macro.
|
||||||
|
*/
|
||||||
|
if (state->interrupted) return DOUBLE_SINGLE_TAP;
|
||||||
|
else if (state->pressed) return DOUBLE_HOLD;
|
||||||
|
else return DOUBLE_TAP;
|
||||||
|
}
|
||||||
|
//Assumes no one is trying to type the same letter three times (at least not quickly).
|
||||||
|
//If your tap dance key is 'KC_W', and you want to type "www." quickly - then you will need to add
|
||||||
|
//an exception here to return a 'TRIPLE_SINGLE_TAP', and define that enum just like 'DOUBLE_SINGLE_TAP'
|
||||||
|
if (state->count == 3) {
|
||||||
|
if (state->interrupted || !state->pressed) return TRIPLE_TAP;
|
||||||
|
else return TRIPLE_HOLD;
|
||||||
|
}
|
||||||
|
else return 8; //magic number. At some point this method will expand to work for more presses
|
||||||
}
|
}
|
||||||
|
|
||||||
// BEGIN: Copy, Paste, NUMPAD
|
// BEGIN: Copy, Paste, Apps
|
||||||
// https://beta.docs.qmk.fm/features/feature_tap_dance#example-6-using-tap-dance-for-momentary-layer-switch-and-layer-toggle-keys
|
// https://beta.docs.qmk.fm/features/feature_tap_dance#example-6-using-tap-dance-for-momentary-layer-switch-and-layer-toggle-keys
|
||||||
static tap copy_paste_numpad_tap_state = {
|
static tap copy_paste_app_tap_state = {
|
||||||
.is_press_action = true,
|
.is_press_action = true,
|
||||||
.state = 0
|
.state = 0
|
||||||
};
|
};
|
||||||
|
|
||||||
void copy_paste_numpad_finished (qk_tap_dance_state_t *state, void *user_data) {
|
void copy_paste_app_finished (qk_tap_dance_state_t *state, void *user_data) {
|
||||||
copy_paste_numpad_tap_state.state = cur_dance(state);
|
copy_paste_app_tap_state.state = cur_dance(state);
|
||||||
switch (copy_paste_numpad_tap_state.state) {
|
switch (copy_paste_app_tap_state.state) {
|
||||||
case SINGLE_TAP:
|
case SINGLE_TAP:
|
||||||
tap_code16(LGUI(KC_V)); // Tap Cmd + V
|
tap_code16(LGUI(KC_V)); // Tap Cmd + V
|
||||||
break;
|
break;
|
||||||
@@ -31,19 +44,22 @@ void copy_paste_numpad_finished (qk_tap_dance_state_t *state, void *user_data) {
|
|||||||
tap_code16(LGUI(KC_C)); // Hold Cmd + C
|
tap_code16(LGUI(KC_C)); // Hold Cmd + C
|
||||||
break;
|
break;
|
||||||
case DOUBLE_TAP:
|
case DOUBLE_TAP:
|
||||||
if (layer_state_is(_NUMPAD)) {
|
SEND_STRING(SS_DOWN(X_LGUI) SS_TAP(X_SPACE) SS_UP(X_LGUI));
|
||||||
layer_off(_NUMPAD);
|
wait_ms(250);
|
||||||
} else {
|
SEND_STRING("line\n");
|
||||||
layer_on(_NUMPAD);
|
break;
|
||||||
}
|
case TRIPLE_TAP:
|
||||||
|
SEND_STRING(SS_DOWN(X_LGUI) SS_TAP(X_SPACE) SS_UP(X_LGUI));
|
||||||
|
wait_ms(250);
|
||||||
|
SEND_STRING("itunes\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void copy_paste_numpad_reset (qk_tap_dance_state_t *state, void *user_data) {
|
void copy_paste_app_reset (qk_tap_dance_state_t *state, void *user_data) {
|
||||||
copy_paste_numpad_tap_state.state = 0;
|
copy_paste_app_tap_state.state = 0;
|
||||||
}
|
}
|
||||||
// END: Copy, Paste, NUMPAD
|
// END: Copy, Paste, Apps
|
||||||
|
|
||||||
// BEGIN: Y, NUMPAD
|
// BEGIN: Y, NUMPAD
|
||||||
static tap y_numpad_tap_state = {
|
static tap y_numpad_tap_state = {
|
||||||
@@ -89,10 +105,8 @@ qk_tap_dance_action_t tap_dance_actions[] = {
|
|||||||
[TD_TAB_CTRLTAB] = ACTION_TAP_DANCE_DOUBLE(KC_TAB, LCTL(KC_TAB)),
|
[TD_TAB_CTRLTAB] = ACTION_TAP_DANCE_DOUBLE(KC_TAB, LCTL(KC_TAB)),
|
||||||
[TD_GRV_CTRLGRV] = ACTION_TAP_DANCE_DOUBLE(KC_GRV, LGUI(KC_GRV)),
|
[TD_GRV_CTRLGRV] = ACTION_TAP_DANCE_DOUBLE(KC_GRV, LGUI(KC_GRV)),
|
||||||
[TD_GUI_GUISPC] = ACTION_TAP_DANCE_DOUBLE(KC_LGUI, LGUI(KC_SPC)),
|
[TD_GUI_GUISPC] = ACTION_TAP_DANCE_DOUBLE(KC_LGUI, LGUI(KC_SPC)),
|
||||||
[TD_W_CTRLW] = ACTION_TAP_DANCE_DOUBLE(KC_W, LGUI(KC_W)),
|
|
||||||
[TD_Q_GUIQ] = ACTION_TAP_DANCE_DOUBLE(KC_Q, LGUI(KC_Q)),
|
|
||||||
|
|
||||||
// Advanced Tap Dances
|
// Advanced Tap Dances
|
||||||
[TD_COPY_PASTE_NUMPAD] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, copy_paste_numpad_finished, copy_paste_numpad_reset),
|
[TD_COPY_PASTE_APP] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(NULL, copy_paste_app_finished, copy_paste_app_reset, 300),
|
||||||
[TD_Y_NUMPAD] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, y_numpad_finished, y_numpad_reset),
|
[TD_Y_NUMPAD] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(NULL, y_numpad_finished, y_numpad_reset, 300),
|
||||||
};
|
};
|
||||||
@@ -9,7 +9,11 @@ typedef struct {
|
|||||||
enum tapdance_types{
|
enum tapdance_types{
|
||||||
SINGLE_TAP = 1,
|
SINGLE_TAP = 1,
|
||||||
SINGLE_HOLD = 2,
|
SINGLE_HOLD = 2,
|
||||||
DOUBLE_TAP = 3
|
DOUBLE_TAP = 3,
|
||||||
|
DOUBLE_HOLD = 4,
|
||||||
|
DOUBLE_SINGLE_TAP = 5, //send two single taps
|
||||||
|
TRIPLE_TAP = 6,
|
||||||
|
TRIPLE_HOLD = 7
|
||||||
};
|
};
|
||||||
|
|
||||||
enum custom_tapdances{
|
enum custom_tapdances{
|
||||||
@@ -19,9 +23,7 @@ enum custom_tapdances{
|
|||||||
TD_TAB_CTRLTAB,
|
TD_TAB_CTRLTAB,
|
||||||
TD_GRV_CTRLGRV,
|
TD_GRV_CTRLGRV,
|
||||||
TD_GUI_GUISPC,
|
TD_GUI_GUISPC,
|
||||||
TD_W_CTRLW,
|
TD_COPY_PASTE_APP,
|
||||||
TD_Q_GUIQ,
|
|
||||||
TD_COPY_PASTE_NUMPAD,
|
|
||||||
TD_Y_NUMPAD,
|
TD_Y_NUMPAD,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -31,7 +33,5 @@ enum custom_tapdances{
|
|||||||
#define T_TAB TD(TD_TAB_CTRLTAB) // Tap for TAB, double tap for CTRL + TAB
|
#define T_TAB TD(TD_TAB_CTRLTAB) // Tap for TAB, double tap for CTRL + TAB
|
||||||
#define T_GRV TD(TD_GRV_CTRLGRV) // Tap for GRV, double tap for Cmd + GRV
|
#define T_GRV TD(TD_GRV_CTRLGRV) // Tap for GRV, double tap for Cmd + GRV
|
||||||
#define T_GUI TD(TD_GUI_GUISPC) // Tap for Cmd, double tap for Cmd + Space
|
#define T_GUI TD(TD_GUI_GUISPC) // Tap for Cmd, double tap for Cmd + Space
|
||||||
#define T_W TD(TD_W_CTRLW) // Tap for W, double tap for Cmd + W
|
#define T_CPAP TD(TD_COPY_PASTE_APP) // Tap for paste, hold for copy, double tap for Line App
|
||||||
#define T_Q TD(TD_Q_GUIQ) // Tap for Q, double tap for Cmd + Q
|
|
||||||
#define T_CPNU TD(TD_COPY_PASTE_NUMPAD) // Tap for paste, hold for copy, double tap for NUMPAD
|
|
||||||
#define T_Y TD(TD_Y_NUMPAD) // Tap for Y, double tap for NUMPAD
|
#define T_Y TD(TD_Y_NUMPAD) // Tap for Y, double tap for NUMPAD
|
||||||
Reference in new issue
Block a user