Compare commits
125 Commits
Author | SHA1 | Date | |
---|---|---|---|
53a43dbe99 | |||
db03b76910 | |||
14bdd5ed2a | |||
f45bc9b362 | |||
4a7baaaf50 | |||
dad79cafcd | |||
d08f9cb6e4 | |||
397d404ce0 | |||
9de4ace6f2 | |||
1f13254460 | |||
1d03af876c | |||
8ce9e3255e | |||
1dc1e12fec | |||
6cf9402cbc | |||
76aa2baf3e | |||
423b419138 | |||
4e2817eff1 | |||
31d12662bd | |||
44a348d56f | |||
85f315ad65 | |||
2c3e617fba | |||
088b476343 | |||
4c9372a081 | |||
4930e22dda | |||
0beb945554 | |||
bf0bb1a4db | |||
64459fedbf | |||
47e29754c2 | |||
ec86141a4a | |||
f0f9283d02 | |||
9fbd7eb7a5 | |||
d7dea0e6d9 | |||
533f684887 | |||
d81d216d72 | |||
e5c315f961 | |||
0793abfd19 | |||
52ecc76e28 | |||
4bb0fb2ffc | |||
ec59556cd7 | |||
661e304033 | |||
ae489efee4 | |||
8a778d656d | |||
a7d05820a6 | |||
43757cd985 | |||
0e4374042c | |||
6c55e8cab5 | |||
0e142138aa | |||
d17421d074 | |||
7d156263ab | |||
79bff50247 | |||
ab91e07753 | |||
f2965e1eea | |||
1df10ae3bf | |||
5a127293e7 | |||
7f6bb82b9d | |||
04e28470bc | |||
42add5450d | |||
be227b4317 | |||
98a63d8d6e | |||
914d42acd0 | |||
be2610b6da | |||
aa707c6b9e | |||
370fdb89c2 | |||
f86c0c2643 | |||
7458ac9489 | |||
cfa9f6ba6d | |||
60f5ce8890 | |||
2c1402aa32 | |||
f1003aaccf | |||
54b61b508b | |||
27e216fc1a | |||
ac7b2d92bf | |||
13d67200df | |||
b4f26a4616 | |||
0c3137d8ff | |||
26adf3706a | |||
dad579c8f8 | |||
f13ca59361 | |||
0d61e612f0 | |||
ac27b62fa1 | |||
9c4b6d2100 | |||
d55468c18d | |||
f01133d089 | |||
e58ea882e4 | |||
5368235f22 | |||
404db1d06f | |||
4d1d1b7196 | |||
b1c2849500 | |||
b9c5030851 | |||
d435dabefb | |||
76f0b3cc70 | |||
2d671a7e1a | |||
37cfd2c500 | |||
1741e39e34 | |||
9aecf4ccfd | |||
66b793730e | |||
5c2ac733af | |||
1a33054a35 | |||
9f2e39732f | |||
abcf64ecbd | |||
713ec91147 | |||
1512a6bfd4 | |||
f5ae3760c6 | |||
26f4e7031a | |||
e885c793bc | |||
4318797d19 | |||
da6c58175a | |||
b3f6aa9480 | |||
285ed08867 | |||
45a4a0a7fc | |||
3907ed034b | |||
9d949389f9 | |||
a398d2cece | |||
a6c85f1c23 | |||
a7d46f1b0f | |||
66ef1e3d67 | |||
6734cd9c5c | |||
3875d6f581 | |||
170507896d | |||
92d95ba1e1 | |||
68854f0735 | |||
cd215209ef | |||
4f64951080 | |||
1da2f8d546 | |||
9f8bbe2f3f |
@ -110,8 +110,28 @@ ifneq ("$(wildcard $(KEYBOARD_C_1))","")
|
||||
KEYBOARD_SRC += $(KEYBOARD_C_1)
|
||||
endif
|
||||
|
||||
OPT_DEFS += -DKEYBOARD_$(KEYBOARD_FILESAFE)
|
||||
# Generate KEYBOARD_name_subname for all levels of the keyboard folder
|
||||
KEYBOARD_FILESAFE_1 := $(subst .,,$(subst /,_,$(KEYBOARD_FOLDER_PATH_1)))
|
||||
KEYBOARD_FILESAFE_2 := $(subst .,,$(subst /,_,$(KEYBOARD_FOLDER_PATH_2)))
|
||||
KEYBOARD_FILESAFE_3 := $(subst .,,$(subst /,_,$(KEYBOARD_FOLDER_PATH_3)))
|
||||
KEYBOARD_FILESAFE_4 := $(subst .,,$(subst /,_,$(KEYBOARD_FOLDER_PATH_4)))
|
||||
KEYBOARD_FILESAFE_5 := $(subst .,,$(subst /,_,$(KEYBOARD_FOLDER_PATH_5)))
|
||||
|
||||
ifneq ("$(wildcard $(KEYBOARD_PATH_5)/)","")
|
||||
OPT_DEFS += -DKEYBOARD_$(KEYBOARD_FILESAFE_5)
|
||||
endif
|
||||
ifneq ("$(wildcard $(KEYBOARD_PATH_4)/)","")
|
||||
OPT_DEFS += -DKEYBOARD_$(KEYBOARD_FILESAFE_4)
|
||||
endif
|
||||
ifneq ("$(wildcard $(KEYBOARD_PATH_3)/)","")
|
||||
OPT_DEFS += -DKEYBOARD_$(KEYBOARD_FILESAFE_3)
|
||||
endif
|
||||
ifneq ("$(wildcard $(KEYBOARD_PATH_2)/)","")
|
||||
OPT_DEFS += -DKEYBOARD_$(KEYBOARD_FILESAFE_2)
|
||||
endif
|
||||
ifneq ("$(wildcard $(KEYBOARD_PATH_1)/)","")
|
||||
OPT_DEFS += -DKEYBOARD_$(KEYBOARD_FILESAFE_1)
|
||||
endif
|
||||
|
||||
# Setup the define for QMK_KEYBOARD_H. This is used inside of keymaps so
|
||||
# that the same keymap may be used on multiple keyboards.
|
||||
|
@ -3,6 +3,7 @@
|
||||
* [Building Your First Firmware](newbs_building_firmware.md)
|
||||
* [Flashing Firmware](newbs_flashing.md)
|
||||
* [Testing and Debugging](newbs_testing_debugging.md)
|
||||
* [Learning Resources](newbs_learn_more_resources.md)
|
||||
|
||||
* [QMK Basics](README.md)
|
||||
* [QMK Introduction](getting_started_introduction.md)
|
||||
@ -47,6 +48,7 @@
|
||||
* [Backlight](feature_backlight.md)
|
||||
* [Bluetooth](feature_bluetooth.md)
|
||||
* [Bootmagic](feature_bootmagic.md)
|
||||
* [Combos](feature_combo)
|
||||
* [Command](feature_command.md)
|
||||
* [Dynamic Macros](feature_dynamic_macros.md)
|
||||
* [Grave Escape](feature_grave_esc.md)
|
||||
@ -74,6 +76,7 @@
|
||||
* For Makers and Modders
|
||||
* [Hand Wiring Guide](hand_wire.md)
|
||||
* [ISP Flashing Guide](isp_flashing_guide.md)
|
||||
* [ARM Debugging Guide](arm_debugging.md)
|
||||
|
||||
* For a Deeper Understanding
|
||||
* [How Keyboards Work](how_keyboards_work.md)
|
||||
|
@ -47,6 +47,7 @@
|
||||
* [Backlight](feature_backlight.md)
|
||||
* [Bluetooth](feature_bluetooth.md)
|
||||
* [Bootmagic](feature_bootmagic.md)
|
||||
* [Combos](feature_combo)
|
||||
* [Command](feature_command.md)
|
||||
* [Dynamic Macros](feature_dynamic_macros.md)
|
||||
* [Grave Escape](feature_grave_esc.md)
|
||||
@ -74,6 +75,7 @@
|
||||
* For Makers and Modders
|
||||
* [Hand Wiring Guide](hand_wire.md)
|
||||
* [ISP Flashing Guide](isp_flashing_guide.md)
|
||||
* [ARM Debugging Guide](arm_debugging.md)
|
||||
|
||||
* For a Deeper Understanding
|
||||
* [How Keyboards Work](how_keyboards_work.md)
|
||||
|
87
docs/arm_debugging.md
Normal file
87
docs/arm_debugging.md
Normal file
@ -0,0 +1,87 @@
|
||||
# ARM Debugging usign Eclipse
|
||||
|
||||
This page describes how to setup debugging for ARM MCUs using an SWD adapter and open-source/free tools. In this guide we will install GNU MCU Eclipse IDE for C/C++ Developers and OpenOCD together with all the necessary dependencies.
|
||||
|
||||
This guide is catered towards advance users and assumes you can compile an ARM compatible keyboard on your machine using the MAKE flow.
|
||||
|
||||
## Installing the software
|
||||
|
||||
The main objective here is to get the MCU Eclipse IDE correcly installed on our machine. The necesarry instructions are derived from [this](https://gnu-mcu-eclipse.github.io/install/) install guide.
|
||||
|
||||
### The xPack Manager
|
||||
|
||||
This tool is a software package manager and it is used to help us get the necesarry depencencies.
|
||||
|
||||
XPM runs using Node.js so grab that form [here](https://nodejs.org/en/). After installation, open a terminal and type `npm -v`. A reply with the version number means that the instalation was successful.
|
||||
|
||||
XPM instalation instructions can be found [here](https://www.npmjs.com/package/xpm) and are OS specific. Entering `xpm --version` to your terminal should return the software version.
|
||||
|
||||
### The ARM Toolchain
|
||||
|
||||
Using XPM it is very easy to install the ARM toolchain. Enter the command `xpm install --global @gnu-mcu-eclipse/arm-none-eabi-gcc`.
|
||||
|
||||
### Windows build tools
|
||||
|
||||
If you are using windows you need to install this!
|
||||
|
||||
`xpm install --global @gnu-mcu-eclipse/windows-build-tools`
|
||||
|
||||
### Programer/Debugger Drivers
|
||||
|
||||
Now its the time to install your programer's drivers. This tutorial was made using an ST-Link v2 which you can get from almost anywhere.
|
||||
If you have an ST-Link the drivers can be found [here](https://www.st.com/en/development-tools/stsw-link009.html) otherwise consult the manufuturer of your tool.
|
||||
|
||||
### OpenOCD
|
||||
|
||||
This dependency allows SWD access from GDB and it is essential for debugging. Run `xpm install --global @gnu-mcu-eclipse/openocd`.
|
||||
|
||||
### Java
|
||||
|
||||
Java is needed by Eclipse so please download it from [here](https://www.oracle.com/technetwork/java/javase/downloads/index.html).
|
||||
|
||||
### GNU MCU Eclipse IDE
|
||||
|
||||
Now its finally time to install the IDE. Use the Release page [here](https://github.com/gnu-mcu-eclipse/org.eclipse.epp.packages/releases/) to get the latest version.
|
||||
|
||||
## Configuring Eclipse
|
||||
|
||||
Open up the Eclipse IDE we just downloaded. To import our QMK directory select File -> Import -> C/C++ -> Existing code as Makefile Project. Select next and use Browse to select your QMK folder. In the tool-chain list select ARM Cross GCC and select Finish.
|
||||
|
||||
Now you can see the QMK folder on the left hand side. Right click it and select Properties. On the left hand side, expand MCU and select ARM Toolchain Paths. Press xPack and OK. Repeat for OpenOCD Path and if you are on windows for Build Tool Path. Select Apply and Close.
|
||||
|
||||
Now its time to install the necessary MCU packages. Go to Packs perspective by selecting Window -> Open Perspective -> Others -> Packs. Now select the yellow refresh symbol next to the Packs tab. This will take a long time as it is requesting the MCU definitions from various places. If some of the links fail you can probably select Ignore.
|
||||
|
||||
When this finishes you must find the MCU which we will be building/debugging for. In this example I will be using the STM32F3 series MCUs. On the left, select STMicroelectonics -> STM32F3 Series. On the middle window we can see the pack. Right click and select Install. Once that is done we can go back to the default perspective, Window -> Open Perspective -> Others -> C/C++.
|
||||
|
||||
We need to let eclipse know the device we intent to build QMK on. Right click on the QMK folder -> Properties -> C/C++ Build -> Settings. Select the Devices tab and under devices select the appropriate variant of your MCU. For my example it is STM32F303CC
|
||||
|
||||
While we are here let's setup the build command as well. Select C/C++ Build and then the Behavior tab. On the build command, replace `all` with your necessary make command. For example for a rev6 Planck with the default keymap this would be `planck/rev6:default`. Select Apply and Close.
|
||||
|
||||
## Building
|
||||
|
||||
If you have setup everything correctly pressing the hammer button should build the firmware for you and a .bin file should appear.
|
||||
|
||||
## Debugging
|
||||
|
||||
### Connecting the Debugger
|
||||
|
||||
ARM MCUs use the Single Wire Debug (SWD) protocol which comprises of the clock (SWCLK) signal and the data (SWDIO) signal. Connecting this two wires and ground should be enough to allow full manipulation of the MCU. Here we assume that the keyboard will be powered though USB. The RESET signal is not necessary as we can manually assert it using the reset button. For a more advance setup, the SWO signal can be used which pipes printf and scanf asynchronously to the host but for our setup we will ignore it.
|
||||
|
||||
NOTE: Make sure the SWCLK and SWDIO pins are not used in the matrix of your keyboard. If they are you can temporarily switch them for some other pins.
|
||||
|
||||
### Configuring the Debugger
|
||||
|
||||
Right click on your QMK folder, select Debug As -> Debug Configuration. Here double click on GDB OpenOCD Debugging. Select the debugger tab and enter the configuration necessary for your MCU. This might take some fiddling and googleing to find out. The default script for the STM32F3 is called stm32f3discovery.cfg. To let OpenOCD know, in the Config options enter `-f board/stm32f3discovery.cfg`.
|
||||
|
||||
NOTE: In my case this configuration script requires editing to disable the reset assertion. The locations of the scripts can be found in the actual executable field usually under the path `openocd/version/.content/scripts/board`. Here I edited `reset_config srst_only` to `reset_config none`.
|
||||
|
||||
Select Apply and Close.
|
||||
|
||||
### Running the Debugger.
|
||||
|
||||
Reset your keyboard.
|
||||
|
||||
Press the bug icon and if all goes well you should soon find yourself in the debug perspective. Here the program counter will pause at the beginning of the main function and way for you to press Play. Most of the features of all debuggers work on ARM MCUs but for exact details google is your friend!
|
||||
|
||||
|
||||
Happy debugging!
|
@ -155,6 +155,10 @@ If you define these options you will enable the associated feature, which may in
|
||||
going to produce the 500 keystrokes a second needed to actually get more than a
|
||||
few ms of delay from this. But if you're doing chording on something with 3-4ms
|
||||
scan times? You probably want this.
|
||||
* `#define COMBO_COUNT 2`
|
||||
* Set this to the number of combos that you're using in the [Combo](feature_combo.md) feature.
|
||||
* `#define COMBO_TERM 200`
|
||||
* how long for the Combo keys to be detected. Defaults to `TAPPING_TERM` if not defined.
|
||||
|
||||
## RGB Light Configuration
|
||||
|
||||
@ -234,6 +238,8 @@ Use these to enable or disable building certain features. The more you have enab
|
||||
* Console for debug(+400)
|
||||
* `COMMAND_ENABLE`
|
||||
* Commands for debug and configuration
|
||||
* `COMBO_ENABLE`
|
||||
* Key combo feature
|
||||
* `NKRO_ENABLE`
|
||||
* USB N-Key Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
* `AUDIO_ENABLE`
|
||||
@ -245,7 +251,9 @@ Use these to enable or disable building certain features. The more you have enab
|
||||
* `UNICODE_ENABLE`
|
||||
* Unicode
|
||||
* `BLUETOOTH_ENABLE`
|
||||
* Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
* Legacy option to Enable Bluetooth with the Adafruit EZ-Key HID. See BLUETOOTH
|
||||
* `BLUETOOTH`
|
||||
* Current options are AdafruitEzKey, AdafruitBLE, RN42
|
||||
* `SPLIT_KEYBOARD`
|
||||
* Enables split keyboard support (dual MCU like the let's split and bakingpy's boards) and includes all necessary files located at quantum/split_common
|
||||
* `WAIT_FOR_USB`
|
||||
|
@ -57,14 +57,14 @@ Never made an open source contribution before? Wondering how contributions work
|
||||
Most of our style is pretty easy to pick up on, but right now it's not entirely consistent. You should match the style of the code surrounding your change, but if that code is inconsistent or unclear use the following guidelines:
|
||||
|
||||
* We indent using two spaces (soft tabs)
|
||||
* We use One True Brace Style
|
||||
* We use a modified One True Brace Style
|
||||
* Opening Brace: At the end of the same line as the statement that opens the block
|
||||
* Closing Brace: Lined up with the first character of the statement that opens the block
|
||||
* Else If: Place the closing brace at the beginning of the line and the next opening brace at the end of the same line.
|
||||
* Optional Braces: Always include optional braces.
|
||||
* Good: if (condition) { return false; }
|
||||
* Bad: if (condition) return false;
|
||||
* We use C style comments: `/* */`
|
||||
* We encourage use of C style comments: `/* */`
|
||||
* Think of them as a story describing the feature
|
||||
* Use them liberally to explain why particular decisions were made.
|
||||
* Do not write obvious comments
|
||||
@ -72,6 +72,25 @@ Most of our style is pretty easy to pick up on, but right now it's not entirely
|
||||
* In general we don't wrap lines, they can be as long as needed. If you do choose to wrap lines please do not wrap any wider than 76 columns.
|
||||
* We use `#pragma once` at the start of header files rather than old-style include guards (`#ifndef THIS_FILE_H`, `#define THIS_FILE_H`, ..., `#endif`)
|
||||
|
||||
Here is an example for easy reference:
|
||||
|
||||
```c
|
||||
/* Enums for foo */
|
||||
enum foo_state {
|
||||
FOO_BAR,
|
||||
FOO_BAZ,
|
||||
};
|
||||
|
||||
/* Returns a value */
|
||||
int foo(void) {
|
||||
if (some_condition) {
|
||||
return FOO_BAR;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
# General Guidelines
|
||||
|
||||
We have a few different types of changes in QMK, each requiring a different level of rigor. We'd like you to keep the following guidelines in mind no matter what type of change you're making.
|
||||
|
@ -27,7 +27,7 @@ The first step to creating your own custom keycode(s) is to enumerate them. This
|
||||
|
||||
Here is an example of enumerating 2 keycodes. After adding this block to your `keymap.c` you will be able to use `FOO` and `BAR` inside your keymap.
|
||||
|
||||
```
|
||||
```c
|
||||
enum my_keycodes {
|
||||
FOO = SAFE_RANGE,
|
||||
BAR
|
||||
@ -44,7 +44,7 @@ These function are called every time a key is pressed or released.
|
||||
|
||||
This example does two things. It defines the behavior for a custom keycode called `FOO`, and it supplements our Enter key by playing a tone whenever it is pressed.
|
||||
|
||||
```
|
||||
```c
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
switch (keycode) {
|
||||
case FOO:
|
||||
@ -75,16 +75,16 @@ The `keycode` argument is whatever is defined in your keymap, eg `MO(1)`, `KC_L`
|
||||
|
||||
The `record` argument contains information about the actual press:
|
||||
|
||||
```
|
||||
```c
|
||||
keyrecord_t record {
|
||||
+-keyevent_t event {
|
||||
| +-keypos_t key {
|
||||
| | +-uint8_t col
|
||||
| | +-uint8_t row
|
||||
| | }
|
||||
| +-bool pressed
|
||||
| +-uint16_t time
|
||||
| }
|
||||
keyevent_t event {
|
||||
keypos_t key {
|
||||
uint8_t col
|
||||
uint8_t row
|
||||
}
|
||||
bool pressed
|
||||
uint16_t time
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
@ -100,7 +100,7 @@ This allows you to control the 5 LED's defined as part of the USB Keyboard spec.
|
||||
|
||||
### Example `led_set_user()` Implementation
|
||||
|
||||
```
|
||||
```c
|
||||
void led_set_user(uint8_t usb_led) {
|
||||
if (usb_led & (1<<USB_LED_NUM_LOCK)) {
|
||||
PORTB |= (1<<0);
|
||||
@ -117,12 +117,12 @@ void led_set_user(uint8_t usb_led) {
|
||||
} else {
|
||||
PORTB &= ~(1<<2);
|
||||
}
|
||||
if (usb_led & (1<<USB_LED_COMPOSE_LOCK)) {
|
||||
if (usb_led & (1<<USB_LED_COMPOSE)) {
|
||||
PORTB |= (1<<3);
|
||||
} else {
|
||||
PORTB &= ~(1<<3);
|
||||
}
|
||||
if (usb_led & (1<<USB_LED_KANA_LOCK)) {
|
||||
if (usb_led & (1<<USB_LED_KANA)) {
|
||||
PORTB |= (1<<4);
|
||||
} else {
|
||||
PORTB &= ~(1<<4);
|
||||
@ -138,14 +138,14 @@ void led_set_user(uint8_t usb_led) {
|
||||
|
||||
# Matrix Initialization Code
|
||||
|
||||
Before a keyboard can be used the hardware must be initialized. QMK handles initialization of the keyboard matrix itself, but if you have other hardware like LED's or i²c controllers you will need to set up that hardware before it can be used.
|
||||
Before a keyboard can be used the hardware must be initialized. QMK handles initialization of the keyboard matrix itself, but if you have other hardware like LED's or i²c controllers you will need to set up that hardware before it can be used.
|
||||
|
||||
|
||||
### Example `matrix_init_user()` Implementation
|
||||
|
||||
This example, at the keyboard level, sets up B1, B2, and B3 as LED pins.
|
||||
|
||||
```
|
||||
```c
|
||||
void matrix_init_user(void) {
|
||||
// Call the keymap level matrix init.
|
||||
|
||||
@ -181,16 +181,16 @@ You should use this function if you need custom matrix scanning code. It can als
|
||||
|
||||
# Keyboard Idling/Wake Code
|
||||
|
||||
If the board supports it, it can be "idled", by stopping a number of functions. A good example of this is RGB lights or backlights. This can save on power consumption, or may be better behavior for your keyboard.
|
||||
If the board supports it, it can be "idled", by stopping a number of functions. A good example of this is RGB lights or backlights. This can save on power consumption, or may be better behavior for your keyboard.
|
||||
|
||||
This is controlled by two functions: `suspend_power_down_*` and `suspend_wakeup_init_*`, which are called when the system is board is idled and when it wakes up, respectively.
|
||||
This is controlled by two functions: `suspend_power_down_*` and `suspend_wakeup_init_*`, which are called when the system is board is idled and when it wakes up, respectively.
|
||||
|
||||
|
||||
### Example suspend_power_down_user() and suspend_wakeup_init_user() Implementation
|
||||
|
||||
This example, at the keyboard level, sets up B1, B2, and B3 as LED pins.
|
||||
|
||||
```
|
||||
```c
|
||||
void suspend_power_down_user(void)
|
||||
{
|
||||
rgb_matrix_set_suspend_state(true);
|
||||
@ -210,13 +210,13 @@ void suspend_wakeup_init_user(void)
|
||||
|
||||
# Layer Change Code
|
||||
|
||||
This runs code every time that the layers get changed. This can be useful for layer indication, or custom layer handling.
|
||||
This runs code every time that the layers get changed. This can be useful for layer indication, or custom layer handling.
|
||||
|
||||
### Example `layer_state_set_*` Implementation
|
||||
|
||||
This example shows how to set the [RGB Underglow](feature_rgblight.md) lights based on the layer, using the Planck as an example
|
||||
|
||||
```
|
||||
```c
|
||||
uint32_t layer_state_set_user(uint32_t state) {
|
||||
switch (biton32(state)) {
|
||||
case _RAISE:
|
||||
@ -244,3 +244,143 @@ uint32_t layer_state_set_user(uint32_t state) {
|
||||
* Keymap: `uint32_t layer_state_set_user(uint32_t state)`
|
||||
|
||||
The `state` is the bitmask of the active layers, as explained in the [Keymap Overview](keymap.md#keymap-layer-status)
|
||||
|
||||
|
||||
# Persistent Configuration (EEPROM)
|
||||
|
||||
This allows you to configure persistent settings for your keyboard. These settings are stored in the EEPROM of your controller, and are retained even after power loss. The settings can be read with `eeconfig_read_kb` and `eeconfig_read_user`, and can be written to using `eeconfig_update_kb` and `eeconfig_update_user`. This is useful for features that you want to be able to toggle (like toggling rgb layer indication). Additionally, you can use `eeconfig_init_kb` and `eeconfig_init_user` to set the default values for the EEPROM.
|
||||
|
||||
The complicated part here, is that there are a bunch of ways that you can store and access data via EEPROM, and there is no "correct" way to do this. However, you only have a DWORD (4 bytes) for each function.
|
||||
|
||||
Keep in mind that EEPROM has a limited number of writes. While this is very high, it's not the only thing writing to the EEPROM, and if you write too often, you can potentially drastically shorten the life of your MCU.
|
||||
|
||||
* If you don't understand the example, then you may want to avoid using this feature, as it is rather complicated.
|
||||
|
||||
### Example Implementation
|
||||
|
||||
This is an example of how to add settings, and read and write it. We're using the user keymap for the example here. This is a complex function, and has a lot going on. In fact, it uses a lot of the above functions to work!
|
||||
|
||||
|
||||
In your keymap.c file, add this to the top:
|
||||
```
|
||||
typedef union {
|
||||
uint32_t raw;
|
||||
struct {
|
||||
bool rgb_layer_change :1;
|
||||
};
|
||||
} user_config_t;
|
||||
|
||||
user_config_t user_config;
|
||||
```
|
||||
|
||||
This sets up a 32 bit structure that we can store settings with in memory, and write to the EEPROM. Using this removes the need to define variables, since they're defined in this structure. Remember that `bool` (boolean) values use 1 bit, `uint8_t` uses 8 bits, `uint16_t` uses up 16 bits. You can mix and match, but changing the order can cause issues, as it will change the values that are read and written.
|
||||
|
||||
We're using `rgb_layer_change`, for the `layer_state_set_*` function, and use `matrix_init_user` and `process_record_user` to configure everything.
|
||||
|
||||
Now, using the `matrix_init_user` code above, you want to add `eeconfig_read_user()` to it, to populate the structure you've just created. And you can then immediately use this structure to control functionality in your keymap. And It should look like:
|
||||
```
|
||||
void matrix_init_user(void) {
|
||||
// Call the keymap level matrix init.
|
||||
|
||||
// Read the user config from EEPROM
|
||||
user_config.raw = eeconfig_read_user();
|
||||
|
||||
// Set default layer, if enabled
|
||||
if (user_config.rgb_layer_change) {
|
||||
rgblight_enable_noeeprom();
|
||||
rgblight_sethsv_noeeprom_cyan();
|
||||
rgblight_mode_noeeprom(1);
|
||||
}
|
||||
}
|
||||
```
|
||||
The above function will use the EEPROM config immediately after reading it, to set the default layer's RGB color. The "raw" value of it is converted in a usable structure based on the "union" that you created above.
|
||||
|
||||
```
|
||||
uint32_t layer_state_set_user(uint32_t state) {
|
||||
switch (biton32(state)) {
|
||||
case _RAISE:
|
||||
if (user_config.rgb_layer_change) { rgblight_sethsv_noeeprom_magenta(); rgblight_mode_noeeprom(1); }
|
||||
break;
|
||||
case _LOWER:
|
||||
if (user_config.rgb_layer_change) { rgblight_sethsv_noeeprom_red(); rgblight_mode_noeeprom(1); }
|
||||
break;
|
||||
case _PLOVER:
|
||||
if (user_config.rgb_layer_change) { rgblight_sethsv_noeeprom_green(); rgblight_mode_noeeprom(1); }
|
||||
break;
|
||||
case _ADJUST:
|
||||
if (user_config.rgb_layer_change) { rgblight_sethsv_noeeprom_white(); rgblight_mode_noeeprom(1); }
|
||||
break;
|
||||
default: // for any other layers, or the default layer
|
||||
if (user_config.rgb_layer_change) { rgblight_sethsv_noeeprom_cyan(); rgblight_mode_noeeprom(1); }
|
||||
break;
|
||||
}
|
||||
return state;
|
||||
}
|
||||
```
|
||||
This will cause the RGB underglow to be changed ONLY if the value was enabled. Now to configure this value, create a new keycode for `process_record_user` called `RGB_LYR` and `EPRM`. Additionally, we want to make sure that if you use the normal RGB codes, that it turns off Using the example above, make it look this:
|
||||
```
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
switch (keycode) {
|
||||
case FOO:
|
||||
if (record->event.pressed) {
|
||||
// Do something when pressed
|
||||
} else {
|
||||
// Do something else when release
|
||||
}
|
||||
return false; // Skip all further processing of this key
|
||||
case KC_ENTER:
|
||||
// Play a tone when enter is pressed
|
||||
if (record->event.pressed) {
|
||||
PLAY_NOTE_ARRAY(tone_qwerty);
|
||||
}
|
||||
return true; // Let QMK send the enter press/release events
|
||||
case EPRM:
|
||||
if (record->event.pressed) {
|
||||
eeconfig_init(); // resets the EEPROM to default
|
||||
}
|
||||
return false;
|
||||
case RGB_LYR: // This allows me to use underglow as layer indication, or as normal
|
||||
if (record->event.pressed) {
|
||||
user_config.rgb_layer_change ^= 1; // Toggles the status
|
||||
eeconfig_update_user(user_config.raw); // Writes the new status to EEPROM
|
||||
if (user_config.rgb_layer_change) { // if layer state indication is enabled,
|
||||
layer_state_set(layer_state); // then immediately update the layer color
|
||||
}
|
||||
}
|
||||
return false; break;
|
||||
case RGB_MODE_FORWARD ... RGB_MODE_GRADIENT: // For any of the RGB codes (see quantum_keycodes.h, L400 for reference)
|
||||
if (record->event.pressed) { //This disables layer indication, as it's assumed that if you're changing this ... you want that disabled
|
||||
if (user_config.rgb_layer_change) { // only if this is enabled
|
||||
user_config.rgb_layer_change = false; // disable it, and
|
||||
eeconfig_update_user(user_config.raw); // write the setings to EEPROM
|
||||
}
|
||||
}
|
||||
return true; break;
|
||||
default:
|
||||
return true; // Process all other keycodes normally
|
||||
}
|
||||
}
|
||||
```
|
||||
And lastly, you want to add the `eeconfig_init_user` function, so that when the EEPROM is reset, you can specify default values, and even custom actions. For example, if you want to set rgb layer indication by default, and save the default valued.
|
||||
|
||||
```
|
||||
void eeconfig_init_user(void) { // EEPROM is getting reset!
|
||||
user_config.rgb_layer_change = true; // We want this enabled by default
|
||||
eeconfig_update_user(user_config.raw); // Write default value to EEPROM now
|
||||
|
||||
// use the non noeeprom versions, to write these values to EEPROM too
|
||||
rgblight_enable(); // Enable RGB by default
|
||||
rgblight_sethsv_cyan(); // Set it to CYAN by default
|
||||
rgblight_mode(1); // set to solid by default
|
||||
}
|
||||
```
|
||||
|
||||
And you're done. The RGB layer indication will only work if you want it to. And it will be saved, even after unplugging the board. And if you use any of the RGB codes, it will disable the layer indication, so that it stays on the mode and color that you set it to.
|
||||
|
||||
### 'EECONFIG' Function Documentation
|
||||
|
||||
* Keyboard/Revision: `void eeconfig_init_kb(void)`, `uint32_t eeconfig_read_kb(void)` and `void eeconfig_update_kb(uint32_t val)`
|
||||
* Keymap: `void eeconfig_init_user(void)`, `uint32_t eeconfig_read_user(void)` and `void eeconfig_update_user(uint32_t val)`
|
||||
|
||||
The `val` is the value of the data that you want to write to EEPROM. And the `eeconfig_read_*` function return a 32 bit (DWORD) value from the EEPROM.
|
||||
|
@ -26,7 +26,8 @@ These functions allow you to activate layers in various ways. Note that layers a
|
||||
* `DF(layer)` - switches the default layer. The default layer is the always-active base layer that other layers stack on top of. See below for more about the default layer. This might be used to switch from QWERTY to Dvorak layout. (Note that this is a temporary switch that only persists until the keyboard loses power. To modify the default layer in a persistent way requires deeper customization, such as calling the `set_single_persistent_default_layer` function inside of [process_record_user](custom_quantum_functions.md#programming-the-behavior-of-any-keycode).)
|
||||
* `MO(layer)` - momentarily activates *layer*. As soon as you let go of the key, the layer is deactivated.
|
||||
* `LM(layer, mod)` - Momentarily activates *layer* (like `MO`), but with modifier(s) *mod* active. Only supports layers 0-15 and the left modifiers.
|
||||
* `LT(layer, kc)` - momentarily activates *layer* when held, and sends *kc* when tapped.
|
||||
* `LT(layer, kc)` - momentarily activates *layer* when held, and sends *kc* when tapped. Only supports layers 0-15.
|
||||
* `OSL(layer)` - momentarily activates *layer* until the next key is pressed. See [One Shot Keys](#one-shot-keys) for details and additional functionality.
|
||||
* `TG(layer)` - toggles *layer*, activating it if it's inactive and vice versa
|
||||
* `TO(layer)` - activates *layer* and de-activates all other layers (except your default layer). This function is special, because instead of just adding/removing one layer to your active layer stack, it will completely replace your current active layers, uniquely allowing you to replace higher layers with a lower one. This is activated on keydown (as soon as the key is pressed).
|
||||
* `TT(layer)` - Layer Tap-Toggle. If you hold the key down, *layer* is activated, and then is de-activated when you let go (like `MO`). If you repeatedly tap it, the layer will be toggled on or off (like `TG`). It needs 5 taps by default, but you can change this by defining `TAPPING_TOGGLE` -- for example, `#define TAPPING_TOGGLE 2` to toggle on just two taps.
|
||||
|
@ -1,10 +1,40 @@
|
||||
# Bluetooth
|
||||
|
||||
## Bluetooth Functionality
|
||||
## Bluetooth Known Supported Hardware
|
||||
|
||||
Currently Bluetooth support is limited to AVR based chips. For Bluetooth 2.1 Qmk has support for RN-42 HID Firmware and Bluefruit EZ Key the later of which is not produced anymore. For more recent BLE protocols currently only the Adafruit Bluefruit SPI friend is directly supported. BLE is needed to connect to iOS devices. Note iOS does not support Mouse Input.
|
||||
|
||||
|Board |Bluetooth Protocol |Connection Type |Rules.mk |Bluetooth Chip|
|
||||
|----------------------------------------------------------------|----------------------------|----------------|---------------------------|--------------|
|
||||
|[Adafruit EzKey HID]("https://www.adafruit.com/product/1535") |Bluetooth Classic | UART | BLUETOOTH = AdafruitEZKey | |
|
||||
|Rover Networks RN-42 (Sparkfun Bluesmirf) |Bluetooth Classic | UART | BLUETOOTH = RN42 | RN-42 |
|
||||
|[Bluefruit LE SPI Friend](https://www.adafruit.com/product/2633)|Bluetooth Low Energy | SPI | BLUETOOTH = AdafruitBLE | nRF5182 |
|
||||
|
||||
Not Supported Yet but possible:
|
||||
* [Bluefruit LE UART Friend](https://www.adafruit.com/product/2479). [Possible tmk implementation found in](https://github.com/tmk/tmk_keyboard/issues/514)
|
||||
* HC-05 boards flashed with RN-42 firmware. They apparently both use the CSR BC417 Chip. Flashing it with RN-42 firmware gives it HID capability.
|
||||
* [Sparkfun Bluetooth mate](https://www.sparkfun.com/products/14839)
|
||||
* HM-13 based boards
|
||||
|
||||
### Adafruit BLE SPI Friend
|
||||
Currently The only bluetooth chipset supported by QMK is the Adafruit Bluefruit SPI Friend. It's a Nordic nRF5182 based chip running Adafruit's custom firmware. Data is transmitted via Adafruit's SDEP over Hardware SPI. The [Feather 32u4 Bluefruit LE](https://www.adafruit.com/product/2829) is supported as it's an AVR mcu connected via SPI to the Nordic BLE chip with Adafruit firmware. If Building a custom board with the SPI friend it would be easiest to just use the pin selection that the 32u4 feather uses but you can change the pins in the config.h options with the following defines:
|
||||
* #define AdafruitBleResetPin D4
|
||||
* #define AdafruitBleCSPin B4
|
||||
* #define AdafruitBleIRQPin E6
|
||||
|
||||
A Bluefruit UART friend can be converted to an SPI friend, however this [requires](https://github.com/qmk/qmk_firmware/issues/2274) some reflashing and soldering directly to the MDBT40 chip.
|
||||
|
||||
## Adafruit EZ-Key hid
|
||||
This requires [some hardware changes](https://www.reddit.com/r/MechanicalKeyboards/comments/3psx0q/the_planck_keyboard_with_bluetooth_guide_and/?ref=search_posts), but can be enabled via the Makefile. The firmware will still output characters via USB, so be aware of this when charging via a computer. It would make sense to have a switch on the Bluefruit to turn it off at will.
|
||||
|
||||
|
||||
<!-- FIXME: Document bluetooth support more completely. -->
|
||||
## Bluetooth Rules.mk Options
|
||||
Use only one of these
|
||||
* BLUETOOTH_ENABLE = yes (Legacy Option)
|
||||
* BLUETOOTH = RN42
|
||||
* BLUETOOTH = AdafruitEZKey
|
||||
* BLUETOOTH = AdafruitBLE
|
||||
|
||||
## Bluetooth Keycodes
|
||||
|
||||
|
88
docs/feature_combo.md
Normal file
88
docs/feature_combo.md
Normal file
@ -0,0 +1,88 @@
|
||||
# Combos
|
||||
|
||||
The Combo feature is a chording type solution for adding custom actions. It lets you hit multiple keys at once and produce a different effect. For instance, hitting `A` and `S` within the tapping term would hit `ESC` instead, or have it perform even more complex tasks.
|
||||
|
||||
To enable this feature, yu need to add `COMBO_ENABLE = yes` to your `rules.mk`.
|
||||
|
||||
Additionally, in your `config.h`, you'll need to specify the number of combos that you'll be using, by adding `#define COMBO_COUNT 1` (replacing 1 with the number that you're using).
|
||||
<!-- At this time, this is necessary -->
|
||||
|
||||
Also, by default, the tapping term for the Combos is set to the same value as `TAPPING_TERM` (200 by default on most boards). But you can specify a different value by defining it in your `config.h`. For instance: `#define COMBO_TERM 300` would set the time out period for combos to 300ms.
|
||||
|
||||
Then, your `keymap.c` file, you'll need to define a sequence of keys, terminated with `COMBO_END`, and a structure to list the combination of keys, and it's resulting action.
|
||||
|
||||
```c
|
||||
const uint16_t PROGMEM test_combo[] = {KC_A, KC_B, COMBO_END};
|
||||
combo_t key_combos[COMBO_COUNT] = {COMBO(test_combo, KC_ESC)};
|
||||
```
|
||||
|
||||
This will send "Escape" if you hit the A and B keys.
|
||||
|
||||
!> This method only supports [basic keycodes](keycodes_basic.md). See the examples for more control.
|
||||
|
||||
## Examples
|
||||
|
||||
If you want to add a list, then you'd use something like this:
|
||||
|
||||
```c
|
||||
enum combos {
|
||||
AB_ESC,
|
||||
JK_TAB
|
||||
}
|
||||
const uint16_t PROGMEM ab_combo[] = {KC_A, KC_B, COMBO_END};
|
||||
const uint16_t PROGMEM jk_combo[] = {KC_J, KC_K, COMBO_END};
|
||||
|
||||
combo_t key_combos[COMBO_COUNT] = {
|
||||
[AB_ESC] = COMBO(ab_combo, KC_ESC),
|
||||
[JK_TAB] = COMBO(jk_combo, KC_TAB)
|
||||
};
|
||||
```
|
||||
|
||||
For a more complicated implementation, you can use the `process_combo_event` function to add custom handling.
|
||||
|
||||
```c
|
||||
enum combo_events {
|
||||
ZC_COPY,
|
||||
ZV_PASTE
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM copy_combo[] = {KC_Z, KC_C, COMBO_END};
|
||||
const uint16_t PROGMEM paste_combo[] = {KC_Z, KC_V, COMBO_END};
|
||||
|
||||
combo_t key_combos[COMBO_COUNT] = {
|
||||
[ZC_COPY] = COMBO_ACTION(copy_combo),
|
||||
[ZV_PASTE] = COMBO_ACTION(paste_combo),
|
||||
};
|
||||
|
||||
void process_combo_event(uint8_t combo_index, bool pressed) {
|
||||
switch(combo_index) {
|
||||
case ZC_COPY:
|
||||
if (pressed) {
|
||||
register_code(KC_LCTL);
|
||||
register_code(KC_C);
|
||||
unregister_code(KC_C);
|
||||
unregister_code(KC_LCTL);
|
||||
}
|
||||
break;
|
||||
|
||||
case ZV_PASTE:
|
||||
if (pressed) {
|
||||
register_code(KC_LCTL);
|
||||
register_code(KC_V);
|
||||
unregister_code(KC_V);
|
||||
unregister_code(KC_LCTL);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
This will send Ctrl+C if you hit Z and C, and Ctrl+V if you hit Z and V. But you could change this to do stuff like change layers, play sounds, or change settings.
|
||||
|
||||
## Additional Configuration
|
||||
|
||||
If you're using long combos, or even longer combos, you may run into issues with this, as the structure may not be large enough to accommodate what you're doing.
|
||||
|
||||
In this case, you can add either `#define EXTRA_LONG_COMBOS` or `#define EXTRA_EXTRA_LONG_COMBOS` in your `config.h` file.
|
||||
|
||||
You may also be able to enable action keys by defining `COMBO_ALLOW_ACTION_KEYS`.
|
@ -228,6 +228,10 @@ This sends the `<kc>` keydown event to the computer. Some examples would be `KC_
|
||||
|
||||
Parallel to `register_code` function, this sends the `<kc>` keyup event to the computer. If you don't use this, the key will be held down until it's sent.
|
||||
|
||||
### `tap_code(<kc>);`
|
||||
|
||||
This will send `register_code(<kc>)` and then `unregister_code(<kc>)`. This is useful if you want to send both the press and release events ("tap" the key, rather than hold it).
|
||||
|
||||
### `clear_keyboard();`
|
||||
|
||||
This will clear all mods and keys currently pressed.
|
||||
|
@ -140,6 +140,7 @@ These are the effects that are currently available:
|
||||
RGB_MATRIX_RAINBOW_PINWHEELS,
|
||||
RGB_MATRIX_RAINBOW_MOVING_CHEVRON,
|
||||
RGB_MATRIX_JELLYBEAN_RAINDROPS,
|
||||
RGB_MATRIX_DIGITAL_RAIN,
|
||||
#ifdef RGB_MATRIX_KEYPRESSES
|
||||
RGB_MATRIX_SOLID_REACTIVE,
|
||||
RGB_MATRIX_SPLASH,
|
||||
|
@ -96,9 +96,10 @@ if `RGBLIGHT_EFFECT_xxxx` or `RGBLIGHT_ANIMATIONS` is defined, you also have a n
|
||||
|`RGBLIGHT_MODE_RGB_TEST` | *None* |RGB Test |
|
||||
|`RGBLIGHT_MODE_ALTERNATING` | *None* |Alternating |
|
||||
|
||||
|
||||
Check out [this video](https://youtube.com/watch?v=VKrpPAHlisY) for a demonstration.
|
||||
|
||||
Note: For versions older than 0.6.117, The mode numbers were written directly. In `quantum/rgblight.h` there is a contrast table between the old mode number and the current symbol.
|
||||
|
||||
The following options can be used to tweak the various animations:
|
||||
|
||||
|Define |Default |Description |
|
||||
|
@ -4,40 +4,108 @@ There are three Unicode keymap definition method available in QMK:
|
||||
|
||||
## UNICODE_ENABLE
|
||||
|
||||
Supports Unicode input up to 0xFFFF. The keycode function is `UC(n)` in
|
||||
keymap file, where *n* is a 4 digit hexadecimal.
|
||||
Supports Unicode input up to 0xFFFF. The keycode function is `UC(n)` in keymap file, where *n* is a 4 digit hexadecimal.
|
||||
|
||||
## UNICODEMAP_ENABLE
|
||||
|
||||
Supports Unicode up to 0xFFFFFFFF. You need to maintain a separate mapping
|
||||
table `const uint32_t PROGMEM unicode_map[] = {...}` in your keymap file.
|
||||
The keycode function is `X(n)` where *n* is the array index of the mapping
|
||||
table.
|
||||
Supports Unicode up to 0xFFFFFFFF. You need to maintain a separate mapping table `const uint32_t PROGMEM unicode_map[] = {...}` in your keymap file. The keycode function is `X(n)` where *n* is the array index of the mapping table.
|
||||
|
||||
And you may want to have an enum to make reference easier. So you'd want to add something like this to your keymap:
|
||||
|
||||
```c
|
||||
enum unicode_name {
|
||||
BANG, // ‽
|
||||
IRONY, // ⸮
|
||||
SNEK // snke 🐍
|
||||
};
|
||||
|
||||
const uint32_t PROGMEM unicode_map[] = {
|
||||
[BANG] = 0x0203D, // ‽
|
||||
[IRONY] = 0x02E2E, // ⸮
|
||||
[SNEK] = 0x1F40D // snke 🐍
|
||||
}:
|
||||
```
|
||||
|
||||
Make sure that the order for both matches.
|
||||
|
||||
## UCIS_ENABLE
|
||||
|
||||
TBD
|
||||
Supports Unicode up to 0xFFFFFFFF. As with `UNICODE_MAP`, you may want to main a mapping table in your keymap file. However, there is no keycodes for this feature, you will have to add a keycode or function to call `qk_ucis_start()`. Once you've run that, you can just type the text for your unicode, and then hit space or enter to complete it, or ESC to cancel it. And if it matches an entry in your table, it will automatically "backspace" the trigger word (from your table) and then will input the unicode sequence.
|
||||
|
||||
Unicode input in QMK works by inputing a sequence of characters to the OS,
|
||||
sort of like macro. Unfortunately, each OS has different ideas on how Unicode is inputted.
|
||||
For instance, you would need to have a table like this in your keymap:
|
||||
|
||||
```c
|
||||
const qk_ucis_symbol_t ucis_symbol_table[] = UCIS_TABLE
|
||||
(
|
||||
UCIS_SYM("poop", 0x1f4a9),
|
||||
UCIS_SYM("rofl", 0x1f923),
|
||||
UCIS_SYM("kiss", 0x1f619)
|
||||
);
|
||||
```
|
||||
|
||||
You run the function, and then type "rofl" and hit enter, it should backspace remove "rofl" and input the `0x1f923` unicode.
|
||||
|
||||
### Customization
|
||||
|
||||
There are several functions that you can add to your keymap to customize the functionality of this feature.
|
||||
|
||||
* `void qk_ucis_start_user(void)` - This runs when you run the "start" function, and can be used to provide feedback. By default, it types out a keyboard emoji.
|
||||
* `void qk_ucis_success(uint8_t symbol_index)` - This runs when the unicode input has matched something, and has completed. Default doesn't do anything.
|
||||
* `void qk_ucis_symbol_fallback (void)` - This runs if the input text doesn't match anything. The default function falls back to trying that input as a unicode code.
|
||||
|
||||
The default code for these are:
|
||||
|
||||
```c
|
||||
void qk_ucis_start_user(void) { // outputs keyboard emoji
|
||||
unicode_input_start();
|
||||
register_hex(0x2328);
|
||||
unicode_input_finish();
|
||||
}
|
||||
|
||||
void qk_ucis_success(uint8_t symbol_index) {
|
||||
}
|
||||
|
||||
void qk_ucis_symbol_fallback (void) { // falls back to manual unicode entry
|
||||
for (uint8_t i = 0; i < qk_ucis_state.count - 1; i++) {
|
||||
uint8_t code = qk_ucis_state.codes[i];
|
||||
register_code(code);
|
||||
unregister_code(code);
|
||||
wait_ms(UNICODE_TYPE_DELAY);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Unicode Input methods
|
||||
|
||||
Unicode input in QMK works by inputting a sequence of characters to the OS,
|
||||
sort of like macro. Unfortunately, each OS has different ideas on how Unicode is input.
|
||||
|
||||
This is the current list of Unicode input method in QMK:
|
||||
|
||||
* UC_OSX: MacOS Unicode Hex Input support. Works only up to 0xFFFF. Disabled by default. To enable: go to System Preferences -> Keyboard -> Input Sources, and enable Unicode Hex.
|
||||
* UC_OSX_RALT: Same as UC_OSX, but sends the Right Alt key for unicode input
|
||||
* UC_LNX: Unicode input method under Linux. Works up to 0xFFFFF. Should work almost anywhere on ibus enabled distros. Without ibus, this works under GTK apps, but rarely anywhere else.
|
||||
* UC_WIN: (not recommended) Windows built-in Unicode input. To enable: create registry key under `HKEY_CURRENT_USER\Control Panel\Input Method\EnableHexNumpad` of type `REG_SZ` called `EnableHexNumpad`, set its value to 1, and reboot. This method is not recommended because of reliability and compatibility issue, use WinCompose method below instead.
|
||||
* UC_WINC: Windows Unicode input using WinCompose. Requires [WinCompose](https://github.com/samhocevar/wincompose). Works reliably under many (all?) variations of Windows.
|
||||
* __UC_OSX__: MacOS Unicode Hex Input support. Works only up to 0xFFFF. Disabled by default. To enable: go to System Preferences -> Keyboard -> Input Sources, and enable Unicode Hex.
|
||||
* __UC_OSX_RALT__: Same as UC_OSX, but sends the Right Alt key for unicode input
|
||||
* __UC_LNX__: Unicode input method under Linux. Works up to 0xFFFFF. Should work almost anywhere on ibus enabled distros. Without ibus, this works under GTK apps, but rarely anywhere else.
|
||||
* __UC_WIN__: (not recommended) Windows built-in Unicode input. To enable: create registry key under `HKEY_CURRENT_USER\Control Panel\Input Method\EnableHexNumpad` of type `REG_SZ` called `EnableHexNumpad`, set its value to 1, and reboot. This method is not recommended because of reliability and compatibility issue, use WinCompose method below instead.
|
||||
* __UC_WINC__: Windows Unicode input using WinCompose. Requires [WinCompose](https://github.com/samhocevar/wincompose). Works reliably under many (all?) variations of Windows.
|
||||
|
||||
# Additional Language Support
|
||||
At some point, you need to call `set_unicode_input_mode(x)` to set the correct unicode method. This sets the method that is used to send the unicode, and stores it in EEPROM, so you only need to call this once.
|
||||
|
||||
## `send_unicode_hex_string`
|
||||
|
||||
To type multiple characters for things like (ノಠ痊ಠ)ノ彡┻━┻, you can use `send_unicode_hex_string()` much like `SEND_STRING()` except you would use hex values separate by spaces.
|
||||
For example, the table flip seen above would be `send_unicode_hex_string("0028 30CE 0CA0 75CA 0CA0 0029 30CE 5F61 253B 2501 253B")`
|
||||
|
||||
There are many ways to get a hex code, but an easy one is [this site](https://r12a.github.io/app-conversion/). Just make sure to convert to hexadecimal, and that is your string.
|
||||
|
||||
## Additional Language Support
|
||||
|
||||
In `quantum/keymap_extras/`, you'll see various language files - these work the same way as the alternative layout ones do. Most are defined by their two letter country/language code followed by an underscore and a 4-letter abbreviation of its name. `FR_UGRV` which will result in a `ù` when using a software-implemented AZERTY layout. It's currently difficult to send such characters in just the firmware.
|
||||
|
||||
# International Characters on Windows
|
||||
## International Characters on Windows
|
||||
|
||||
[AutoHotkey](https://autohotkey.com) allows Windows users to create custom hotkeys among others.
|
||||
### AutoHotkey allows Windows users to create custom hotkeys among others.
|
||||
|
||||
The method does not require Unicode support in the keyboard itself but depends instead of AutoHotkey running in the background.
|
||||
The method does not require Unicode support in the keyboard itself but depends instead of [AutoHotkey](https://autohotkey.com) running in the background.
|
||||
|
||||
First you need to select a modifier combination that is not in use by any of your programs.
|
||||
CtrlAltWin is not used very widely and should therefore be perfect for this.
|
||||
@ -52,3 +120,11 @@ In the default script of AutoHotkey you can define custom hotkeys.
|
||||
|
||||
The hotkeys above are for the combination CtrlAltGui and CtrlAltGuiShift plus the letter a.
|
||||
AutoHotkey inserts the Text right of `Send, ` when this combination is pressed.
|
||||
|
||||
### US International
|
||||
|
||||
If you enable the US International layout on the system, it will use punctuation to accent the characters.
|
||||
|
||||
For instance, typing "`a" will result in à.
|
||||
|
||||
You can find details on how to enable this [here](https://support.microsoft.com/en-us/help/17424/windows-change-keyboard-layout).
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
There are quite a few different types of bootloaders that keyboards use, and just about all of the use a different flashing method. Luckily, projects like the [QMK Toolbox](https://github.com/qmk/qmk_toolbox/releases) aim to be compatible with all the different types without having to think about it much, but this article will describe the different types of bootloaders, and available methods for flashing them.
|
||||
|
||||
If you have a bootloader selected with the `BOOTLOADER` variable in your `rules.mk`, QMK will automatically calculate if your .hex file is the right size to be flashed to the device, and output the total size it bytes (along with the max). To run this process manually, compile with the target `check-size`, eg `make planck/rev4:default:check-size`.
|
||||
If you have a bootloader selected with the `BOOTLOADER` variable in your `rules.mk`, QMK will automatically calculate if your .hex file is the right size to be flashed to the device, and output the total size in bytes (along with the max). To run this process manually, compile with the target `check-size`, eg `make planck/rev4:default:check-size`.
|
||||
|
||||
## DFU
|
||||
|
||||
|
@ -8,7 +8,7 @@ Start on the [QMK Github page](https://github.com/qmk/qmk_firmware), and you'll
|
||||
|
||||

|
||||
|
||||
If you're apart 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:
|
||||
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:
|
||||
|
||||

|
||||
|
||||
|
@ -8,7 +8,7 @@ If you have not yet you should read the [Keyboard Guidelines](hardware_keyboard_
|
||||
|
||||
QMK has a number of features to simplify working with AVR keyboards. For most keyboards you don't have to write a single line of code. To get started run the `util/new_project.sh` script:
|
||||
|
||||
```
|
||||
```bash
|
||||
$ util/new_project.sh my_awesome_keyboard
|
||||
######################################################
|
||||
# /keyboards/my_awesome_keyboard project created. To start
|
||||
@ -30,7 +30,7 @@ This is where all the custom logic for your keyboard goes. Many keyboards do not
|
||||
|
||||
This is the file you define your [Layout Macro(s)](feature_layouts.md) in. At minimum you should have a `#define LAYOUT` for your keyboard that looks something like this:
|
||||
|
||||
```
|
||||
```c
|
||||
#define LAYOUT( \
|
||||
k00, k01, k02, \
|
||||
k10, k11 \
|
||||
@ -57,7 +57,7 @@ At the top of the `config.h` you'll find USB related settings. These control how
|
||||
|
||||
Do change the `MANUFACTURER`, `PRODUCT`, and `DESCRIPTION` lines to accurately reflect your keyboard.
|
||||
|
||||
```
|
||||
```c
|
||||
#define VENDOR_ID 0xFEED
|
||||
#define PRODUCT_ID 0x6060
|
||||
#define DEVICE_VER 0x0001
|
||||
@ -72,14 +72,14 @@ Do change the `MANUFACTURER`, `PRODUCT`, and `DESCRIPTION` lines to accurately r
|
||||
|
||||
The next section of the `config.h` file deals with your keyboard's matrix. The first thing you should set is the matrix's size. This is usually, but not always, the same number of rows and columns as the physical key arrangement.
|
||||
|
||||
```
|
||||
```c
|
||||
#define MATRIX_ROWS 2
|
||||
#define MATRIX_COLS 3
|
||||
```
|
||||
|
||||
Once you've defined the size of your matrix you need to define which pins on your MCU are connected to rows and columns. To do so simply specify the names of those pins:
|
||||
|
||||
```
|
||||
```c
|
||||
#define MATRIX_ROW_PINS { D0, D5 }
|
||||
#define MATRIX_COL_PINS { F1, F0, B0 }
|
||||
#define UNUSED_PINS
|
||||
@ -89,7 +89,7 @@ The number of `MATRIX_ROW_PINS` entries must be the same as the number you assig
|
||||
|
||||
Finally, you can specify the direction your diodes point. This can be `COL2ROW`, `ROW2COL`, or `CUSTOM_MATRIX`.
|
||||
|
||||
```
|
||||
```c
|
||||
#define DIODE_DIRECTION COL2ROW
|
||||
```
|
||||
|
||||
@ -97,16 +97,14 @@ Finally, you can specify the direction your diodes point. This can be `COL2ROW`,
|
||||
|
||||
By default QMK supports backlighting on pins `B5`, `B6`, and `B7`. If you are using one of those you can simply enable it here. For more details see the [Backlight Documentation](feature_backlight.md).
|
||||
|
||||
```
|
||||
```c
|
||||
#define BACKLIGHT_PIN B7
|
||||
#define BACKLIGHT_LEVELS 3
|
||||
#define BACKLIGHT_BREATHING
|
||||
#define BREATHING_PERIOD 6
|
||||
```
|
||||
|
||||
{% hint style='info' %}
|
||||
You can use backlighting on any pin you like, but you will have to do more work to support that. See the [Backlight Documentation](feature_backlight.md) for more details.
|
||||
{% endhint %}
|
||||
?> You can use backlighting on any pin you like, but you will have to do more work to support that. See the [Backlight Documentation](feature_backlight.md) for more details.
|
||||
|
||||
### Other Configuration Options
|
||||
|
||||
@ -120,7 +118,7 @@ You use the `rules.mk` file to tell QMK what files to build and what features to
|
||||
|
||||
These options tell the build system what CPU to build for. Be very careful if you change any of these settings, you can render your keyboard inoperable.
|
||||
|
||||
```
|
||||
```make
|
||||
MCU = atmega32u4
|
||||
F_CPU = 16000000
|
||||
ARCH = AVR8
|
||||
@ -128,26 +126,26 @@ F_USB = $(F_CPU)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
```
|
||||
|
||||
### Bootloader Size
|
||||
### Bootloaders
|
||||
|
||||
The bootloader is a special section of your MCU that allows you to upgrade the code stored on the MCU. Think of it like a Rescue Partition for your keyboard. If you are using a teensy 2.0, or a device like the Ergodox EZ that uses the teensy bootloader you should set this to `512`. Most other bootloaders should be set to `4096`, but `1024` and `2048` are other possible values you may encounter.
|
||||
The bootloader is a special section of your MCU that allows you to upgrade the code stored on the MCU. Think of it like a Rescue Partition for your keyboard.
|
||||
|
||||
#### Teensy 2.0 Bootloader Example
|
||||
#### Teensy Bootloader Example
|
||||
|
||||
```
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=512
|
||||
```
|
||||
|
||||
#### Teensy 2.0++ Bootloader Example
|
||||
|
||||
```
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=1024
|
||||
```make
|
||||
BOOTLOADER = halfkay
|
||||
```
|
||||
|
||||
#### Atmel DFU Loader Example
|
||||
|
||||
```make
|
||||
BOOTLOADER = atmel-dfu
|
||||
```
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
|
||||
#### Pro Micro Bootloader Example
|
||||
|
||||
```make
|
||||
BOOTLOADER = caterina
|
||||
```
|
||||
|
||||
### Build Options
|
||||
|
@ -27,17 +27,17 @@ This usually happens with a periodic scan of key presses. This speed often is li
|
||||
|
||||
## 2. What the Firmware Sends
|
||||
|
||||
The [HID specification](http://www.usb.org/developers/hidpage/Hut1_12v2.pdf) tells what a keyboard can actually send through USB to have a chance to be properly recognised. This includes a pre-defined list of scancodes which are simple numbers from `0x00` to `0xE7`. The firmware assigns a scancode to each key of the keyboard.
|
||||
The [HID specification](https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf) tells what a keyboard can actually send through USB to have a chance to be properly recognised. This includes a pre-defined list of scancodes which are simple numbers from `0x00` to `0xE7`. The firmware assigns a scancode to each key of the keyboard.
|
||||
|
||||
The firmware does not send actually letters or characters, but only scancodes.
|
||||
Thus, by modifying the firmware, you only can modify what scancode is sent over
|
||||
The firmware does not send actual letters or characters, but only scancodes.
|
||||
Thus, by modifying the firmware, you can only modify what scancode is sent over
|
||||
USB for a given key.
|
||||
|
||||
## 3. What the Operating System Does
|
||||
|
||||
Once the keycode reaches the operating system, a piece of software has to have
|
||||
it match an actual character thanks to a keyboard layout. For example, if your
|
||||
layout is set to QWERTY, a sample of the matching table is as follow:
|
||||
layout is set to QWERTY, a sample of the matching table is as follows:
|
||||
|
||||
| keycode | character |
|
||||
|---------|-----------|
|
||||
@ -55,11 +55,11 @@ As the layout is generally fixed (unless you create your own), the firmware can
|
||||
|
||||
## List of Characters You Can Send
|
||||
|
||||
Putting aside shortcuts, having a limited set of keycodes mapped to a limited layout means that **the list of characters you can assign to a given key only is the ones present in the layout**.
|
||||
Putting aside shortcuts, having a limited set of keycodes mapped to a limited layout means that **the list of characters you can assign to a given key are only the ones present in the layout**.
|
||||
|
||||
For example, this means that if you have a QWERTY US layout, and you want to assign 1 key to produce `€` (euro currency symbol), you are unable to do so, because the QWERTY US layout does not have such mapping. You could fix that by using a QWERTY UK layout, or a QWERTY US International.
|
||||
For example, this means that if you have a QWERTY US layout, and you want to assign one key to produce `€` (euro currency symbol), you are unable to do so, because the QWERTY US layout does not have such mapping. You could fix that by using a QWERTY UK layout, or a QWERTY US International.
|
||||
|
||||
You may wonder why a keyboard layout containing all of Unicode is not devised then? The limited number of keycode available through USB simply disallow such a thing.
|
||||
You may wonder why a keyboard layout containing all of Unicode is not devised then? The limited number of keycodes available through USB simply disallows such a thing.
|
||||
|
||||
## How to (Maybe) Enter Unicode Characters
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Basic Keycodes
|
||||
|
||||
The basic set of keycodes are based on the [HID Keyboard/Keypad Usage Page (0x07)](http://www.usb.org/developers/hidpage/Hut1_12v2.pdf) with the exception of `KC_NO`, `KC_TRNS` and keycodes in the `0xA5-DF` range. See below for more details.
|
||||
The basic set of keycodes are based on the [HID Keyboard/Keypad Usage Page (0x07)](https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf) with the exception of `KC_NO`, `KC_TRNS` and keycodes in the `0xA5-DF` range. See below for more details.
|
||||
|
||||
## Letters and Numbers
|
||||
|
||||
|
@ -6,7 +6,7 @@ Not sure if your keyboard can run QMK? If it's a mechanical keyboard you built y
|
||||
|
||||
## Overview
|
||||
|
||||
There are 4 main sections to this guide:
|
||||
There are 5 main sections to this guide:
|
||||
|
||||
* [Getting Started](newbs_getting_started.md)
|
||||
* [Building Your First Firmware](newbs_building_firmware.md)
|
||||
@ -15,4 +15,3 @@ There are 4 main sections to this guide:
|
||||
* [Learn More with these Resources](newbs_learn_more_resources.md)
|
||||
|
||||
This guide is focused on helping someone who has never compiled software before. It makes choices and recommendations based on that viewpoint. There are alternative methods for many of these procedures, and we support most of those alternatives. If you have any doubt about how to accomplish a task you can [ask us for guidance](getting_started_getting_help.md).
|
||||
|
||||
|
@ -2,12 +2,12 @@
|
||||
These resources are aimed at giving new members in the qmk community more understanding to the information provided in the newbs docs.
|
||||
|
||||
Git resources:
|
||||
*
|
||||
*[Great General Tutorial](https://www.codecademy.com/learn/learn-git)
|
||||
*[Git Game To Learn From Examples](https://learngitbranching.js.org/)
|
||||
*[Git Resources to Learn More About Github](getting_started_github.md)
|
||||
*[Git Resources Aimed Specificly toward QMK](contributing.md)
|
||||
|
||||
* [Great General Tutorial](https://www.codecademy.com/learn/learn-git)
|
||||
* [Git Game To Learn From Examples](https://learngitbranching.js.org/)
|
||||
* [Git Resources to Learn More About Github](getting_started_github.md)
|
||||
* [Git Resources Aimed Specificly toward QMK](contributing.md)
|
||||
|
||||
|
||||
Command Line resources:
|
||||
*[Good General Tutorial on Command Line](https://www.codecademy.com/learn/learn-the-command-line)
|
||||
* [Good General Tutorial on Command Line](https://www.codecademy.com/learn/learn-the-command-line)
|
||||
|
@ -128,7 +128,7 @@ The standard Deutsche (German) keyboard layout. Named for the first 6 letters on
|
||||
The term for pressing a key while a key is already held down. Variants include 2KRO, 6KRO, and NKRO.
|
||||
|
||||
## Scancode
|
||||
A 1 byte number that is sent as part of a HID report over USB that represents a single key. These numbers are documented in the [HID Usage Tables](http://www.usb.org/developers/hidpage/Hut1_12v2.pdf) published by the [USB-IF](http://www.usb.org/).
|
||||
A 1 byte number that is sent as part of a HID report over USB that represents a single key. These numbers are documented in the [HID Usage Tables](https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf) published by the [USB-IF](http://www.usb.org/).
|
||||
|
||||
## Space Cadet Shift
|
||||
A special set of shift keys which allow you to type various types of braces by tapping the left or right shift one or more times.
|
||||
|
@ -8,7 +8,9 @@
|
||||
#include "i2c_master.h"
|
||||
#include "timer.h"
|
||||
|
||||
#ifndef F_SCL
|
||||
#define F_SCL 400000UL // SCL frequency
|
||||
#endif
|
||||
#define Prescaler 1
|
||||
#define TWBR_val ((((F_CPU / F_SCL) / Prescaler) - 16 ) / 2)
|
||||
|
||||
|
102
drivers/issi/is31fl3218.c
Normal file
102
drivers/issi/is31fl3218.c
Normal file
@ -0,0 +1,102 @@
|
||||
/* Copyright 2018 Jason Williams (Wilba)
|
||||
*
|
||||
* 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 "is31fl3218.h"
|
||||
#include "i2c_master.h"
|
||||
|
||||
// This is the full 8-bit address
|
||||
#define ISSI_ADDRESS 0b10101000
|
||||
|
||||
// These are the register addresses
|
||||
#define ISSI_REG_SHUTDOWN 0x00
|
||||
#define ISSI_REG_PWM 0x01
|
||||
#define ISSI_REG_CONTROL 0x13
|
||||
#define ISSI_REG_UPDATE 0x16
|
||||
#define ISSI_REG_RESET 0x17
|
||||
|
||||
// Default timeout if no I2C response
|
||||
#define ISSI_TIMEOUT 100
|
||||
|
||||
// Reusable buffer for transfers
|
||||
uint8_t g_twi_transfer_buffer[20];
|
||||
|
||||
// IS31FL3218 has 18 PWM outputs and a fixed I2C address, so no chaining.
|
||||
// If used as RGB LED driver, LEDs are assigned RGB,RGB,RGB,RGB,RGB,RGB
|
||||
uint8_t g_pwm_buffer[18];
|
||||
bool g_pwm_buffer_update_required = false;
|
||||
|
||||
void IS31FL3218_write_register( uint8_t reg, uint8_t data )
|
||||
{
|
||||
g_twi_transfer_buffer[0] = reg;
|
||||
g_twi_transfer_buffer[1] = data;
|
||||
i2c_transmit( ISSI_ADDRESS, g_twi_transfer_buffer, 2, ISSI_TIMEOUT);
|
||||
}
|
||||
|
||||
void IS31FL3218_write_pwm_buffer( uint8_t *pwm_buffer )
|
||||
{
|
||||
g_twi_transfer_buffer[0] = ISSI_REG_PWM;
|
||||
for ( int i=0; i<18; i++ ) {
|
||||
g_twi_transfer_buffer[1+i] = pwm_buffer[i];
|
||||
}
|
||||
|
||||
i2c_transmit( ISSI_ADDRESS, g_twi_transfer_buffer, 19, ISSI_TIMEOUT);
|
||||
}
|
||||
|
||||
void IS31FL3218_init(void)
|
||||
{
|
||||
// In case we ever want to reinitialize (?)
|
||||
IS31FL3218_write_register( ISSI_REG_RESET, 0x00 );
|
||||
|
||||
// Turn off software shutdown
|
||||
IS31FL3218_write_register( ISSI_REG_SHUTDOWN, 0x01 );
|
||||
|
||||
// Set all PWM values to zero
|
||||
for ( uint8_t i = 0; i < 18; i++ ) {
|
||||
IS31FL3218_write_register( ISSI_REG_PWM+i, 0x00 );
|
||||
}
|
||||
|
||||
// Enable all channels
|
||||
for ( uint8_t i = 0; i < 3; i++ ) {
|
||||
IS31FL3218_write_register( ISSI_REG_CONTROL+i, 0b00111111 );
|
||||
}
|
||||
|
||||
// Load PWM registers and LED Control register data
|
||||
IS31FL3218_write_register( ISSI_REG_UPDATE, 0x01 );
|
||||
}
|
||||
|
||||
void IS31FL3218_set_color( int index, uint8_t red, uint8_t green, uint8_t blue )
|
||||
{
|
||||
g_pwm_buffer[index * 3 + 0] = red;
|
||||
g_pwm_buffer[index * 3 + 1] = green;
|
||||
g_pwm_buffer[index * 3 + 2] = blue;
|
||||
g_pwm_buffer_update_required = true;
|
||||
}
|
||||
|
||||
void IS31FL3218_set_color_all( uint8_t red, uint8_t green, uint8_t blue )
|
||||
{
|
||||
for ( int i = 0; i < 6; i++ ) {
|
||||
IS31FL3218_set_color( i, red, green, blue );
|
||||
}
|
||||
}
|
||||
|
||||
void IS31FL3218_update_pwm_buffers(void)
|
||||
{
|
||||
if ( g_pwm_buffer_update_required ) {
|
||||
IS31FL3218_write_pwm_buffer( g_pwm_buffer );
|
||||
// Load PWM registers and LED Control register data
|
||||
IS31FL3218_write_register( ISSI_REG_UPDATE, 0x01 );
|
||||
}
|
||||
g_pwm_buffer_update_required = false;
|
||||
}
|
24
drivers/issi/is31fl3218.h
Normal file
24
drivers/issi/is31fl3218.h
Normal file
@ -0,0 +1,24 @@
|
||||
/* Copyright 2018 Jason Williams (Wilba)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
void IS31FL3218_init(void);
|
||||
void IS31FL3218_set_color( int index, uint8_t red, uint8_t green, uint8_t blue );
|
||||
void IS31FL3218_set_color_all( uint8_t red, uint8_t green, uint8_t blue );
|
||||
void IS31FL3218_update_pwm_buffers(void);
|
6
keyboards/68keys/68keys.c
Normal file
6
keyboards/68keys/68keys.c
Normal file
@ -0,0 +1,6 @@
|
||||
#include "68keys.h"
|
||||
|
||||
void matrix_init_kb(void)
|
||||
{
|
||||
matrix_init_user();
|
||||
}
|
20
keyboards/68keys/68keys.h
Normal file
20
keyboards/68keys/68keys.h
Normal file
@ -0,0 +1,20 @@
|
||||
#include "quantum.h"
|
||||
|
||||
#define LAYOUT_68_ansi( \
|
||||
K00, K01, K02, K03, K04, K05, K06, K07, K08, K10, K11, K12, K13, K14, K15, K16, \
|
||||
K17, K18, K20, K21, K22, K23, K24, K25, K26, K27, K28, K30, K31, K32, K33, K34, \
|
||||
K35, K36, K37, K38, K40, K41, K42, K43, K44, K45, K46, K47, K48, \
|
||||
K50, K51, K52, K53, K54, K55, K56, K57, K58, K60, K61, K62, K63, \
|
||||
K64, K65, K66, K67, K68, K70, K71, K72, K73, K74) \
|
||||
{ \
|
||||
{K00, K01, K02, K03, K04, K05, K06, K07, K08}, \
|
||||
{K10, K11, K12, K13, K14, K15, K16, K17, K18}, \
|
||||
{K20, K21, K22, K23, K24, K25, K26, K27, K28}, \
|
||||
{K30, K31, K32, K33, K34, K35, K36, K37, K38}, \
|
||||
{K40, K41, K42, K43, K44, K45, K46, K47, K48}, \
|
||||
{K50, K51, K52, K53, K54, K55, K56, K57, K58}, \
|
||||
{K60, K61, K62, K63, K64, K65, K66, K67, K68}, \
|
||||
{ \
|
||||
K70, K71, K72, K73, K74 \
|
||||
} \
|
||||
}
|
23
keyboards/68keys/README.md
Normal file
23
keyboards/68keys/README.md
Normal file
@ -0,0 +1,23 @@
|
||||
# 68Keys.io
|
||||
|
||||
Custom [68Keys.io](https://68keys.io) DIY keyboard.
|
||||
|
||||
Keyboard Maintainer: [sbstjn](https://sbstjn.com)
|
||||
Hardware Supported: Pro Micro
|
||||
Hardware Availability: [DIY Guide](https://68keys.io)
|
||||
|
||||
Make example for this keyboard (after setting up your build environment):
|
||||
|
||||
```bash
|
||||
$ > cd qmk_firmware/
|
||||
$ > make 68keys:default
|
||||
```
|
||||
|
||||
Example of flashing this keyboard:
|
||||
|
||||
```bash
|
||||
$ > cd qmk_firmware/
|
||||
$ > make 68keys:default:avrdude
|
||||
```
|
||||
|
||||
See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
|
42
keyboards/68keys/config.h
Normal file
42
keyboards/68keys/config.h
Normal file
@ -0,0 +1,42 @@
|
||||
#pragma once
|
||||
|
||||
#include "config_common.h"
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define VENDOR_ID 0xFEED
|
||||
#define PRODUCT_ID 0x0A0C
|
||||
#define DEVICE_VER 0x0068
|
||||
#define MANUFACTURER 68Keys.io
|
||||
#define PRODUCT The 68Keys.io Keyboard
|
||||
#define DESCRIPTION A 68 keys mechanical keyboard
|
||||
|
||||
/* key matrix size */
|
||||
#define MATRIX_ROWS 8
|
||||
#define MATRIX_COLS 9
|
||||
|
||||
#define MATRIX_ROW_PINS \
|
||||
{ \
|
||||
B6, B2, B3, B1, F7, F6, F5, F4 \
|
||||
}
|
||||
#define MATRIX_COL_PINS \
|
||||
{ \
|
||||
D3, D2, D1, D0, D4, C6, D7, E6, B4 \
|
||||
}
|
||||
#define UNUSED_PINS
|
||||
|
||||
#define DIODE_DIRECTION COL2ROW
|
||||
|
||||
#define BACKLIGHT_PIN B5
|
||||
#define BACKLIGHT_BREATHING
|
||||
#define BACKLIGHT_LEVELS 3
|
||||
|
||||
#define DEBOUNCING_DELAY 5
|
||||
|
||||
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
||||
#define LOCKING_SUPPORT_ENABLE
|
||||
/* Locking resynchronize hack */
|
||||
#define LOCKING_RESYNC_ENABLE
|
||||
|
||||
/* key combination for magic key command */
|
||||
#define IS_COMMAND() ( \
|
||||
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)))
|
81
keyboards/68keys/info.json
Normal file
81
keyboards/68keys/info.json
Normal file
@ -0,0 +1,81 @@
|
||||
{
|
||||
"keyboard_name": "68Keys.io",
|
||||
"url": "https://68keys.io",
|
||||
"maintainer": "qmk",
|
||||
"width": 17.25,
|
||||
"height": 5,
|
||||
"layouts": {
|
||||
"LAYOUT_68_ansi": {
|
||||
"layout": [
|
||||
{ "label": "~", "x": 0, "y": 0 },
|
||||
{ "label": "!", "x": 1, "y": 0 },
|
||||
{ "label": "@", "x": 2, "y": 0 },
|
||||
{ "label": "#", "x": 3, "y": 0 },
|
||||
{ "label": "$", "x": 4, "y": 0 },
|
||||
{ "label": "%", "x": 5, "y": 0 },
|
||||
{ "label": "^", "x": 6, "y": 0 },
|
||||
{ "label": "&", "x": 7, "y": 0 },
|
||||
{ "label": "*", "x": 8, "y": 0 },
|
||||
{ "label": "(", "x": 9, "y": 0 },
|
||||
{ "label": ")", "x": 10, "y": 0 },
|
||||
{ "label": "_", "x": 11, "y": 0 },
|
||||
{ "label": "+", "x": 12, "y": 0 },
|
||||
{ "label": "Backspace", "x": 13, "y": 0, "w": 2 },
|
||||
{ "label": "ESC", "x": 15.25, "y": 0 },
|
||||
{ "label": "PGUP", "x": 16.25, "y": 0 },
|
||||
{ "label": "Tab", "x": 0, "y": 1, "w": 1.5 },
|
||||
{ "label": "Q", "x": 1.5, "y": 1 },
|
||||
{ "label": "W", "x": 2.5, "y": 1 },
|
||||
{ "label": "E", "x": 3.5, "y": 1 },
|
||||
{ "label": "R", "x": 4.5, "y": 1 },
|
||||
{ "label": "T", "x": 5.5, "y": 1 },
|
||||
{ "label": "Y", "x": 6.5, "y": 1 },
|
||||
{ "label": "U", "x": 7.5, "y": 1 },
|
||||
{ "label": "I", "x": 8.5, "y": 1 },
|
||||
{ "label": "O", "x": 9.5, "y": 1 },
|
||||
{ "label": "P", "x": 10.5, "y": 1 },
|
||||
{ "label": "{", "x": 11.5, "y": 1 },
|
||||
{ "label": "}", "x": 12.5, "y": 1 },
|
||||
{ "label": "|", "x": 13.5, "y": 1, "w": 1.5 },
|
||||
{ "label": "DEL", "x": 15.25, "y": 1 },
|
||||
{ "label": "PGDN", "x": 16.25, "y": 1 },
|
||||
{ "label": "Caps Lock", "x": 0, "y": 2, "w": 1.75 },
|
||||
{ "label": "A", "x": 1.75, "y": 2 },
|
||||
{ "label": "S", "x": 2.75, "y": 2 },
|
||||
{ "label": "D", "x": 3.75, "y": 2 },
|
||||
{ "label": "F", "x": 4.75, "y": 2 },
|
||||
{ "label": "G", "x": 5.75, "y": 2 },
|
||||
{ "label": "H", "x": 6.75, "y": 2 },
|
||||
{ "label": "J", "x": 7.75, "y": 2 },
|
||||
{ "label": "K", "x": 8.75, "y": 2 },
|
||||
{ "label": "L", "x": 9.75, "y": 2 },
|
||||
{ "label": ":", "x": 10.75, "y": 2 },
|
||||
{ "label": "\"", "x": 11.75, "y": 2 },
|
||||
{ "label": "Enter", "x": 12.75, "y": 2, "w": 2.25 },
|
||||
{ "label": "Shift", "x": 0, "y": 3, "w": 2.25 },
|
||||
{ "label": "Z", "x": 2.25, "y": 3 },
|
||||
{ "label": "X", "x": 3.25, "y": 3 },
|
||||
{ "label": "C", "x": 4.25, "y": 3 },
|
||||
{ "label": "V", "x": 5.25, "y": 3 },
|
||||
{ "label": "B", "x": 6.25, "y": 3 },
|
||||
{ "label": "N", "x": 7.25, "y": 3 },
|
||||
{ "label": "M", "x": 8.25, "y": 3 },
|
||||
{ "label": "<", "x": 9.25, "y": 3 },
|
||||
{ "label": ">", "x": 10.25, "y": 3 },
|
||||
{ "label": "?", "x": 11.25, "y": 3 },
|
||||
{ "label": "Shift", "x": 12.25, "y": 3, "w": 2.75 },
|
||||
{ "x": 15.25, "y": 3 },
|
||||
{ "label": "CTRL", "x": 0, "y": 4, "w": 1.25 },
|
||||
{ "label": "ALT", "x": 1.25, "y": 4, "w": 1.25 },
|
||||
{ "label": "GUI", "x": 2.5, "y": 4, "w": 1.25 },
|
||||
{ "x": 3.75, "y": 4, "w": 6.25 },
|
||||
{ "label": "GUI", "x": 10, "y": 4, "w": 1.25 },
|
||||
{ "label": "ALT", "x": 11.25, "y": 4, "w": 1.25 },
|
||||
{ "label": "CTRL", "x": 12.5, "y": 4, "w": 1.25 },
|
||||
{ "x": 14.25, "y": 4 },
|
||||
{ "x": 15.25, "y": 4 },
|
||||
{ "x": 16.25, "y": 4 }
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user