aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/_sidebar.md1
-rw-r--r--docs/_summary.md1
-rw-r--r--docs/feature_backlight.md19
-rw-r--r--docs/ref_functions.md48
4 files changed, 69 insertions, 0 deletions
diff --git a/docs/_sidebar.md b/docs/_sidebar.md
index d439298da..a35014dd8 100644
--- a/docs/_sidebar.md
+++ b/docs/_sidebar.md
@@ -36,6 +36,7 @@
36 * [Documentation Templates](documentation_templates.md) 36 * [Documentation Templates](documentation_templates.md)
37 * [Glossary](reference_glossary.md) 37 * [Glossary](reference_glossary.md)
38 * [Unit Testing](unit_testing.md) 38 * [Unit Testing](unit_testing.md)
39 * [Useful Functions](ref_functions.md)
39 40
40* [Features](features.md) 41* [Features](features.md)
41 * [Basic Keycodes](keycodes_basic.md) 42 * [Basic Keycodes](keycodes_basic.md)
diff --git a/docs/_summary.md b/docs/_summary.md
index d439298da..a35014dd8 100644
--- a/docs/_summary.md
+++ b/docs/_summary.md
@@ -36,6 +36,7 @@
36 * [Documentation Templates](documentation_templates.md) 36 * [Documentation Templates](documentation_templates.md)
37 * [Glossary](reference_glossary.md) 37 * [Glossary](reference_glossary.md)
38 * [Unit Testing](unit_testing.md) 38 * [Unit Testing](unit_testing.md)
39 * [Useful Functions](ref_functions.md)
39 40
40* [Features](features.md) 41* [Features](features.md)
41 * [Basic Keycodes](keycodes_basic.md) 42 * [Basic Keycodes](keycodes_basic.md)
diff --git a/docs/feature_backlight.md b/docs/feature_backlight.md
index 6140e6a0a..8f883e08f 100644
--- a/docs/feature_backlight.md
+++ b/docs/feature_backlight.md
@@ -51,3 +51,22 @@ In this way `OCRxx` essentially controls the duty cycle of the LEDs, and thus th
51 51
52The breathing effect is achieved by registering an interrupt handler for `TIMER1_OVF_vect` that is called whenever the counter resets, roughly 244 times per second. 52The breathing effect is achieved by registering an interrupt handler for `TIMER1_OVF_vect` that is called whenever the counter resets, roughly 244 times per second.
53In this handler, the value of an incrementing counter is mapped onto a precomputed brightness curve. To turn off breathing, the interrupt handler is simply disabled, and the brightness reset to the level stored in EEPROM. 53In this handler, the value of an incrementing counter is mapped onto a precomputed brightness curve. To turn off breathing, the interrupt handler is simply disabled, and the brightness reset to the level stored in EEPROM.
54
55## Backlight Functions
56
57|Function |Description |
58|----------|----------------------------------------------------------|
59|`backlight_toggle()` |Turn the backlight on or off |
60|`backlight_step()` |Cycle through backlight levels |
61|`backlight_increase()` |Increase the backlight level |
62|`backlight_decrease()` |Decrease the backlight level |
63|`backlight_level(x)` |Sets the backlight level to specified level |
64|`get_backlight_level()`|Toggle backlight breathing |
65
66### Backlight Breathing Functions
67
68|Function |Description |
69|----------|----------------------------------------------------------|
70|`breathing_toggle()` |Turn the backlight breathing on or off |
71|`breathing_enable()` |Turns on backlight breathing |
72|`breathing_disable()` |Turns off backlight breathing |
diff --git a/docs/ref_functions.md b/docs/ref_functions.md
new file mode 100644
index 000000000..7d0cda322
--- /dev/null
+++ b/docs/ref_functions.md
@@ -0,0 +1,48 @@
1# List of Useful Core Functions To Make Your Keyboard Better
2
3There are a lot of hidden functions in QMK that are incredible useful, or may add a bit of functionality that you've been wanting. Functions that are specific to certain features are not included here, as those will be on their respective feature page.
4
5## (OLKB) Tri Layers
6
7There are actually separate functions that you can use there, depending on what you're after.
8
9The first is the `update_tri_layer(x, y, z)` function. This function check to see if layers `x` and `y` are both on. If they are both on, then it runs on layer `z`. Otherwise, if both `x` and `y` are not both on (either only one is, or neither is), then it runs off layer `z`.
10
11This function is useful if you want to create specific keys that have this functionality, but other layer keycodes won't do this.
12
13The other function is `update_tri_layer_state(state, x, y, z)`. This function is meant to be called from they [`layer_state_set_*` functions](custom_quantum_functions.md#layer-change-code). This means that any time that you use a keycode to change the layer, this will be checked. So you could use `LT(layer, kc)` to change the layer and it will trigger the same layer check.
14
15The caveat to this method is that you cannot access the `z` layer without having `x` and `y` layers on, since if you try to activate just layer `z`, it will run this code and turn off layer `z` before you could use it.
16
17## Setting the Persistent Default Layer
18
19Do you want to set the default layer, so that it's retained even after you unplug the board? If so, this is the function for you.
20
21To use this, you would use `set_single_persistent_default_layer(layer)`. If you have a name defined for your layer, you can use that instead (such as _QWERTY, _DVORAK or _COLEMAK).
22
23This will set the default layer, update the persistent settings, and play a tune if you have [Audio](feature_audio.md) enabled on your board, and the default layer sounds set.
24
25To configure the default layer sounds, you would want to define this in your `config.h` file, like this:
26
27```c
28#define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \
29 SONG(COLEMAK_SOUND), \
30 SONG(DVORAK_SOUND) \
31 }
32```
33
34
35?> There are a large number of predefined songs in [quantum/audio/song_list.h](https://github.com/qmk/qmk_firmware/blob/master/quantum/audio/song_list.h) that you can use.
36
37## Reseting the keyboard
38
39There is the `RESET` quantum keycode that you can use. But if you want to reset the board as part of a macro, rather than hitting a key separately, you can do that.
40
41And to do so, add `reset_keyboard()` to your function or macro, and this will reset to bootloader.
42
43## Wiping the EEPROM (Persistent Storage)
44
45If you're having issues with Audio, RGB Underglow, backlighting or keys acting weird, then you can reset the EEPROM (persistent setting storage). Bootmagic is one way to do this, but if that isn't enabled, then you can use a custom macro to do so.
46
47To wipe the EEPROM, run `eeconfig_init()` from your function or macro to reset most of the settings to default.
48