port boards and docs

This commit is contained in:
Kyle Brown
2020-11-13 16:10:14 -08:00
parent 33e969230f
commit f94734c28d
32 changed files with 220 additions and 226 deletions

View File

@@ -1,21 +1,14 @@
# Extensions
Extensions allow more features to be added ot KMK such as RGB, power saving and
more. Extensions listed on this page are supported by default on KMK, though
it's possible to add your own!
Extensions add features that change the experience, but not the core features of
the keyboard. They are meant to be easy to add, and create your own. These live in
a sandbox to help prevent any bad code from crashing your keyboard.
## Core extensions
## Core Extensions
These extensions are proveded in all builds and can be enabled. Currently offered
xtensions are
extensions are
- [BLE-Split](split_keyboards.md): Allows keyboards to be split in 2 with no wires
- [International](international.md): Adds international keycodes
- [Layers](layers.md): Adds layer support (Fn key) to allow many more keys to be
put on your keyboard
- [LED](led.md): Adds backlight support. This is for monocolor backlight, not RGB
- [MediaKeys](media_keys.md): Adds support for media keys such as volume
- [ModTap](modtap.md): Adds support for augmented modifier keys to act as one key
when tapped, and modifier when held.
- [Power](power.md): Power saving features. This is mostly useful when on battery power.
- [RGB](rgb.md): RGB lighting for underglow. Will work on most matrix RGB as well
treated the same as underglow.
- [Split](split_keyboards.md): This is for wired splits. Only use wired or wireless, not both.
- [RGB](rgb.md): RGB lighting for underglow. Will work on most matrix RGB as will
be treated the same as underglow.

View File

@@ -1,10 +1,10 @@
# Layers
Layers extention adds keys for accessing other layers. It can simply be added to
Layers module adds keys for accessing other layers. It can simply be added to
the extentions list.
```python
from kmk.extensions.layers import Layers
keyboard.extensions.append(Layers())
from kmk.modules.layers import Layers
keyboard.modules.append(Layers())
```
## Keycodes

View File

@@ -1,10 +1,10 @@
# ModTap Keycodes
Enabling ModTap will give you access to the following keycodes and can simply be
added to the extentions list.
added to the modules list.
```python
from kmk.extensions.modtap import ModTap
keyboard.extensions.append(ModTap())
from kmk.modules.modtap import ModTap
keyboard.modules.append(ModTap())
```
## Keycodes

15
docs/modules.md Normal file
View File

@@ -0,0 +1,15 @@
# Modules
Modules, unlike extensions, change how your keyboard works. These are meant to have
the ability to alter the core code in any way. Unlike extensions, these are not in a
sandbox, and can make massive changes to normal operation.
## Core Modules
These modules are proveded in all builds and can be enabled. Currently offered
modules are
- [Layers](layers.md): Adds layer support (Fn key) to allow many more keys to be
put on your keyboard
- [ModTap](modtap.md): Adds support for augmented modifier keys to act as one key
when tapped, and modifier when held.
- [Power](power.md): Power saving features. This is mostly useful when on battery power.
- [Split](split_keyboards.md): Keyboards split in two. Seems ergonomic!

View File

@@ -1,5 +1,5 @@
# Power(save)
This extention allows you to save power and is targeted to bluetooth/battery
This module allows you to save power and is targeted to bluetooth/battery
based keyboards.
## Keycodes
@@ -12,11 +12,11 @@ based keyboards.
# Enabling the extention
To turn on basic power saving, this is all that is required.
```python
from kmk.extensions.power import Power
from kmk.modules.power import Power
power = Power()
keyboard.extensions.append(power)
keyboard.modules.append(power)
```
@@ -26,14 +26,14 @@ power if OLEDS or RGBs are installed. These drain power even when off, so this
will prevent them from doing so.
```python
from kmk.extensions.power import Power
from kmk.modules.power import Power
# Your kb.py may already have this set. If not, add it like this
# import board
# keyboard.powersave_pin = board.P0_13
power = Power(powersave_pin=keyboard.powersave_pin)
keyboard.extensions.append(power)
keyboard.modules.append(power)
```

