Compare commits
162 Commits
Author | SHA1 | Date | |
---|---|---|---|
96cb9f4661 | |||
8f0ec565f4 | |||
6a4a4a2875 | |||
5e463086cd | |||
c37ce43437 | |||
f2fcffab0d | |||
aa62b60eaf | |||
612a418ce9 | |||
6bdef6b8c2 | |||
b292d30a25 | |||
7f0a205232 | |||
1f5d5e5314 | |||
8ffeaec3aa | |||
bbea9dadbc | |||
81756d7b21 | |||
c5c112ae29 | |||
3d7bfae232 | |||
b666921e25 | |||
b4f4576631 | |||
60797c8439 | |||
3d9fda3629 | |||
ffa119941c | |||
ffa5c48430 | |||
a69b610456 | |||
2ba6b9ab69 | |||
5d5fa0dc8c | |||
2fe2c323c6 | |||
72fa2cf2fc | |||
3468f2f4c7 | |||
4de809535a | |||
e954dfcf8c | |||
c7b8e45ba1 | |||
d9619be499 | |||
b7cbae8d1f | |||
f5ebfdabcd | |||
ed98250e62 | |||
9c35c5979c | |||
1236eac4f2 | |||
de7d1d35c8 | |||
180d39824b | |||
82277af884 | |||
956ba037ef | |||
9a1613dd1a | |||
f30d6dd785 | |||
e3299db9e3 | |||
168d180a74 | |||
7ebed894a8 | |||
9ce7374563 | |||
2ddabda586 | |||
df8b8c5032 | |||
a552416ab2 | |||
b335a22568 | |||
48913153c3 | |||
5477bf39bf | |||
a345458fa9 | |||
aaa311dd20 | |||
8ee97f7c99 | |||
11f8414401 | |||
6ef3359a8a | |||
ddaa4c212a | |||
0fcaa3b5e1 | |||
5b7ac47b1a | |||
65f1b08b5b | |||
5ef50256d8 | |||
56b5e9f23d | |||
dab0b35dc3 | |||
4a6d668f8a | |||
c6042a2636 | |||
52857e51ca | |||
4081288da1 | |||
67adb30edd | |||
0b9b2a6376 | |||
f28f569600 | |||
ebe4c3dbbe | |||
e661f1559e | |||
df8b564518 | |||
0d5a8b048a | |||
978fa700d8 | |||
03766619d5 | |||
3d7428a333 | |||
60ca50808f | |||
0a8d529d74 | |||
c418608c1e | |||
956e0bb4b8 | |||
218d51094e | |||
36d35959c8 | |||
0210447c82 | |||
7fef5ca240 | |||
8906e62c1f | |||
5953af3215 | |||
e36cbdc786 | |||
3f3a1cc9f3 | |||
8dd85f73b3 | |||
3d6919c3dc | |||
db8b547b7d | |||
77445afac5 | |||
b9bf310b0f | |||
1f9ee8b990 | |||
090b4a81b9 | |||
7eeb8932a1 | |||
876377e945 | |||
3bbf11d110 | |||
3204dec096 | |||
d5def73f6e | |||
d7881f3504 | |||
57fdce91bf | |||
40b4f27b03 | |||
c197d080c4 | |||
df73b74b55 | |||
d49e4543b3 | |||
a120bbc4de | |||
3f886a3efe | |||
08c1997db1 | |||
9c2dde98e2 | |||
a7df902734 | |||
dad851d47d | |||
a3c7f30971 | |||
f8f1b6fac8 | |||
c3d429bcb6 | |||
90c384f650 | |||
47957c3f77 | |||
63b0290708 | |||
e8d2f4f891 | |||
29954efd06 | |||
738eab0bb1 | |||
0470017c21 | |||
585f753ffe | |||
c8e1397e08 | |||
87d9bb461b | |||
155375ea32 | |||
dca2c2a439 | |||
701fed2e15 | |||
1230ecb73d | |||
b79c324642 | |||
5709e1b602 | |||
1499dffb07 | |||
b4888eee14 | |||
91e8e8d916 | |||
09bb020a55 | |||
03381962ac | |||
a980a7972c | |||
526eabb6f8 | |||
e448ef0b1a | |||
ded51136ce | |||
1038bbef40 | |||
d80774027e | |||
f5f0e93230 | |||
6590f3c811 | |||
08283f6124 | |||
7a44ad83fc | |||
6380f83190 | |||
76e0d23887 | |||
bad56a4f2b | |||
b8564f5dd0 | |||
998ddbb122 | |||
c0095710a7 | |||
682555faac | |||
6dc215cd67 | |||
5272218ac9 | |||
0592d23b74 | |||
b5e7589bf9 | |||
3d00f38586 |
37
Vagrantfile
vendored
37
Vagrantfile
vendored
@ -2,27 +2,8 @@
|
||||
# vi: set ft=ruby :
|
||||
|
||||
Vagrant.configure(2) do |config|
|
||||
# You can only have one config.vm.box uncommented at a time
|
||||
|
||||
# Comment this and uncomment another if you don't want to use the minimal Arch box
|
||||
#config.vm.box = "dragon788/arch-ala-elasticdog"
|
||||
|
||||
# VMware/Virtualbox 64 bit
|
||||
config.vm.box = "phusion/ubuntu-14.04-amd64"
|
||||
#
|
||||
# VMware/Virtualbox 64 bit
|
||||
#config.vm.box = "puphpet/centos65-x64"
|
||||
#
|
||||
# The opensuse boxes don't have dfu-util in their default repositories
|
||||
#
|
||||
# The virtualbox version has tools issues
|
||||
# VMware/Virtualbox 64 bit
|
||||
#config.vm.box = "bento/opensuse-13.2-x86_64"
|
||||
#
|
||||
# Virtualbox only
|
||||
#config.vm.box = "bento/opensuse-13.2-i386"
|
||||
# config.vm.box = ""
|
||||
# config.vm.box = ""
|
||||
|
||||
# This section allows you to customize the Virtualbox VM
|
||||
# settings, ie showing the GUI or upping the memory
|
||||
@ -81,18 +62,16 @@ Vagrant.configure(2) do |config|
|
||||
config.vm.provision "shell", run: "always", path: "./util/install_dependencies.sh", args: "-update"
|
||||
|
||||
config.vm.post_up_message = <<-EOT
|
||||
Log into the VM using 'vagrant ssh' on OSX or from Git Bash (Win)
|
||||
or 'vagrant ssh-config' and Putty or Bitvise SSH or another SSH tool
|
||||
|
||||
Change directory (cd) to the keyboard you wish to program
|
||||
(Optionally) modify your layout,
|
||||
then run 'make clean'
|
||||
and then 'make' to compile the .eep and .hex files.
|
||||
|
||||
Or you can copy and paste the example line below.
|
||||
|
||||
cd /vagrant; cd keyboards; cd ergodox; make clean; make
|
||||
Log into the VM using 'vagrant ssh'. QMK directory synchronized with host is
|
||||
located at /vagrant
|
||||
To compile the .hex files use make command inside this directory.
|
||||
|
||||
QMK's make format recently changed to use folder locations and colons:
|
||||
make project_folder:keymap[:target]
|
||||
Examples:
|
||||
make planck/rev4:default:dfu
|
||||
make planck:default
|
||||
|
||||
EOT
|
||||
end
|
||||
|
@ -197,6 +197,12 @@ ifeq ($(strip $(USB_HID_ENABLE)), yes)
|
||||
include $(TMK_DIR)/protocol/usb_hid.mk
|
||||
endif
|
||||
|
||||
|
||||
ifeq ($(strip $(HD44780_ENABLE)), yes)
|
||||
SRC += drivers/avr/hd44780.c
|
||||
OPT_DEFS += -DHD44780_ENABLE
|
||||
endif
|
||||
|
||||
QUANTUM_SRC:= \
|
||||
$(QUANTUM_DIR)/quantum.c \
|
||||
$(QUANTUM_DIR)/keymap_common.c \
|
||||
|
@ -53,18 +53,22 @@
|
||||
* [Userspace](feature_userspace.md)
|
||||
|
||||
* [Keycodes](keycodes.md)
|
||||
* [Backlight](feature_backlight.md#backlight-keycodes)
|
||||
* [Basic](keycodes_basic.md)
|
||||
* [Bluetooth](feature_bluetooth.md#bluetooth-keycodes)
|
||||
* [Quantum](quantum_keycodes.md)
|
||||
* [Audio](feature_audio.md#audio-keycodes)
|
||||
* [Backlight](feature_backlight.md#backlight-keycodes)
|
||||
* [Bootmagic](feature_bootmagic.md#bootmagic-keycodes)
|
||||
* [Bluetooth](feature_bluetooth.md#bluetooth-keycodes)
|
||||
* [Layer Switching](feature_advanced_keycodes.md#switching-and-toggling-layers)
|
||||
* [Mod+Key](feature_advanced_keycodes.md#modifier-keys)
|
||||
* [Mod Tap](feature_advanced_keycodes.md#mod-tap)
|
||||
* [Mouse Keys](feature_mouse_keys.md#mapping-mouse-actions-to-keyboard-keys)
|
||||
* [One Shot Keys](feature_advanced_keycodes.md#one-shot-keys)
|
||||
* [Quantum](quantum_keycodes.md)
|
||||
* [RGB Light](feature_rgblight.md#rgblight-keycodes)
|
||||
* [RGB Matrix](feature_rgb_matrix.md#keycodes)
|
||||
* [Shifted Keys](feature_advanced_keycodes.md#shifted-keycodes)
|
||||
* [Stenography](feature_stenography.md#keycode-reference)
|
||||
* [Swap Hands](feature_swap_hands.md#swap-keycodes)
|
||||
* [Thermal Printer](feature_thermal_printer.md#thermal-printer-keycodes)
|
||||
* [US ANSI Shifted Keys](keycodes_us_ansi_shifted.md)
|
||||
|
||||
|
@ -123,21 +123,27 @@ If you define these options you will enable the associated feature, which may in
|
||||
## Behaviors That Can Be Configured
|
||||
|
||||
* `#define TAPPING_TERM 200`
|
||||
* how long before a tap becomes a hold
|
||||
* how long before a tap becomes a hold, if set above 500, a key tapped during the tapping term will turn it into a hold too
|
||||
* `#define RETRO_TAPPING`
|
||||
* tap anyway, even after TAPPING_TERM, if there was no other key interruption between press and release
|
||||
* See [Retro Tapping](feature_advanced_keycodes.md#retro-tapping) for details
|
||||
* `#define TAPPING_TOGGLE 2`
|
||||
* how many taps before triggering the toggle
|
||||
* `#define PERMISSIVE_HOLD`
|
||||
* makes tap and hold keys work better for fast typers who don't want tapping term set above 500
|
||||
* See [Permissive Hold](feature_advanced_keycodes.md#permissive-hold) for details
|
||||
* `#define IGNORE_MOD_TAP_INTERRUPT`
|
||||
* makes it possible to do rolling combos (zx) with keys that convert to other keys on hold
|
||||
* See [Mod tap interrupt](feature_advanced_keycodes.md#mod-tap-interrupt) for details
|
||||
* `#define TAPPING_FORCE_HOLD`
|
||||
* makes it possible to use a dual role key as modifier shortly after having been tapped
|
||||
* See [Hold after tap](feature_advanced_keycodes.md#hold-after-tap)
|
||||
* `#define LEADER_TIMEOUT 300`
|
||||
* how long before the leader key times out
|
||||
* `#define ONESHOT_TIMEOUT 300`
|
||||
* how long before oneshot times out
|
||||
* `#define ONESHOT_TAP_TOGGLE 2`
|
||||
* how many taps before oneshot toggle is triggered
|
||||
* `#define IGNORE_MOD_TAP_INTERRUPT`
|
||||
* makes it possible to do rolling combos (zx) with keys that convert to other keys on hold
|
||||
* `#define QMK_KEYS_PER_SCAN 4`
|
||||
* Allows sending more than one key per scan. By default, only one key event gets
|
||||
sent via `process_record()` per scan. This has little impact on most typing, but
|
||||
|
@ -11,7 +11,7 @@ Third-party contributions help us grow and improve QMK. We want to make the pull
|
||||
|
||||
## I Don't Want to Read This Whole Thing! I Just Have a Question!
|
||||
|
||||
If you'd like to ask questions about QMK you can do so on the [OLKB Subreddit](https://reddit.com/r/olkb) or on [Gitter](https://gitter.im/qmk/qmk_firmware).
|
||||
If you'd like to ask questions about QMK you can do so on the [OLKB Subreddit](https://reddit.com/r/olkb) or on [Discord](https://discord.gg/Uq7gcHh).
|
||||
|
||||
Please keep these things in mind:
|
||||
|
||||
@ -29,7 +29,7 @@ QMK is largely written in C, with specific features and parts written in C++. It
|
||||
|
||||
# Where Can I Go for Help?
|
||||
|
||||
If you need help you can [open an issue](https://github.com/qmk/qmk_firmware/issues) or [chat on gitter](http://gitter.im/QMK/qmk_firmware).
|
||||
If you need help you can [open an issue](https://github.com/qmk/qmk_firmware/issues) or [chat on Discord](https://discord.gg/Uq7gcHh).
|
||||
|
||||
# How Do I Make a Contribution?
|
||||
|
||||
@ -124,7 +124,7 @@ We also ask that you follow these guidelines:
|
||||
|
||||
Before you put a lot of work into building your new feature you should make sure you are implementing it in the best way. You can get a basic understanding of QMK by reading [Understanding QMK](understanding_qmk.md), which will take you on a tour of the QMK program flow. From here you should talk to us to get a sense of the best way to implement your idea. There are two main ways to do this:
|
||||
|
||||
* [Chat on Gitter](https://gitter.im/qmk/qmk_firmware)
|
||||
* [Chat on Discord](https://discord.gg/Uq7gcHh)
|
||||
* [Open an Issue](https://github.com/qmk/qmk_firmware/issues/new)
|
||||
|
||||
Feature and Bug Fix PR's affect all keyboards. We are also in the process of restructuring QMK. For this reason it is especially important for significant changes to be discussed before implementation has happened. If you open a PR without talking to us first please be prepared to do some significant rework if your choices do not mesh well with our planned direction.
|
||||
|
@ -167,7 +167,7 @@ Whenever possible you should customize your keyboard by using `process_record_*(
|
||||
|
||||
### Example `matrix_scan_*` Implementation
|
||||
|
||||
This example has been deliberately omitted. You should understand enough about QMK internals to write this without an example before hooking into such a performance sensitive area. If you need help please [open an issue](https://github.com/qmk/qmk_firmware/issues/new) or [chat with us on gitter](https://gitter.im/qmk/qmk_firmware).
|
||||
This example has been deliberately omitted. You should understand enough about QMK internals to write this without an example before hooking into such a performance sensitive area. If you need help please [open an issue](https://github.com/qmk/qmk_firmware/issues/new) or [chat with us on Discord](https://discord.gg/Uq7gcHh).
|
||||
|
||||
### `matrix_scan_*` Function Documentation
|
||||
|
||||
|
@ -104,3 +104,17 @@ brew install dfu-programmer
|
||||
brew install gcc-arm-none-eabi
|
||||
brew install avrdude
|
||||
```
|
||||
|
||||
### avr-gcc 8.1 and LUFA
|
||||
|
||||
If you updated your avr-gcc to above 7 you may see errors involving LUFA. For example:
|
||||
|
||||
`lib/lufa/LUFA/Drivers/USB/Class/Device/AudioClassDevice.h:380:5: error: 'const' attribute on function returning 'void'`
|
||||
|
||||
For now, you need to rollback avr-gcc to 7 in brew.
|
||||
|
||||
```
|
||||
brew uninstall --force avr-gcc
|
||||
brew install avr-gcc@7
|
||||
brew link avr-gcc@7
|
||||
```
|
||||
|
@ -175,3 +175,37 @@ Example: (Tapping Term = 200ms)
|
||||
- SHFT_T(KC_A) Up
|
||||
|
||||
With defaults, if above is typed within tapping term, this will emit `ax`. With permissive hold, if above is typed within tapping term, this will emit `X` (so, Shift+X).
|
||||
|
||||
# Mod tap interrupt
|
||||
|
||||
When a dual role key used for a modifier is quickly followed by another keys, it is interpreted as held even before the tapping term elapsed. This is a problem if a key is used for example inside a rolling combo because the second key will be pressed before the first key is released.
|
||||
|
||||
For example, when trying to type the rolling combo "zx" and z being configured to send Ctrl when hold, z rapidly followed by x actually sends Ctrl-x. That's bad.
|
||||
|
||||
You can disable this behavior by defining `IGNORE_MOD_TAP_INTERRUPT` in `config.h`.
|
||||
|
||||
Note that this only concerns modifiers and not layer switching keys.
|
||||
|
||||
# Hold after tap
|
||||
|
||||
When the user holds a key after tap, this repeats the tapped key rather to hold a modifier key. This allows to use auto repeat for the tapped key. If you prefer to hold a modifier instead, define `TAPPING_FORCE_HOLD` in `config.h`.
|
||||
|
||||
Example:
|
||||
|
||||
- SHFT_T(KC_A) Down
|
||||
- SHFT_T(KC_A) Up
|
||||
- SHFT_T(KC_A) Down
|
||||
- wait more than tapping term...
|
||||
- SHFT_T(KC_A) Up
|
||||
|
||||
With default settings, `a` will be sent on the first release, then `a` will be sent on the second press allowing the computer to trigger its auto repeat function.
|
||||
|
||||
With `TAPPING_FORCE_HOLD`, the second press will be interpreted as a Shift, allowing to use it as a modifier shortly after having used it as a tap.
|
||||
|
||||
!> `TAPPING_FORCE_HOLD` will break anything that uses tapping toggles (Such as the `TT` layer keycode, and the One Shot Tapping Toggle).
|
||||
|
||||
# Retro Tapping
|
||||
|
||||
When you hold a dual function key, and haven't pressed anything when you release the key, normally nothing happens. However, if you enable this, if you release the key without pressing another key, it will send the original key, even if it is outside of the tapping term.
|
||||
|
||||
For instance, if you're using `LT(2, KC_SPACE)`, if you hold the key, don't hit anything else and then release it, normally, nothing happens. But with `RETRO_TAPPING` defined in your `config.h`, it will send `KC_SPACE`.
|
||||
|
@ -3,6 +3,7 @@
|
||||
Your keyboard can make sounds! If you've got a Planck, Preonic, or basically any AVR keyboard that allows access to certain PWM-capable pins, you can hook up a simple speaker and make it beep. You can use those beeps to indicate layer transitions, modifiers, special keys, or just to play some funky 8bit tunes.
|
||||
|
||||
Up to two simultaneous audio voices are supported, one driven by timer 1 and another driven by timer 3. The following pins can be defined as audio outputs in config.h:
|
||||
|
||||
Timer 1:
|
||||
`#define B5_AUDIO`
|
||||
`#define B6_AUDIO`
|
||||
@ -58,6 +59,13 @@ PLAY_LOOP(my_song);
|
||||
|
||||
It's advised that you wrap all audio features in `#ifdef AUDIO_ENABLE` / `#endif` to avoid causing problems when audio isn't built into the keyboard.
|
||||
|
||||
The available keycodes for audio are:
|
||||
|
||||
* `AU_ON` - Turn audio mode on
|
||||
* `AU_OFF` - Turn audio mode off
|
||||
* `AU_TOG` - Toggle audio mode
|
||||
|
||||
|
||||
## Music Mode
|
||||
|
||||
The music mode maps your columns to a chromatic scale, and your rows to octaves. This works best with ortholinear keyboards, but can be made to work with others. All keycodes less than `0xFF` get blocked, so you won't type while playing notes - if you have special keys/mods, those will still work. A work-around for this is to jump to a different layer with KC_NOs before (or after) enabling music mode.
|
||||
@ -145,6 +153,23 @@ You can configure the default, min and max frequencies, the stepping and built i
|
||||
|
||||
This is still a WIP, but check out `quantum/keymap_midi.c` to see what's happening. Enable from the Makefile.
|
||||
|
||||
|
||||
## Audio Keycodes
|
||||
|
||||
|Key |Aliases |Description |
|
||||
|----------------|---------|----------------------------------|
|
||||
|`AU_ON` | |Audio mode on |
|
||||
|`AU_OFF` | |Audio mode off |
|
||||
|`AU_TOG` | |Toggles Audio mode |
|
||||
|`CLICKY_TOGGLE` |`CK_TOGG`|Toggles Audio clicky mode |
|
||||
|`CLICKY_UP` |`CK_UP` |Increases frequency of the clicks |
|
||||
|`CLICKY_DOWN` |`CK_DOWN`|Decreases frequency of the clicks |
|
||||
|`CLICKY_RESET` |`CK_RST` |Resets frequency to default |
|
||||
|`MU_ON` | |Turns on Music Mode |
|
||||
|`MU_OFF` | |Turns off Music Mode |
|
||||
|`MU_TOG` | |Toggles Music Mode |
|
||||
|`MU_MOD` | |Cycles through the music modes |
|
||||
|
||||
<!-- FIXME: this formatting needs work
|
||||
|
||||
## Audio
|
||||
|
56
docs/feature_hd44780.md
Normal file
56
docs/feature_hd44780.md
Normal file
@ -0,0 +1,56 @@
|
||||
# HD44780 LCD Displays
|
||||
|
||||
This is an integration of Peter Fleury's LCD library. This page will explain the basics. [For in depth documentation visit his page.](http://homepage.hispeed.ch/peterfleury/doxygen/avr-gcc-libraries/group__pfleury__lcd.html)
|
||||
|
||||
You can enable support for HD44780 Displays by setting the `HD44780_ENABLE` flag in your keyboards `rules.mk` to yes. This will use about 400 KB of extra space.
|
||||
|
||||
## Configuration
|
||||
|
||||
You will need to configure the pins used by your display and its number of lines and collumn in your keyboards `config.h`.
|
||||
|
||||
Uncomment the section labled HD44780 and change the parameters as needed.
|
||||
````
|
||||
/*
|
||||
* 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
|
||||
````
|
||||
|
||||
Should you need to configure other properties you can copy them from `quantum/hd44780.h` and set them in your `config.h`
|
||||
|
||||
## Usage
|
||||
|
||||
To initialize your display call lcd_init() with one of these parameters:
|
||||
````
|
||||
LCD_DISP_OFF : display off
|
||||
LCD_DISP_ON : display on, cursor off
|
||||
LCD_DISP_ON_CURSOR : display on, cursor on
|
||||
LCD_DISP_ON_CURSOR_BLINK : display on, cursor on flashing
|
||||
````
|
||||
This is best done in your keyboards `matrix_init_kb` or your keymaps `matrix_init_user`.
|
||||
It is advised to clear the display before use.
|
||||
To do so call `lcd_clrsrc()`.
|
||||
|
||||
To now print something to your Display you first call `lcd_gotoxy(column, line)`. To go to the start of the first line you would call `lcd_gotoxy(0, 0)` and then print a string with `lcd_puts("example string")`.
|
||||
|
||||
There are more posible methods to control the display. [For in depth documentation please visit the linked page.](http://homepage.hispeed.ch/peterfleury/doxygen/avr-gcc-libraries/group__pfleury__lcd.html)
|
@ -119,6 +119,7 @@ A similar function works in the keymap as `rgb_matrix_indicators_user`.
|
||||
#define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects
|
||||
#define RGB_DISABLE_WHEN_USB_SUSPENDED false // turn off effects when suspended
|
||||
#define RGB_MATRIX_SKIP_FRAMES 1 // number of frames to skip when displaying animations (0 is full effect) if not defined defaults to 1
|
||||
#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200 // limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255
|
||||
|
||||
## EEPROM storage
|
||||
|
||||
|
@ -9,6 +9,7 @@ QMK has a staggering number of features for building your keyboard. It can take
|
||||
* [Backlight](feature_backlight.md) - LED lighting support for your keyboard.
|
||||
* [Bootmagic](feature_bootmagic.md) - Adjust the behavior of your keyboard using hotkeys.
|
||||
* [Dynamic Macros](feature_dynamic_macros.md) - Record and playback macros from the keyboard itself.
|
||||
* [HD44780 LCD Display](feature_hd44780.md) - Support for LCD character displays using the HD44780 standard.
|
||||
* [Key Lock](feature_key_lock.md) - Lock a key in the "down" state.
|
||||
* [Layouts](feature_layouts.md) - Use one keymap with any keyboard that supports your layout.
|
||||
* [Leader Key](feature_leader_key.md) - Tap the leader key followed by a sequence to trigger custom behavior.
|
||||
|
@ -56,7 +56,7 @@ If you're using [homebrew,](http://brew.sh/) you can use the following commands:
|
||||
brew tap osx-cross/avr
|
||||
brew tap PX4/homebrew-px4
|
||||
brew update
|
||||
brew install avr-gcc
|
||||
brew install avr-gcc@7
|
||||
brew install dfu-programmer
|
||||
brew install gcc-arm-none-eabi
|
||||
brew install avrdude
|
||||
|
@ -4,13 +4,7 @@ There are a lot of resources for getting help with QMK.
|
||||
|
||||
## Realtime Chat
|
||||
|
||||
You can find QMK developers and users on our main [gitter chat room](https://gitter.im/qmk/qmk_firmware). We also have other rooms for more specific discussion:
|
||||
|
||||
* [Main Firmware Chat](https://gitter.im/qmk/qmk_firmware)
|
||||
* [QMK Toolbox](https://gitter.im/qmk/qmk_toolbox)
|
||||
* [Hardware Design Discussion](https://gitter.im/qmk/qmk_hardware)
|
||||
* [Web Configurator](https://gitter.im/qmk/qmk_configurator)
|
||||
* [Compiler API](https://gitter.im/qmk/qmk_compiler_api)
|
||||
You can find QMK developers and users on our main [Discord server](https://discord.gg/Uq7gcHh). There are specific channels in the server for chatting about the firmware, Toolbox, hardware, and configurator.
|
||||
|
||||
## OLKB Subreddit
|
||||
|
||||
|
@ -19,8 +19,7 @@ And be sure to select "HTTPS", and select the link and copy it:
|
||||
From here, enter `git clone ` into the command line, and then paste your link:
|
||||
|
||||
```
|
||||
**[terminal]
|
||||
**[prompt you@computer]**[path ~]**[delimiter $ ]**[command git clone https://github.com/whoeveryouare/qmk_firmware.git]
|
||||
user@computer:~$ git clone https://github.com/whoeveryouare/qmk_firmware.git
|
||||
Cloning into 'qmk_firmware'...
|
||||
remote: Counting objects: 46625, done.
|
||||
remote: Compressing objects: 100% (2/2), done.
|
||||
@ -33,13 +32,12 @@ Checking out files: 100% (2799/2799), done.
|
||||
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:
|
||||
|
||||
```
|
||||
**[terminal]
|
||||
**[prompt you@computer]**[path ~/qmk_firmware]**[delimiter $ ]**[command git add .]
|
||||
**[prompt you@computer]**[path ~/qmk_firmware]**[delimiter $ ]**[command git commit -m "adding my keymap"]
|
||||
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
|
||||
**[prompt you@computer]**[path ~/qmk_firmware]**[delimiter $ ]**[command git push]
|
||||
user@computer:~$ git push
|
||||
Counting objects: 1, done.
|
||||
Delta compression using up to 4 threads.
|
||||
Compressing objects: 100% (1/1), done.
|
||||
|
@ -6,12 +6,16 @@ This page attempts to explain the basic information you need to know to work wit
|
||||
|
||||
QMK is a fork of [Jun Wako](https://github.com/tmk)'s [tmk_keyboard](https://github.com/tmk/tmk_keyboard) project. The original TMK code, with modifications, can be found in the `tmk` folder. The QMK additions to the project may be found in the `quantum` folder. Keyboard projects may be found in the `handwired` and `keyboard` folders.
|
||||
|
||||
### Userspace Structure
|
||||
|
||||
Within the folder `users` is a directory for each user. This is a place for users to put code that they might use between keyboards. See the docs for [Userspace feature](feature_userspace.md) for more information.
|
||||
|
||||
### Keyboard Project Structure
|
||||
|
||||
Within the folder `keyboards` and its subfolder `handwired` is a directory for each keyboard project, for example `qmk_firmware/keyboards/clueboard`. Within it you'll find the following structure:
|
||||
|
||||
* `keymaps/`: Different keymaps that can be built
|
||||
* `rules.mk`: The file that sets the default "make" options. Do not edit this file directly, instead use a keymap specific `Makefile`
|
||||
* `rules.mk`: The file that sets the default "make" options. Do not edit this file directly, instead use a keymap specific `rules.mk`.
|
||||
* `config.h`: The file that sets the default compile time options. Do not edit this file directly, instead use a keymap specific `config.h`.
|
||||
|
||||
### Keymap Structure
|
||||
@ -25,23 +29,26 @@ In every keymap folder, the following files may be found. Only `keymap.c` is req
|
||||
|
||||
# The `config.h` File
|
||||
|
||||
There are 2 `config.h` locations:
|
||||
There are 3 possible `config.h` locations:
|
||||
|
||||
* keyboard (`/keyboards/<keyboard>/config.h`)
|
||||
* userspace (`/users/<user>/config.h`)
|
||||
* keymap (`/keyboards/<keyboard>/keymaps/<keymap>/config.h`)
|
||||
|
||||
If the keymap `config.h` exists, that file is included by the build system and the keyboard `config.h` is not included. If you wish to override settings in your keymap's `config.h` you will need to include some glue code:
|
||||
The build system automatically picks up the config files in the above order. If you wish to override any setting set by a previous `config.h` you will need to first include some boilerplate code for the settings you wish to change.
|
||||
|
||||
```
|
||||
#ifndef CONFIG_USER_H
|
||||
#define CONFIG_USER_H
|
||||
|
||||
#include "config_common.h"
|
||||
#pragma once
|
||||
```
|
||||
|
||||
If you want to override a setting from the parent `config.h` file, you need to `#undef` and then `#define` the setting again, like this:
|
||||
Then to override a setting from the previous `config.h` file you must `#undef` and then `#define` the setting again.
|
||||
|
||||
```c
|
||||
The boilerplate code and setting look like this together:
|
||||
|
||||
```
|
||||
#pragma once
|
||||
|
||||
// overrides go here!
|
||||
#undef MY_SETTING
|
||||
#define MY_SETTING 4
|
||||
```
|
||||
|
206
docs/keycodes.md
206
docs/keycodes.md
@ -167,6 +167,7 @@ This is a reference only. Each group of keys links to the page documenting their
|
||||
|`KC_MEDIA_STOP` |`KC_MSTP` |Stop Track |
|
||||
|`KC_MEDIA_PLAY_PAUSE` |`KC_MPLY` |Play/Pause Track |
|
||||
|`KC_MEDIA_SELECT` |`KC_MSEL` | |
|
||||
|`KC_MEDIA_EJECT` |`KC_EJCT` |Eject (macOS) |
|
||||
|`KC_NUMLOCK` |`KC_NLCK` |Keypad Num Lock and Clear |
|
||||
|`KC_KP_SLASH` |`KC_PSLS` |Keypad `/` |
|
||||
|`KC_KP_ASTERISK` |`KC_PAST` |Keypad `*` |
|
||||
@ -190,27 +191,6 @@ This is a reference only. Each group of keys links to the page documenting their
|
||||
|`KC_NO` | |Ignore this key (NOOP) |
|
||||
|`KC_TRANSPARENT` |`KC_TRNS` |Use the next lowest non-transparent key |
|
||||
|
||||
## [Mouse Keys](feature_mouse_keys.md)
|
||||
|
||||
|Key |Aliases |Description |
|
||||
|----------------|---------|---------------------------|
|
||||
|`KC_MS_UP` |`KC_MS_U`|Mouse Cursor Up |
|
||||
|`KC_MS_DOWN` |`KC_MS_D`|Mouse Cursor Down |
|
||||
|`KC_MS_LEFT` |`KC_MS_L`|Mouse Cursor Left |
|
||||
|`KC_MS_RIGHT` |`KC_MS_R`|Mouse Cursor Right |
|
||||
|`KC_MS_BTN1` |`KC_BTN1`|Mouse Button 1 |
|
||||
|`KC_MS_BTN2` |`KC_BTN2`|Mouse Button 2 |
|
||||
|`KC_MS_BTN3` |`KC_BTN3`|Mouse Button 3 |
|
||||
|`KC_MS_BTN4` |`KC_BTN4`|Mouse Button 4 |
|
||||
|`KC_MS_BTN5` |`KC_BTN5`|Mouse Button 5 |
|
||||
|`KC_MS_WH_UP` |`KC_WH_U`|Mouse Wheel Up |
|
||||
|`KC_MS_WH_DOWN` |`KC_WH_D`|Mouse Wheel Down |
|
||||
|`KC_MS_WH_LEFT` |`KC_WH_L`|Mouse Wheel Left |
|
||||
|`KC_MS_WH_RIGHT`|`KC_WH_R`|Mouse Wheel Right |
|
||||
|`KC_MS_ACCEL0` |`KC_ACL0`|Set mouse acceleration to 0|
|
||||
|`KC_MS_ACCEL1` |`KC_ACL1`|Set mouse acceleration to 1|
|
||||
|`KC_MS_ACCEL2` |`KC_ACL2`|Set mouse acceleration to 2|
|
||||
|
||||
## [Quantum Keycodes](quantum_keycodes.md#qmk-keycodes)
|
||||
|
||||
|Key |Aliases |Description |
|
||||
@ -226,6 +206,36 @@ This is a reference only. Each group of keys links to the page documenting their
|
||||
|`M(n)` | |Call macro `n` |
|
||||
|`MACROTAP(n)`| |Macro-tap `n` idk FIXME |
|
||||
|
||||
## [Audio Keys](feature_audio.md)
|
||||
|
||||
|Key |Aliases |Description |
|
||||
|----------------|---------|----------------------------------|
|
||||
|`AU_ON` | |Audio mode on |
|
||||
|`AU_OFF` | |Audio mode off |
|
||||
|`AU_TOG` | |Toggles Audio mode |
|
||||
|`CLICKY_TOGGLE` |`CK_TOGG`|Toggles Audio clicky mode |
|
||||
|`CLICKY_UP` |`CK_UP` |Increases frequency of the clicks |
|
||||
|`CLICKY_DOWN` |`CK_DOWN`|Decreases frequency of the clicks |
|
||||
|`CLICKY_RESET` |`CK_RST` |Resets frequency to default |
|
||||
|`MU_ON` | |Turns on Music Mode |
|
||||
|`MU_OFF` | |Turns off Music Mode |
|
||||
|`MU_TOG` | |Toggles Music Mode |
|
||||
|`MU_MOD` | |Cycles through the music modes |
|
||||
|
||||
|
||||
|
||||
## [Backlighting](feature_backlight.md)
|
||||
|
||||
|Key |Description |
|
||||
|---------|------------------------------------------|
|
||||
|`BL_TOGG`|Turn the backlight on or off |
|
||||
|`BL_STEP`|Cycle through backlight levels |
|
||||
|`BL_ON` |Set the backlight to max brightness |
|
||||
|`BL_OFF` |Turn the backlight off |
|
||||
|`BL_INC` |Increase the backlight level |
|
||||
|`BL_DEC` |Decrease the backlight level |
|
||||
|`BL_BRTG`|Toggle backlight breathing |
|
||||
|
||||
## [Bootmagic](feature_bootmagic.md)
|
||||
|
||||
|Key |Aliases |Description |
|
||||
@ -250,17 +260,88 @@ This is a reference only. Each group of keys links to the page documenting their
|
||||
|`MAGIC_UNSWAP_ALT_GUI` |`AG_NORM`|Unswap Alt and GUI on both sides |
|
||||
|`MAGIC_TOGGLE_NKRO` | |Turn NKRO on or off |
|
||||
|
||||
## [Backlighting](feature_backlight.md)
|
||||
## [Bluetooth](feature_bluetooth.md)
|
||||
|
||||
|Key |Description |
|
||||
|---------|------------------------------------------|
|
||||
|`BL_TOGG`|Turn the backlight on or off |
|
||||
|`BL_STEP`|Cycle through backlight levels |
|
||||
|`BL_ON` |Set the backlight to max brightness |
|
||||
|`BL_OFF` |Turn the backlight off |
|
||||
|`BL_INC` |Increase the backlight level |
|
||||
|`BL_DEC` |Decrease the backlight level |
|
||||
|`BL_BRTG`|Toggle backlight breathing |
|
||||
|Key |Description |
|
||||
|----------|----------------------------------------------|
|
||||
|`OUT_AUTO`|Automatically switch between USB and Bluetooth|
|
||||
|`OUT_USB` |USB only |
|
||||
|`OUT_BT` |Bluetooth only |
|
||||
|
||||
|
||||
## [Layer Switching](feature_advanced_keycodes.md# Switching and Toggling Layers)
|
||||
|
||||
|Key |Description |
|
||||
|-----------------|---------------------------------------------------------------------|
|
||||
|`DF(layer)` |Switches the default layer |
|
||||
|`MO(layer)` |Momentarily activates layer, switches off when you let go |
|
||||
|`LM(layer, mod)` |As `MO(layer)` but with `mod` active |
|
||||
|`LT(layer, kc)` |Momentarily activates layer if held, sends kc if tapped |
|
||||
|`TG(layer)` |Toggles the layer (enables it if no active, and vise versa) |
|
||||
|`TO(layer)` |Activates layer and deactivates all other layers |
|
||||
|`TT(layer)` |Momentarily activates layer if held, toggles it if tapped repeatedly |
|
||||
|
||||
## [Mouse Keys](feature_mouse_keys.md)
|
||||
|
||||
|Key |Aliases |Description |
|
||||
|----------------|---------|---------------------------|
|
||||
|`KC_MS_UP` |`KC_MS_U`|Mouse Cursor Up |
|
||||
|`KC_MS_DOWN` |`KC_MS_D`|Mouse Cursor Down |
|
||||
|`KC_MS_LEFT` |`KC_MS_L`|Mouse Cursor Left |
|
||||
|`KC_MS_RIGHT` |`KC_MS_R`|Mouse Cursor Right |
|
||||
|`KC_MS_BTN1` |`KC_BTN1`|Mouse Button 1 |
|
||||
|`KC_MS_BTN2` |`KC_BTN2`|Mouse Button 2 |
|
||||
|`KC_MS_BTN3` |`KC_BTN3`|Mouse Button 3 |
|
||||
|`KC_MS_BTN4` |`KC_BTN4`|Mouse Button 4 |
|
||||
|`KC_MS_BTN5` |`KC_BTN5`|Mouse Button 5 |
|
||||
|`KC_MS_WH_UP` |`KC_WH_U`|Mouse Wheel Up |
|
||||
|`KC_MS_WH_DOWN` |`KC_WH_D`|Mouse Wheel Down |
|
||||
|`KC_MS_WH_LEFT` |`KC_WH_L`|Mouse Wheel Left |
|
||||
|`KC_MS_WH_RIGHT`|`KC_WH_R`|Mouse Wheel Right |
|
||||
|`KC_MS_ACCEL0` |`KC_ACL0`|Set mouse acceleration to 0|
|
||||
|`KC_MS_ACCEL1` |`KC_ACL1`|Set mouse acceleration to 1|
|
||||
|`KC_MS_ACCEL2` |`KC_ACL2`|Set mouse acceleration to 2|
|
||||
|
||||
## [Modifiers](feature_advanced_keycodes.md#modifier-keys)
|
||||
|
||||
|Key |Aliases |Description |
|
||||
|----------|---------- |----------------------------------------------------|
|
||||
|`KC_HYPR` | |Hold Left Control, Shift, Alt and GUI |
|
||||
|`KC_MEH` | |Hold Left Control, Shift and Alt |
|
||||
|`LCTL(kc)`| |Hold Left Control and press `kc` |
|
||||
|`LSFT(kc)`|`S(kc)` |Hold Left Shift and press `kc` |
|
||||
|`LALT(kc)`| |Hold Left Alt and press `kc` |
|
||||
|`LGUI(kc)`|`LCMD(kc)`, `LWIN(kc)`|Hold Left GUI and press `kc` |
|
||||
|`RCTL(kc)`| |Hold Right Control and press `kc` |
|
||||
|`RSFT(kc)`| |Hold Right Shift and press `kc` |
|
||||
|`RALT(kc)`| |Hold Right Alt and press `kc` |
|
||||
|`RGUI(kc)`|`RCMD(kc)`, `LWIN(kc)`|Hold Right GUI and press `kc` |
|
||||
|`HYPR(kc)`| |Hold Left Control, Shift, Alt and GUI and press `kc`|
|
||||
|`MEH(kc)` | |Hold Left Control, Shift and Alt and press `kc` |
|
||||
|`LCAG(kc)`| |Hold Left Control, Alt and GUI and press `kc` |
|
||||
|`ALTG(kc)`| |Hold Right Control and Alt and press `kc` |
|
||||
|`SGUI(kc)`|`SCMD(kc)`, `SWIN(kc)`|Hold Left Shift and GUI and press `kc` |
|
||||
|`LCA(kc)` | |Hold Left Control and Alt and press `kc` |
|
||||
|
||||
## [Mod-Tap Keys](feature_advanced_keycodes.md#mod-tap)
|
||||
|
||||
|Key |Aliases |Description |
|
||||
|------------|---------------------------------------|-------------------------------------------------------|
|
||||
|`LCTL_T(kc)`|`CTL_T(kc)` |Left Control when held, `kc` when tapped |
|
||||
|`RCTL_T(kc)`| |Right Control when held, `kc` when tapped |
|
||||
|`LSFT_T(kc)`|`SFT_T(kc)` |Left Shift when held, `kc` when tapped |
|
||||
|`RSFT_T(kc)`| |Right Shift when held, `kc` when tapped |
|
||||
|`LALT_T(kc)`|`ALT_T(kc)` |Left Alt when held, `kc` when tapped |
|
||||
|`RALT_T(kc)`|`ALGR_T(kc)` |Right Alt when held, `kc` when tapped |
|
||||
|`LGUI_T(kc)`|`LCMD_T(kc)`, `RWIN_T(kc)`, `GUI_T(kc)`|Left GUI when held, `kc` when tapped |
|
||||
|`RGUI_T(kc)`|`RCMD_T(kc)`, `RWIN_T(kc)` |Right GUI when held, `kc` when tapped |
|
||||
|`C_S_T(kc)` | |Left Control and Shift when held, `kc` when tapped |
|
||||
|`MEH_T(kc)` | |Left Control, Shift and Alt when held, `kc` when tapped|
|
||||
|`LCAG_T(kc)`| |Left Control, Alt and GUI when held, `kc` when tapped |
|
||||
|`RCAG_T(kc)`| |Right Control, Alt and GUI when held, `kc` when tapped |
|
||||
|`ALL_T(kc)` | |Left Control, Shift, Alt and GUI when held, `kc` when tapped - more info [here](http://brettterpstra.com/2012/12/08/a-useful-caps-lock-key/)|
|
||||
|`SCMD_T(kc)`|`SWIN_T(kc)` |Left Shift and GUI when held, `kc` when tapped |
|
||||
|`LCA_T(kc)` | |Left Control and Alt when held, `kc` when tapped |
|
||||
|
||||
## [RGB Lighting](feature_rgblight.md)
|
||||
|
||||
@ -308,55 +389,6 @@ This is a reference only. Each group of keys links to the page documenting their
|
||||
|`PRINT_ON` |Start printing everything the user types|
|
||||
|`PRINT_OFF`|Stop printing everything the user types |
|
||||
|
||||
## [Bluetooth](feature_bluetooth.md)
|
||||
|
||||
|Key |Description |
|
||||
|----------|----------------------------------------------|
|
||||
|`OUT_AUTO`|Automatically switch between USB and Bluetooth|
|
||||
|`OUT_USB` |USB only |
|
||||
|`OUT_BT` |Bluetooth only |
|
||||
|
||||
## [Modifiers](quantum_keycodes.md#modifiers)
|
||||
|
||||
|Key |Aliases |Description |
|
||||
|----------|---------- |----------------------------------------------------|
|
||||
|`KC_HYPR` | |Hold Left Control, Shift, Alt and GUI |
|
||||
|`KC_MEH` | |Hold Left Control, Shift and Alt |
|
||||
|`LCTL(kc)`| |Hold Left Control and press `kc` |
|
||||
|`LSFT(kc)`|`S(kc)` |Hold Left Shift and press `kc` |
|
||||
|`LALT(kc)`| |Hold Left Alt and press `kc` |
|
||||
|`LGUI(kc)`|`LCMD(kc)`, `LWIN(kc)`|Hold Left GUI and press `kc` |
|
||||
|`RCTL(kc)`| |Hold Right Control and press `kc` |
|
||||
|`RSFT(kc)`| |Hold Right Shift and press `kc` |
|
||||
|`RALT(kc)`| |Hold Right Alt and press `kc` |
|
||||
|`RGUI(kc)`|`RCMD(kc)`, `LWIN(kc)`|Hold Right GUI and press `kc` |
|
||||
|`HYPR(kc)`| |Hold Left Control, Shift, Alt and GUI and press `kc`|
|
||||
|`MEH(kc)` | |Hold Left Control, Shift and Alt and press `kc` |
|
||||
|`LCAG(kc)`| |Hold Left Control, Alt and GUI and press `kc` |
|
||||
|`ALTG(kc)`| |Hold Right Control and Alt and press `kc` |
|
||||
|`SGUI(kc)`|`SCMD(kc)`, `SWIN(kc)`|Hold Left Shift and GUI and press `kc` |
|
||||
|`LCA(kc)` | |Hold Left Control and Alt and press `kc` |
|
||||
|
||||
## [Mod-Tap Keys](quantum_keycodes.md#mod-tap-keys)
|
||||
|
||||
|Key |Aliases |Description |
|
||||
|------------|---------------------------------------|-------------------------------------------------------|
|
||||
|`LCTL_T(kc)`|`CTL_T(kc)` |Left Control when held, `kc` when tapped |
|
||||
|`RCTL_T(kc)`| |Right Control when held, `kc` when tapped |
|
||||
|`LSFT_T(kc)`|`SFT_T(kc)` |Left Shift when held, `kc` when tapped |
|
||||
|`RSFT_T(kc)`| |Right Shift when held, `kc` when tapped |
|
||||
|`LALT_T(kc)`|`ALT_T(kc)` |Left Alt when held, `kc` when tapped |
|
||||
|`RALT_T(kc)`|`ALGR_T(kc)` |Right Alt when held, `kc` when tapped |
|
||||
|`LGUI_T(kc)`|`LCMD_T(kc)`, `RWIN_T(kc)`, `GUI_T(kc)`|Left GUI when held, `kc` when tapped |
|
||||
|`RGUI_T(kc)`|`RCMD_T(kc)`, `RWIN_T(kc)` |Right GUI when held, `kc` when tapped |
|
||||
|`C_S_T(kc)` | |Left Control and Shift when held, `kc` when tapped |
|
||||
|`MEH_T(kc)` | |Left Control, Shift and Alt when held, `kc` when tapped|
|
||||
|`LCAG_T(kc)`| |Left Control, Alt and GUI when held, `kc` when tapped |
|
||||
|`RCAG_T(kc)`| |Right Control, Alt and GUI when held, `kc` when tapped |
|
||||
|`ALL_T(kc)` | |Left Control, Shift, Alt and GUI when held, `kc` when tapped - more info [here](http://brettterpstra.com/2012/12/08/a-useful-caps-lock-key/)|
|
||||
|`SCMD_T(kc)`|`SWIN_T(kc)` |Left Shift and GUI when held, `kc` when tapped |
|
||||
|`LCA_T(kc)` | |Left Control and Alt when held, `kc` when tapped |
|
||||
|
||||
## [US ANSI Shifted Keys](keycodes_us_ansi_shifted.md)
|
||||
|
||||
|Key |Aliases |Description |
|
||||
@ -395,19 +427,13 @@ This is a reference only. Each group of keys links to the page documenting their
|
||||
|`TT(layer)` |Normally acts like MO unless it's tapped multiple times, which toggles `layer` on |
|
||||
|`LM(layer, mod)`|Momentarily turn on `layer` (like MO) with `mod` active as well. |
|
||||
|
||||
## [One Shot Keys](quantum_keycodes.md#one-shot-keys)
|
||||
## [One Shot Keys](feature_advanced_keycodes.md#one-shot-keys)
|
||||
|
||||
|Key |Description |
|
||||
|------------|----------------------------------|
|
||||
|`OSM(mod)` |Hold `mod` for one keypress |
|
||||
|`OSL(layer)`|Switch to `layer` for one keypress|
|
||||
|
||||
## [Unicode Support](feature_unicode.md)
|
||||
|
||||
|Key |Aliases| |
|
||||
|------------|-------|-------------------------------------------------|
|
||||
|`UNICODE(n)`|`UC(n)`|Send Unicode character `n` |
|
||||
|`X(n)` | |Send Unicode character `n` via a different method|
|
||||
|
||||
## [Swap Hands](feature_swap_hands.md)
|
||||
|
||||
@ -420,3 +446,9 @@ This is a reference only. Each group of keys links to the page documenting their
|
||||
|`SH_MOFF` |Momentarily turns off swap. |
|
||||
|`SH_TG` |Toggles swap on and off with every key press. |
|
||||
|`SH_TT` |Toggles with a tap; momentary when held. |
|
||||
## [Unicode Support](feature_unicode.md)
|
||||
|
||||
|Key |Aliases| |
|
||||
|------------|-------|-------------------------------------------------|
|
||||
|`UNICODE(n)`|`UC(n)`|Send Unicode character `n` |
|
||||
|`X(n)` | |Send Unicode character `n` via a different method|
|
||||
|
@ -194,6 +194,7 @@ Windows and macOS use different keycodes for "next track" and "previous track".
|
||||
|`KC_MEDIA_STOP` |`KC_MSTP`|Stop Track |
|
||||
|`KC_MEDIA_PLAY_PAUSE` |`KC_MPLY`|Play/Pause Track |
|
||||
|`KC_MEDIA_SELECT` |`KC_MSEL`| |
|
||||
|`KC_MEDIA_EJECT` |`KC_EJCT`|Eject (macOS) |
|
||||
|
||||
## Number Pad
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# The Compelete Newbs Guide To QMK
|
||||
# The Complete Newbs Guide To QMK
|
||||
|
||||
QMK is a powerful Open Source firmware for your mechanical keyboard. You can use QMK to customize your keyboard in ways both simple and powerful. People of all skill levels, from complete newbie to master programmer, have successfully used QMK to customize their keyboard. This guide will help you do the same, no matter your skill level.
|
||||
|
||||
@ -12,5 +12,7 @@ There are 4 main sections to this guide:
|
||||
* [Building Your First Firmware](newbs_building_firmware.md)
|
||||
* [Flashing Firmware](newbs_flashing.md)
|
||||
* [Testing and Debugging](newbs_testing_debugging.md)
|
||||
* [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).
|
||||
|
||||
|
13
docs/newbs_learn_more_resources.md
Normal file
13
docs/newbs_learn_more_resources.md
Normal file
@ -0,0 +1,13 @@
|
||||
# Learning Resources
|
||||
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)
|
||||
|
||||
|
||||
Command Line resources:
|
||||
*[Good General Tutorial on Command Line](https://www.codecademy.com/learn/learn-the-command-line)
|
592
drivers/avr/hd44780.c
Normal file
592
drivers/avr/hd44780.c
Normal file
File diff suppressed because it is too large
Load Diff
371
drivers/avr/hd44780.h
Normal file
371
drivers/avr/hd44780.h
Normal file
File diff suppressed because it is too large
Load Diff
@ -6,6 +6,7 @@
|
||||
#include <util/twi.h>
|
||||
|
||||
#include "i2c_master.h"
|
||||
#include "timer.h"
|
||||
|
||||
#define F_SCL 400000UL // SCL frequency
|
||||
#define Prescaler 1
|
||||
@ -13,137 +14,205 @@
|
||||
|
||||
void i2c_init(void)
|
||||
{
|
||||
TWSR = 0; /* no prescaler */
|
||||
TWBR = (uint8_t)TWBR_val;
|
||||
}
|
||||
|
||||
uint8_t i2c_start(uint8_t address)
|
||||
i2c_status_t i2c_start(uint8_t address, uint16_t timeout)
|
||||
{
|
||||
// reset TWI control register
|
||||
TWCR = 0;
|
||||
// transmit START condition
|
||||
// transmit START condition
|
||||
TWCR = (1<<TWINT) | (1<<TWSTA) | (1<<TWEN);
|
||||
// wait for end of transmission
|
||||
while( !(TWCR & (1<<TWINT)) );
|
||||
|
||||
|
||||
uint16_t timeout_timer = timer_read();
|
||||
while( !(TWCR & (1<<TWINT)) ) {
|
||||
if ((timeout != I2C_TIMEOUT_INFINITE) && ((timer_read() - timeout_timer) >= timeout)) {
|
||||
return I2C_STATUS_TIMEOUT;
|
||||
}
|
||||
}
|
||||
|
||||
// check if the start condition was successfully transmitted
|
||||
if((TWSR & 0xF8) != TW_START){ return 1; }
|
||||
|
||||
if(((TW_STATUS & 0xF8) != TW_START) && ((TW_STATUS & 0xF8) != TW_REP_START)){ return I2C_STATUS_ERROR; }
|
||||
|
||||
// load slave address into data register
|
||||
TWDR = address;
|
||||
// start transmission of address
|
||||
TWCR = (1<<TWINT) | (1<<TWEN);
|
||||
// wait for end of transmission
|
||||
while( !(TWCR & (1<<TWINT)) );
|
||||
|
||||
|
||||
timeout_timer = timer_read();
|
||||
while( !(TWCR & (1<<TWINT)) ) {
|
||||
if ((timeout != I2C_TIMEOUT_INFINITE) && ((timer_read() - timeout_timer) >= timeout)) {
|
||||
return I2C_STATUS_TIMEOUT;
|
||||
}
|
||||
}
|
||||
|
||||
// check if the device has acknowledged the READ / WRITE mode
|
||||
uint8_t twst = TW_STATUS & 0xF8;
|
||||
if ( (twst != TW_MT_SLA_ACK) && (twst != TW_MR_SLA_ACK) ) return 1;
|
||||
|
||||
return 0;
|
||||
if ( (twst != TW_MT_SLA_ACK) && (twst != TW_MR_SLA_ACK) ) return I2C_STATUS_ERROR;
|
||||
|
||||
return I2C_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
uint8_t i2c_write(uint8_t data)
|
||||
i2c_status_t i2c_write(uint8_t data, uint16_t timeout)
|
||||
{
|
||||
// load data into data register
|
||||
TWDR = data;
|
||||
// start transmission of data
|
||||
TWCR = (1<<TWINT) | (1<<TWEN);
|
||||
// wait for end of transmission
|
||||
while( !(TWCR & (1<<TWINT)) );
|
||||
|
||||
if( (TWSR & 0xF8) != TW_MT_DATA_ACK ){ return 1; }
|
||||
|
||||
return 0;
|
||||
|
||||
uint16_t timeout_timer = timer_read();
|
||||
while( !(TWCR & (1<<TWINT)) ) {
|
||||
if ((timeout != I2C_TIMEOUT_INFINITE) && ((timer_read() - timeout_timer) >= timeout)) {
|
||||
return I2C_STATUS_TIMEOUT;
|
||||
}
|
||||
}
|
||||
|
||||
if( (TW_STATUS & 0xF8) != TW_MT_DATA_ACK ){ return I2C_STATUS_ERROR; }
|
||||
|
||||
return I2C_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
uint8_t i2c_read_ack(void)
|
||||
int16_t i2c_read_ack(uint16_t timeout)
|
||||
{
|
||||
|
||||
|
||||
// start TWI module and acknowledge data after reception
|
||||
TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWEA);
|
||||
// wait for end of transmission
|
||||
while( !(TWCR & (1<<TWINT)) );
|
||||
TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWEA);
|
||||
|
||||
uint16_t timeout_timer = timer_read();
|
||||
while( !(TWCR & (1<<TWINT)) ) {
|
||||
if ((timeout != I2C_TIMEOUT_INFINITE) && ((timer_read() - timeout_timer) >= timeout)) {
|
||||
return I2C_STATUS_TIMEOUT;
|
||||
}
|
||||
}
|
||||
|
||||
// return received data from TWDR
|
||||
return TWDR;
|
||||
}
|
||||
|
||||
uint8_t i2c_read_nack(void)
|
||||
int16_t i2c_read_nack(uint16_t timeout)
|
||||
{
|
||||
|
||||
|
||||
// start receiving without acknowledging reception
|
||||
TWCR = (1<<TWINT) | (1<<TWEN);
|
||||
// wait for end of transmission
|
||||
while( !(TWCR & (1<<TWINT)) );
|
||||
|
||||
uint16_t timeout_timer = timer_read();
|
||||
while( !(TWCR & (1<<TWINT)) ) {
|
||||
if ((timeout != I2C_TIMEOUT_INFINITE) && ((timer_read() - timeout_timer) >= timeout)) {
|
||||
return I2C_STATUS_TIMEOUT;
|
||||
}
|
||||
}
|
||||
|
||||
// return received data from TWDR
|
||||
return TWDR;
|
||||
}
|
||||
|
||||
uint8_t i2c_transmit(uint8_t address, uint8_t* data, uint16_t length)
|
||||
i2c_status_t i2c_transmit(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout)
|
||||
{
|
||||
if (i2c_start(address | I2C_WRITE)) return 1;
|
||||
|
||||
for (uint16_t i = 0; i < length; i++)
|
||||
{
|
||||
if (i2c_write(data[i])) return 1;
|
||||
}
|
||||
|
||||
i2c_stop();
|
||||
|
||||
return 0;
|
||||
}
|
||||
i2c_status_t status = i2c_start(address | I2C_WRITE, timeout);
|
||||
if (status) return status;
|
||||
|
||||
uint8_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length)
|
||||
{
|
||||
if (i2c_start(address | I2C_READ)) return 1;
|
||||
|
||||
for (uint16_t i = 0; i < (length-1); i++)
|
||||
{
|
||||
data[i] = i2c_read_ack();
|
||||
}
|
||||
data[(length-1)] = i2c_read_nack();
|
||||
|
||||
i2c_stop();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint8_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length)
|
||||
{
|
||||
if (i2c_start(devaddr | 0x00)) return 1;
|
||||
|
||||
i2c_write(regaddr);
|
||||
|
||||
for (uint16_t i = 0; i < length; i++)
|
||||
{
|
||||
if (i2c_write(data[i])) return 1;
|
||||
for (uint16_t i = 0; i < length; i++) {
|
||||
status = i2c_write(data[i], timeout);
|
||||
if (status) return status;
|
||||
}
|
||||
|
||||
i2c_stop();
|
||||
status = i2c_stop(timeout);
|
||||
if (status) return status;
|
||||
|
||||
return 0;
|
||||
return I2C_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
uint8_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length)
|
||||
i2c_status_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout)
|
||||
{
|
||||
if (i2c_start(devaddr)) return 1;
|
||||
i2c_status_t status = i2c_start(address | I2C_READ, timeout);
|
||||
if (status) return status;
|
||||
|
||||
i2c_write(regaddr);
|
||||
|
||||
if (i2c_start(devaddr | 0x01)) return 1;
|
||||
|
||||
for (uint16_t i = 0; i < (length-1); i++)
|
||||
{
|
||||
data[i] = i2c_read_ack();
|
||||
for (uint16_t i = 0; i < (length-1); i++) {
|
||||
status = i2c_read_ack(timeout);
|
||||
if (status >= 0) {
|
||||
data[i] = status;
|
||||
} else {
|
||||
return status;
|
||||
}
|
||||
}
|
||||
data[(length-1)] = i2c_read_nack();
|
||||
|
||||
i2c_stop();
|
||||
status = i2c_read_nack(timeout);
|
||||
if (status >= 0 ) {
|
||||
data[(length-1)] = status;
|
||||
} else {
|
||||
return status;
|
||||
}
|
||||
|
||||
return 0;
|
||||
status = i2c_stop(timeout);
|
||||
if (status) return status;
|
||||
|
||||
return I2C_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
void i2c_stop(void)
|
||||
i2c_status_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout)
|
||||
{
|
||||
i2c_status_t status = i2c_start(devaddr | 0x00, timeout);
|
||||
if (status) return status;
|
||||
|
||||
status = i2c_write(regaddr, timeout);
|
||||
if (status) return status;
|
||||
|
||||
for (uint16_t i = 0; i < length; i++) {
|
||||
status = i2c_write(data[i], timeout);
|
||||
if (status) return status;
|
||||
}
|
||||
|
||||
status = i2c_stop(timeout);
|
||||
if (status) return status;
|
||||
|
||||
return I2C_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
i2c_status_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout)
|
||||
{
|
||||
i2c_status_t status = i2c_start(devaddr, timeout);
|
||||
if (status) return status;
|
||||
|
||||
status = i2c_write(regaddr, timeout);
|
||||
if (status) return status;
|
||||
|
||||
status = i2c_start(devaddr | 0x01, timeout);
|
||||
if (status) return status;
|
||||
|
||||
for (uint16_t i = 0; i < (length-1); i++) {
|
||||
status = i2c_read_ack(timeout);
|
||||
if (status >= 0) {
|
||||
data[i] = status;
|
||||
} else {
|
||||
return status;
|
||||
}
|
||||
}
|
||||
|
||||
status = i2c_read_nack(timeout);
|
||||
if (status >= 0 ) {
|
||||
data[(length-1)] = status;
|
||||
} else {
|
||||
return status;
|
||||
}
|
||||
|
||||
status = i2c_stop(timeout);
|
||||
if (status) return status;
|
||||
|
||||
return I2C_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
i2c_status_t i2c_stop(uint16_t timeout)
|
||||
{
|
||||
// transmit STOP condition
|
||||
TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWSTO);
|
||||
|
||||
uint16_t timeout_timer = timer_read();
|
||||
while(TWCR & (1<<TWSTO)) {
|
||||
if ((timeout != I2C_TIMEOUT_INFINITE) && ((timer_read() - timeout_timer) >= timeout)) {
|
||||
return I2C_STATUS_TIMEOUT;
|
||||
}
|
||||
}
|
||||
|
||||
return I2C_STATUS_SUCCESS;
|
||||
}
|
||||
|
@ -8,15 +8,24 @@
|
||||
#define I2C_READ 0x01
|
||||
#define I2C_WRITE 0x00
|
||||
|
||||
typedef int16_t i2c_status_t;
|
||||
|
||||
#define I2C_STATUS_SUCCESS (0)
|
||||
#define I2C_STATUS_ERROR (-1)
|
||||
#define I2C_STATUS_TIMEOUT (-2)
|
||||
|
||||
#define I2C_TIMEOUT_IMMEDIATE (0)
|
||||
#define I2C_TIMEOUT_INFINITE (0xFFFF)
|
||||
|
||||
void i2c_init(void);
|
||||
uint8_t i2c_start(uint8_t address);
|
||||
uint8_t i2c_write(uint8_t data);
|
||||
uint8_t i2c_read_ack(void);
|
||||
uint8_t i2c_read_nack(void);
|
||||
uint8_t i2c_transmit(uint8_t address, uint8_t* data, uint16_t length);
|
||||
uint8_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length);
|
||||
uint8_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length);
|
||||
uint8_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length);
|
||||
void i2c_stop(void);
|
||||
i2c_status_t i2c_start(uint8_t address, uint16_t timeout);
|
||||
i2c_status_t i2c_write(uint8_t data, uint16_t timeout);
|
||||
int16_t i2c_read_ack(uint16_t timeout);
|
||||
int16_t i2c_read_nack(uint16_t timeout);
|
||||
i2c_status_t i2c_transmit(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout);
|
||||
i2c_status_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout);
|
||||
i2c_status_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout);
|
||||
i2c_status_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout);
|
||||
i2c_status_t i2c_stop(uint16_t timeout);
|
||||
|
||||
#endif // I2C_MASTER_H
|
||||
|
100
drivers/avr/i2c_slave.c
Executable file
100
drivers/avr/i2c_slave.c
Executable file
@ -0,0 +1,100 @@
|
||||
/* Library made by: g4lvanix
|
||||
* Github repository: https://github.com/g4lvanix/I2C-slave-lib
|
||||
*/
|
||||
|
||||
#include <avr/io.h>
|
||||
#include <util/twi.h>
|
||||
#include <avr/interrupt.h>
|
||||
|
||||
#include "i2c_slave.h"
|
||||
|
||||
void i2c_init(uint8_t address){
|
||||
// load address into TWI address register
|
||||
TWAR = (address << 1);
|
||||
// set the TWCR to enable address matching and enable TWI, clear TWINT, enable TWI interrupt
|
||||
TWCR = (1<<TWIE) | (1<<TWEA) | (1<<TWINT) | (1<<TWEN);
|
||||
}
|
||||
|
||||
void i2c_stop(void){
|
||||
// clear acknowledge and enable bits
|
||||
TWCR &= ~( (1<<TWEA) | (1<<TWEN) );
|
||||
}
|
||||
|
||||
ISR(TWI_vect){
|
||||
|
||||
// temporary stores the received data
|
||||
uint8_t data;
|
||||
|
||||
// own address has been acknowledged
|
||||
if( (TWSR & 0xF8) == TW_SR_SLA_ACK ){
|
||||
buffer_address = 0xFF;
|
||||
// clear TWI interrupt flag, prepare to receive next byte and acknowledge
|
||||
TWCR |= (1<<TWIE) | (1<<TWINT) | (1<<TWEA) | (1<<TWEN);
|
||||
}
|
||||
else if( (TWSR & 0xF8) == TW_SR_DATA_ACK ){ // data has been received in slave receiver mode
|
||||
|
||||
// save the received byte inside data
|
||||
data = TWDR;
|
||||
|
||||
// check wether an address has already been transmitted or not
|
||||
if(buffer_address == 0xFF){
|
||||
|
||||
buffer_address = data;
|
||||
|
||||
// clear TWI interrupt flag, prepare to receive next byte and acknowledge
|
||||
TWCR |= (1<<TWIE) | (1<<TWINT) | (1<<TWEA) | (1<<TWEN);
|
||||
}
|
||||
else{ // if a databyte has already been received
|
||||
|
||||
// store the data at the current address
|
||||
rxbuffer[buffer_address] = data;
|
||||
|
||||
// increment the buffer address
|
||||
buffer_address++;
|
||||
|
||||
// if there is still enough space inside the buffer
|
||||
if(buffer_address < 0xFF){
|
||||
// clear TWI interrupt flag, prepare to receive next byte and acknowledge
|
||||
TWCR |= (1<<TWIE) | (1<<TWINT) | (1<<TWEA) | (1<<TWEN);
|
||||
}
|
||||
else{
|
||||
// Don't acknowledge
|
||||
TWCR &= ~(1<<TWEA);
|
||||
// clear TWI interrupt flag, prepare to receive last byte.
|
||||
TWCR |= (1<<TWIE) | (1<<TWINT) | (1<<TWEN);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if( (TWSR & 0xF8) == TW_ST_DATA_ACK ){ // device has been addressed to be a transmitter
|
||||
|
||||
// copy data from TWDR to the temporary memory
|
||||
data = TWDR;
|
||||
|
||||
// if no buffer read address has been sent yet
|
||||
if( buffer_address == 0xFF ){
|
||||
buffer_address = data;
|
||||
}
|
||||
|
||||
// copy the specified buffer address into the TWDR register for transmission
|
||||
TWDR = txbuffer[buffer_address];
|
||||
// increment buffer read address
|
||||
buffer_address++;
|
||||
|
||||
// if there is another buffer address that can be sent
|
||||
if(buffer_address < 0xFF){
|
||||
// clear TWI interrupt flag, prepare to send next byte and receive acknowledge
|
||||
TWCR |= (1<<TWIE) | (1<<TWINT) | (1<<TWEA) | (1<<TWEN);
|
||||
}
|
||||
else{
|
||||
// Don't acknowledge
|
||||
TWCR &= ~(1<<TWEA);
|
||||
// clear TWI interrupt flag, prepare to receive last byte.
|
||||
TWCR |= (1<<TWIE) | (1<<TWINT) | (1<<TWEN);
|
||||
}
|
||||
|
||||
}
|
||||
else{
|
||||
// if none of the above apply prepare TWI to be addressed again
|
||||
TWCR |= (1<<TWIE) | (1<<TWEA) | (1<<TWEN);
|
||||
}
|
||||
}
|
19
drivers/avr/i2c_slave.h
Executable file
19
drivers/avr/i2c_slave.h
Executable file
@ -0,0 +1,19 @@
|
||||
/* Library made by: g4lvanix
|
||||
* Github repository: https://github.com/g4lvanix/I2C-slave-lib
|
||||
|
||||
Info: Inititate the library by giving the required address.
|
||||
Read or write to the necessary buffer according to the opperation.
|
||||
*/
|
||||
|
||||
#ifndef I2C_SLAVE_H
|
||||
#define I2C_SLAVE_H
|
||||
|
||||
volatile uint8_t buffer_address;
|
||||
volatile uint8_t txbuffer[0xFF];
|
||||
volatile uint8_t rxbuffer[0xFF];
|
||||
|
||||
void i2c_init(uint8_t address);
|
||||
void i2c_stop(void);
|
||||
ISR(TWI_vect);
|
||||
|
||||
#endif // I2C_SLAVE_H
|
@ -49,6 +49,14 @@
|
||||
#define ISSI_COMMANDREGISTER 0xFD
|
||||
#define ISSI_BANK_FUNCTIONREG 0x0B // helpfully called 'page nine'
|
||||
|
||||
#ifndef ISSI_TIMEOUT
|
||||
#define ISSI_TIMEOUT 100
|
||||
#endif
|
||||
|
||||
#ifndef ISSI_PERSISTENCE
|
||||
#define ISSI_PERSISTENCE 0
|
||||
#endif
|
||||
|
||||
// Transfer buffer for TWITransmitData()
|
||||
uint8_t g_twi_transfer_buffer[20];
|
||||
|
||||
@ -83,8 +91,14 @@ void IS31FL3731_write_register( uint8_t addr, uint8_t reg, uint8_t data )
|
||||
g_twi_transfer_buffer[0] = reg;
|
||||
g_twi_transfer_buffer[1] = data;
|
||||
|
||||
//Transmit data until succesful
|
||||
while(i2c_transmit(addr << 1, g_twi_transfer_buffer,2) != 0);
|
||||
#if ISSI_PERSISTENCE > 0
|
||||
for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) {
|
||||
if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT) == 0)
|
||||
break;
|
||||
}
|
||||
#else
|
||||
i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT);
|
||||
#endif
|
||||
}
|
||||
|
||||
void IS31FL3731_write_pwm_buffer( uint8_t addr, uint8_t *pwm_buffer )
|
||||
@ -95,20 +109,24 @@ void IS31FL3731_write_pwm_buffer( uint8_t addr, uint8_t *pwm_buffer )
|
||||
// g_twi_transfer_buffer[] is 20 bytes
|
||||
|
||||
// iterate over the pwm_buffer contents at 16 byte intervals
|
||||
for ( int i = 0; i < 144; i += 16 )
|
||||
{
|
||||
for ( int i = 0; i < 144; i += 16 ) {
|
||||
// set the first register, e.g. 0x24, 0x34, 0x44, etc.
|
||||
g_twi_transfer_buffer[0] = 0x24 + i;
|
||||
// copy the data from i to i+15
|
||||
// device will auto-increment register for data after the first byte
|
||||
// thus this sets registers 0x24-0x33, 0x34-0x43, etc. in one transfer
|
||||
for ( int j = 0; j < 16; j++ )
|
||||
{
|
||||
for ( int j = 0; j < 16; j++ ) {
|
||||
g_twi_transfer_buffer[1 + j] = pwm_buffer[i + j];
|
||||
}
|
||||
|
||||
//Transmit buffer until succesful
|
||||
while(i2c_transmit(addr << 1, g_twi_transfer_buffer,17) != 0);
|
||||
#if ISSI_PERSISTENCE > 0
|
||||
for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) {
|
||||
if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT) == 0)
|
||||
break;
|
||||
}
|
||||
#else
|
||||
i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@ -165,6 +183,7 @@ void IS31FL3731_init( uint8_t addr )
|
||||
// most usage after initialization is just writing PWM buffers in bank 0
|
||||
// as there's not much point in double-buffering
|
||||
IS31FL3731_write_register( addr, ISSI_COMMANDREGISTER, 0 );
|
||||
|
||||
}
|
||||
|
||||
void IS31FL3731_set_color( int index, uint8_t red, uint8_t green, uint8_t blue )
|
||||
@ -217,7 +236,6 @@ void IS31FL3731_set_led_control_register( uint8_t index, bool red, bool green, b
|
||||
|
||||
g_led_control_registers_update_required = true;
|
||||
|
||||
|
||||
}
|
||||
|
||||
void IS31FL3731_update_pwm_buffers( uint8_t addr1, uint8_t addr2 )
|
||||
|
40
keyboards/al1/al1.c
Normal file
40
keyboards/al1/al1.c
Normal file
@ -0,0 +1,40 @@
|
||||
/* Copyright 2018 MechMerlin
|
||||
*
|
||||
* 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 "al1.h"
|
||||
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
return process_record_user(keycode, record);
|
||||
}
|
||||
|
||||
void led_set_kb(uint8_t usb_led) {
|
||||
CONFIG_LED_IO;
|
||||
print_dec(usb_led);
|
||||
if (usb_led & (1<<USB_LED_CAPS_LOCK))
|
||||
PORTB &= ~(1<<7);
|
||||
else
|
||||
PORTB |= (1<<7);
|
||||
|
||||
if (usb_led & (1<<USB_LED_NUM_LOCK))
|
||||
PORTD &= ~(1<<0);
|
||||
else
|
||||
PORTD |= (1<<0);
|
||||
|
||||
if (usb_led & (1<<USB_LED_SCROLL_LOCK))
|
||||
PORTD &= ~(1<<1);
|
||||
else
|
||||
PORTD |= (1<<1);
|
||||
led_set_user(usb_led);
|
||||
}
|
58
keyboards/al1/al1.h
Normal file
58
keyboards/al1/al1.h
Normal file
@ -0,0 +1,58 @@
|
||||
/* Copyright 2018 MechMerlin
|
||||
*
|
||||
* 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/>.
|
||||
*/
|
||||
#ifndef AL1_H
|
||||
#define AL1_H
|
||||
|
||||
#include "quantum.h"
|
||||
|
||||
#define CONFIG_LED_IO \
|
||||
DDRB |= (1<<7) | (1<<6); \
|
||||
DDRD |= (1<<0) | (1<<1);
|
||||
|
||||
|
||||
#define LAYOUT( \
|
||||
K500, K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015, K415, K414,\
|
||||
K501, K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K215, K413,\
|
||||
K502, K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, \
|
||||
K503, K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, K412,\
|
||||
K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411 \
|
||||
) \
|
||||
{ \
|
||||
{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015}, \
|
||||
{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115}, \
|
||||
{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215}, \
|
||||
{ K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315}, \
|
||||
{ K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, K414, K415}, \
|
||||
{ K500, K501, K502, K503, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO} \
|
||||
}
|
||||
|
||||
#define LAYOUT_split_bs( \
|
||||
K500, K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K512, K012, K013, K014, K015, K415, K414, \
|
||||
K501, K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K215, K413,\
|
||||
K502, K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, \
|
||||
K503, K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, K412,\
|
||||
K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411 \
|
||||
) \
|
||||
{ \
|
||||
{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015}, \
|
||||
{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115}, \
|
||||
{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215}, \
|
||||
{ K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315}, \
|
||||
{ K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, K414, K415}, \
|
||||
{ K500, K501, K502, K503, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K512, KC_NO, KC_NO, KC_NO} \
|
||||
}
|
||||
|
||||
#endif
|
187
keyboards/al1/config.h
Normal file
187
keyboards/al1/config.h
Normal file
@ -0,0 +1,187 @@
|
||||
/*
|
||||
Copyright 2018 MechMerlin
|
||||
|
||||
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/>.
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_H
|
||||
#define CONFIG_H
|
||||
|
||||
#include "config_common.h"
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define VENDOR_ID 0xFEED
|
||||
#define PRODUCT_ID 0x6050
|
||||
#define DEVICE_VER 0x0104
|
||||
#define MANUFACTURER Alsoran
|
||||
#define PRODUCT AL1
|
||||
#define DESCRIPTION A custom keyboard
|
||||
|
||||
/* key matrix size */
|
||||
#define MATRIX_ROWS 7
|
||||
#define MATRIX_COLS 20
|
||||
|
||||
/*
|
||||
* 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)
|
||||
*
|
||||
*/
|
||||
|
||||
/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */
|
||||
#define DIODE_DIRECTION COL2ROW
|
||||
|
||||
#define BACKLIGHT_PIN B6
|
||||
#define BACKLIGHT_BREATHING
|
||||
#define BACKLIGHT_LEVELS 3
|
||||
|
||||
|
||||
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
|
||||
#define DEBOUNCING_DELAY 5
|
||||
|
||||
/* define if matrix has ghost (lacks anti-ghosting diodes) */
|
||||
//#define MATRIX_HAS_GHOST
|
||||
|
||||
/* number of backlight levels */
|
||||
|
||||
/* 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 */
|
||||
#define IS_COMMAND() ( \
|
||||
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
|
||||
)
|
||||
|
||||
/* 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_HELP1 H
|
||||
//#define MAGIC_KEY_HELP2 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_ALT1 ESC
|
||||
//#define MAGIC_KEY_LAYER0_ALT2 GRAVE
|
||||
//#define MAGIC_KEY_LAYER0 0
|
||||
//#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 PAUSE
|
||||
//#define MAGIC_KEY_LOCK CAPS
|
||||
//#define MAGIC_KEY_EEPROM E
|
||||
//#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
|
||||
//#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
|
||||
|
||||
#endif
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user