View File

@@ -6,60 +6,48 @@ Split keyboards are mostly the same as unsplit. Wired UART and Bluetooth are sup
Wired connections can use UART over 1 or 2 wires. With 2 wires, you will be able
to syncronize the halves allowing additional features in some extentions.
```python
import board
from kmk.extensions.split import Split
uart_pin = board.SOMETHING
split = Split(uart_pin=uart_pin)
keyboard.extensions.append(split)
```
### Config
Useful config options:
```python
split = Split(
is_target=True, # If this is the side connecting to the computer
extra_data_pin=None, # Second uart pin to allow 2 way communication
split_offset=None, # Default is column pins but allows an override
split_flip=True, # If both halves are the same, but flipped, set this True
split_side=None, # Sets if this is to 0 if left, 1 if right, or use EE hands
split_type=SplitType.UART, # Defaults to UART
target_left=True, # Assumes that left will be the one on USB. Set to folse if it will be the right
uart_flip=True, # Reverses the RX and TX pins if both are provided
uart_pin=None, # The primary uart pin to talk to the secondary device with
uart_timeout=20, # Rarely needed to change, but is avaliable
)
from kb import data_pin
:from kmk.modules.split import Split, SplitType
split = Split(split_type=Split.UART, data_pin=data_pin, split_side=SplitSide.LEFT)
keyboard.modules.append(split)
```
## Bluetooth split (aka no TRRS)
Wireless splits are fully featured with 2 way communication allowing all extentions to work 100%.
```python
split_side = 0 # Left
OR
split_side = 1 # Right
split = BLE_Split(split_side=split_side)
from kb import data_pin
from kmk.modules.split import Split, SplitType, Split_Side
keyboard.extensions.append(split)
split = Split(split_type=Split.BLE, split_side=SplitSide.LEFT)
OR
split = Split(split_type=Split.BLE, split_side=SplitSide.LEFT)
keyboard.modules.append(split)
```
### Config
Useful config options:
```python
split = BLE_Split(
split_side=split_side, # See EE hands below
uart_interval=30, # Sets the uarts delay. Lower numbers draw more power
hid_type=HIDModes.BLE, # If using USB to connect to a computer, change this appropriately.
)
split = Split(
split_flip=True, # If both halves are the same, but flipped, set this True
split_side=None, # Sets if this is to SplitSide.LEFT or SplitSide.RIGHT, or use EE hands
split_type=SplitType.UART, # Defaults to UART
split_target_left=True, # If you want the right to be the target, change this to false
uart_interval=20, # Sets the uarts delay. Lower numbers draw more power
data_pin=None, # The primary data pin to talk to the secondary device with
data_pin2=None, # Second uart pin to allow 2 way communication
target_left=True, # Assumes that left will be the one on USB. Set to folse if it will be the right
uart_flip=True, # Reverses the RX and TX pins if both are provided
)
```
### EE HANDS
If you want to plug USB in on either side, or are using bluetooth, this is for
you. Pick one of the 2 options but not both.
you.
## Renaming CIRCUITPY Drive
The easiest way is to rename your CIRCUITPY drive to something. The left side must
Rename your CIRCUITPY drive to something different. The left side must
end in L, the right must is in R. The name must be 11 characters or less! This is
a limitation of the filesystem. You will receive an error if you choose a name
longer than 11 characters. Instructions on how to do that are
@@ -68,24 +56,6 @@ For example on NYQUISTL for left and NYQUISTR for the right.
For wired connections you are done. For bluetooth, remove the `split_side` like this
```python
split = BLE_Split()
keyboard.extensions.append(split)
split = Split(split_type=Split.UART, data_pin=data_pin)
split = Split(split_type=Split.BLE)
```
## Adding an extra file
If you have changed the name of the drive as stated above, do not follow this section.
On each half of your keyboard make a file called kmk_side.py and add one of these lines to the file
depending on where each piece is physically located.
```python
split_side = 0 # Left
OR
split_side = 1 # Right
```
and then in your keymap, add the line
```python
from kmk_side import split_side
```