Compare commits

...

153 Commits

Author SHA1 Message Date
Jack Humbert
ec0f9db8ad separate commands, m/s updates 2018-06-12 19:24:40 -04:00
Jack Humbert
8c36c83a84 try more stuff 2018-06-12 10:58:32 -04:00
Jack Humbert
cca90f4389 non working code 2018-06-11 13:47:38 -04:00
Jack Humbert
1b7efbc03b Merge branch 'muon_light' of github.com:qmk/qmk_firmware into keymap_folders 2018-06-10 00:28:11 -04:00
Jack Humbert
e54159d9e8 Merge branch 'muon_light' of github.com:qmk/qmk_firmware into keymap_folders 2018-06-10 00:25:54 -04:00
Jack Humbert
d01f40edbf workingggg 2018-06-10 00:25:21 -04:00
Jack Humbert
13f49ad8d9 all a's working 2018-06-09 23:53:26 -04:00
Jack Humbert
0f89d7efed try sound feedback 2018-06-09 17:57:15 -04:00
Jack Humbert
2fccc1a064 hooked-up keymap/matrix, compiling, not working 2018-06-09 02:03:32 -04:00
Jack Humbert
53c518f7d4 start qwiic keyboard impl 2018-06-08 02:07:28 -04:00
Jack Humbert
bcbc64aed8 fix layouts 2018-06-07 20:54:25 -04:00
Jack Humbert
459dfa510e rename to proton c 2018-06-07 19:14:19 -04:00
Jack Humbert
5bb1e7869c update chibios, remove extra files 2018-06-07 19:00:10 -04:00
Jack Humbert
58c4ba096a update chibios 2018-06-07 18:46:35 -04:00
Jack Humbert
c8cc9c6aab add i2c slave files 2018-06-07 17:21:35 -04:00
Jack Humbert
e1e4a51472 add keymap folders 2018-06-07 15:41:19 -04:00
Jack Humbert
c53a8ead93 inital support for muon 2018-06-06 18:21:51 -04:00
Jack Humbert
a6afb16c90 fix assembly errors with hal 2018-06-04 00:50:09 -04:00
Jack Humbert
21665df8eb add encoder docs 2018-06-03 22:59:27 -04:00
Jack Humbert
ff4a1ae5d2 inital encoder implementation 2018-06-03 21:55:07 -04:00
Jack Humbert
018a0142d2 arm lines implemented 2018-06-03 18:01:11 -04:00
Jack Humbert
c1f6f1308b move drivers around 2018-06-01 16:37:15 -04:00
Jack Humbert
274283420d rev2 working 2018-06-01 14:33:13 -04:00
Jack Humbert
874f5a5c07 mostly compiling 2018-06-01 11:31:29 -04:00
Jack Humbert
161c68b48a update twi2c to do standard master stuff 2018-05-31 00:28:37 -04:00
Jack Humbert
5fad8d774d Merge branch 'handwire' of github.com:qmk/qmk_firmware into planck_rev6 2018-05-30 23:34:21 -04:00
Jack Humbert
4fdc9badd3 Merge branch 'master' of github.com:qmk/qmk_firmware into planck_rev6 2018-05-30 15:24:45 -04:00
Barry Huang
835431330c info.json fix (#3075)
* Capslock indicator add

* edit

* name correction

* led_set_user(usb_led); delete

* config edit for caps indicator

* keymap.c fix

* led.h include

* pk60.c fix for capslock indicator

* info.json fix

for LAYOUT_all showing correctly

* LAYOUT_all fix
2018-05-30 08:13:16 -07:00
Daniel Gordon
a75bd221f2 Updates to gordon keymaps (#3082)
Added rules.mk for the infinity

    * Moved tap dance enums to gordon.h
    * Moved tap dance aliases to gordon.h

    Moved TD to user space

    * Added config file with preventing mods sticking
    * Added a few keys to keymap
2018-05-30 08:10:22 -07:00
Louis Orleans
805b42275b board(bigseries): dudeofawesome's layout (#3085)
*  add big series keymap

* 👽 update for new keymap format

* 🔥 remove unnecesarry code

*  add RGB mode reverse

* 📝 add README

* 📝 change features styling
2018-05-30 08:06:33 -07:00
noroadsleft
7f5361aedb Refactor and Configurator updates for B.mini (#3081)
* Refactor for B.mini

* Configurator update for B.mini

* Updated readme formatting
2018-05-29 15:59:34 -07:00
Campbell Barton
434a450be1 qwerty_code_friendly: add numbers keys (#3078) 2018-05-29 15:58:51 -07:00
Yan-Fa Li
4bd64227fd Switch to noeeprom variants of rgb fns (#3077)
- avoid writing to the eeprom when possible
2018-05-29 15:58:10 -07:00
Brian Pruitt-Goddard
8a9c19ee93 Add bpruitt-goddard Ergodox Layout (#3080)
* Feat: Create personal ergodox keymap

* FEAT: Update bpruitt-goddard keymap with custom layout

* Fix: Remove unused pieces from bpruitt-goddard keyboard

* Feat: Add QWERTY layer to bpruitt-goddard ergodox keymap

* Refactor: Remove unused layers from bpruitt-goddard keymap

* Fix: Update base layer for bpruitt-goddard keymap

* Fix: Remove un-reachable key combo from FN layer

* Fix: Rename FN layer to numpad layer

* Feat: Create one-shot modifier layer for mac os use

* Doc: Update readme to reflect my keymap

* Feat: Add mac desktop space switching

* feat: Update keymap layers to use ergodox pretty format
2018-05-29 15:55:47 -07:00
Drashna Jaelre
751719e6cb Add and fix _noeeprom functions to many of the RGB Underglow functions (#3070)
* And and fix _noeeprom functions to many of the RGB Underglow functions

* Many functions are unnecessarily calling the eeprom write code. The toggle/enable is command is especially guilty of this, as it writes to EEPROM 3 times.  But rgb mode writes twice, every time it's called. And init resets the rgb eeprom range and then writes back to it twice!
* Fixed the rgblight_sethsv_noeeprom to work as expected, by moving a lot of the code to a helper function.
* Added a noeeprom function for mode, enable, disable, and toggle functions. (didn't bother for increase/decrease stuff, and didn't add new keycodes)
* Add to predefined colors list
* Add new functions to manual/docs

* Update RGB Sleep feature to use _noeeprom

Because that's exactly what it should be doing, actually!
2018-05-29 11:05:22 -04:00
Danny
034a25aedf Keymap fixes (#3074)
* Fix keymap to use correct macro

* Make sure RGBLED_NUM is defined to a value
2018-05-29 08:01:24 -07:00
noroadsleft
eb8388b31e Refactor and Configurator updates for Woodkeys/NovelKeys Big Series (#3073)
* Refactor for Woodkeys Big Series

* Configurator update for Woodkeys Big Series
2018-05-29 03:53:03 -07:00
Hannes Egler
edb149fb5a Kbd8x backlight support (#3069)
* added backlighting support

* complying to conventions
2018-05-29 01:52:02 -07:00
noroadsleft
0f99562992 Refactor and Configurator updates for Bantam44 (#3071)
* Configurator update for Bantam-44

* Refactor for Bantam44
2018-05-29 01:13:53 -07:00
noroadsleft
eed6ef0999 Configurator updates for Atreus/Atreus62 (#3065) 2018-05-28 20:29:14 -07:00
arlenk
a87b36d791 fix a few simple typos (#3068)
* Update feature_tap_dance.md

* minor typos
2018-05-28 20:23:33 -07:00
Dan Hertz
6009ca2d4a Update Canoe ps2avr board (#3066)
* Add Percent Canoe keyboard

* Fix row of nonus backslash

* Update info.json to be correct for canoe

* Change LAYOUT_ISO to LAYOUT_iso

* Remove bootloader key in info.json
2018-05-28 20:22:43 -07:00
Hannes Egler
dfa7a708fe Indicator led support for KBD8X (#3064)
* Support for indicator LEDs

* fixes for backlighting support

* more fixes
2018-05-28 20:18:39 -07:00
Danny
2b677ddac9 Fix nyquist (and other splits using D2 in debouncing) (#3067)
* Update default Nyquist revision

* LED slave fix

* Sync changes from lets_split

* Add needed check for debouncing

* Remove line that was setting PD2 pin and interfering with use of that pin

* Add backlight key to keymap
2018-05-28 15:02:41 -07:00
jamesofarrell
8ddebce2d7 Add Canoe support (#3063)
* Adding Canoe support

* fix readme

* Remove usless comment

* fixing issues
2018-05-27 20:48:59 -07:00
noroadsleft
a677d8a00d Refactor and Configurator updates for AMJ Pad (#3060)
* Refactor for AMJ Pad

* Configurator update for AMJ Pad

* Add hardware agnostic layouts numpad_6x4 and ortho_6x4

* Add agnostic layouts to rules.mk

* Refactor AMJ Pad to use new hardware agnostic layouts
2018-05-27 19:19:09 -07:00
Leo Wzukw
3b1ddd12a5 Refresh & improve leader documentation page (#2990)
* Refresh & improve leader documentation page

- register_code/unregister_code are not the recommanded way to do macro.
- Provide some details I wish I had found when first used the leader
  functionality.

* Add old way to use macro.
2018-05-26 11:29:02 -07:00
noroadsleft
716877b40a Refactor and Configurator updates for AMJ60 (#3055)
* Refactor for AMJ60

* Configurator update for AMJ60
2018-05-26 11:22:56 -07:00
Guido Bartolucci
28525ab461 Adding guidoism's planck layouts (#3059)
* Initial commit of guidoism

* created movement layer

* movement layer works!

* removed unnecessary layers

* moved enter key up and recreated caps lock

* Added num pad
2018-05-26 11:07:35 -07:00
mtdjr
504ce1b4bc Add mtdjr keymaps for Iris, Let's Split, TADA68, XD75, and handwired dox (#3058)
* Add keymaps for Iris, Let's Split, TADA68, XD75, and handwired not_so_minidox

* remove handwired not_so_minidox
2018-05-26 11:06:08 -07:00
Campbell Barton
357d9f4772 qwerty_code_friendly: fix 76 key config (#3057) 2018-05-26 11:05:09 -07:00
Salt-Peanuts
6e867a7ecc Updated keymaps (#3056)
* Updated info and fixed minor errors

* Updated folder name; overdue updates to keymap and readme files

Updated folder name; overdue updates to keymap and readme files

* Updated tri-layer feature

* Revert "Updated tri-layer feature"

This reverts commit 59b8b85761740e24f671e10fceea869f06a33ade.

* Updated tri-layer on keymap

* Fixed typos

* Updated keymaps
2018-05-26 08:54:38 -07:00
Leo Wzukw
2d38f45009 Fix dead link to USB keycodes doc (#3050)
* Fix dead link to USB keycodes doc

Link was dead and the fresher version I could find on usb.org is still older than this one.

Thus, WaybackMachine seems the best option.

* Fix dead link to USB keycodes doc, with 2 options

Give the WaybackMachine link (fresher and for reference of the content of the original link) and the usb.org one (older)
2018-05-26 08:51:51 -07:00
yiancar
a659666e8a Fix HS60 config for ANSI keymap (#3054)
- This is mostly for safety
2018-05-25 20:07:06 -07:00
noroadsleft
9200934de7 Attempting Debug on Configurator (re: #3052) (#3053) 2018-05-25 12:47:16 -07:00
Drashna Jaelre
24b8d84b6c Fix Split keyboards so they compile on Configurator (#3051)
* Fix serial split for BFO9000

* Fix serial split for DeltaSplit75

* Fix serial split for Helix

* Fix serial split for MiniDox

* Fix serial split for Viterbi

* Revert "Fix serial split for Helix" since it's super complex

This reverts commit 72538df105ba6d5fe6915773a20c509f2a47785d.

We'll let the helix owner fix this issue, or dive into the code later
2018-05-25 11:49:43 -07:00
Drashna Jaelre
82466aafd1 Fix Orthodox compile issue in online configurator (#3044) 2018-05-25 10:51:06 -07:00
noroadsleft
220b5119fa Refactor for AMJ40 (#3047) 2018-05-25 08:40:36 -07:00
MechMerlin
910c50bca1 Add some generic/sparse readmes to get rid of errors (#3048) 2018-05-25 08:39:39 -07:00
MechMerlin
9b08fb7328 Fix info.json for kbd66 (#3045)
* Change LAYOUT to LAYOUT_all
Fix info.json file

* edit the CORRECT info.json this time

* revert my errors
2018-05-25 08:39:08 -07:00
MechMerlin
dc4298408b fix LAYOUT_all in info.json (#3046) 2018-05-24 23:34:19 -07:00
noroadsleft
2c01ec0d8c Refactor and Configurator updates for ALU84 (#3043)
* Readme update per template on docs.qmk.fm

* Refactor for LAYOUT macro

* Add info.json
2018-05-24 21:11:29 -07:00
Danny
0dc21d70f0 Add info.json for Fourier & Laplace (#3038)
* Add info.json for Fourier

* Add info.json for Laplace
2018-05-24 15:40:30 -07:00
yiancar
6073fa774e Rename ANSI keymap of HS60 (#3041) 2018-05-24 15:32:01 -07:00
Danny
dff86c6e09 Fix keymap to use renamed macro (#3039) 2018-05-24 15:31:29 -07:00
Sascha Grunert
5049938ab7 Update my keymap (#3037)
* Update keymap.c
2018-05-24 15:30:32 -07:00
Barry Huang
1b81c4dd2b pk60.c fix for capslock indicator (#3032)
* Capslock indicator add

* edit

* name correction

* led_set_user(usb_led); delete

* config edit for caps indicator

* keymap.c fix

* led.h include

* pk60.c fix for capslock indicator
2018-05-24 15:28:54 -07:00
Yan-Fa Li
9ae6f4f927 Wait for QMK to initialize before configuring RGB (#3030)
Wait for 1 second before turning on RGB to get debug messages on
console.

 - configure HSV color, on a brand new pro micro the default values are
   0, 0, 0
2018-05-24 15:27:43 -07:00
noroadsleft
3a4a28a38b Refactor for Alps64 (#3029)
* Refactor for Alps64

* Reverts deletion of LAYOUT_kc macro; renames LAYOUT_standard_60 to LAYOUT_60_ansi

* Add LAYOUTS = 60_ansi to rules.mk

* Rename LAYOUT_standard_60 to LAYOUT_60_ansi in info.json
2018-05-24 15:26:38 -07:00
Alexander Dang-Tran
73ddb764cc Fix readme and contributing hyperlinks 2018-05-24 00:00:20 -04:00
Barry Huang
2ec0e01430 config edit for caps indicator (#3016)
* Capslock indicator add

* edit

* name correction

* led_set_user(usb_led); delete

* config edit for caps indicator

* keymap.c fix

* led.h include
2018-05-23 08:27:52 -07:00
Jack Humbert
af6107bee8 working example 2018-05-23 01:54:43 -04:00
Jack Humbert
d233737c95 last commit for glasser code 2018-05-23 00:50:58 -04:00
Felipe Coury
575b2a66df Adds Zlant keyboard support (#3028)
* Added Zlant support

* Uses LAYOUT and identifies individual layers

* Removed deprecated =? usage on rules.mk

* Adds readme for Zlant keyboard and its default layout

* Fixed LAYOUT constant

* Minor zlant readme formatting fix
2018-05-22 20:53:11 -07:00
noroadsleft
0026da1414 Fix to KC60 LAYOUT_60_ansi matrix (#3026) 2018-05-22 20:14:50 -07:00
Jack Humbert
3e282ab203 update ws2812 driver/config 2018-05-22 21:41:10 -04:00
Jack Humbert
1c0d85c143 update build includes for chibios 2018-05-22 21:40:38 -04:00
noroadsleft
c1dd36a19d Refactor and Configurator update for ACR60 (#3025) 2018-05-22 17:06:58 -07:00
epaew
760b11b5e8 Add edvorakjp layout for the Iris keyboard (#3020)
* add edvorakjp libraries

* add edvorakjp iris keymap

* change the custom eeconfig's address to prevent future address conflicts

* deleted the verbose line of rule.mk
2018-05-22 16:59:43 -07:00
noroadsleft
c465cf2fd3 Refactor and Configurator updates for 9key (#3024) 2018-05-22 15:58:56 -07:00
Yan-Fa Li
c29d8ffd5a Adds basic support for u/flehrad's bigswitch pcb (#3015)
* Adds basic support for u/flehrad's bigswitch pcb

 - also adds support for OSX Eject/Power
   The function of this key depends on the version of OSX and if you
   have physical media. For a macbook pro 2017 holding this key down
   brings up the shutdown dialog. If you wrap it in LCTL and LSFT the
   screenlock turns on immediately.

* Switch to Layout Macro

 - add a code for OSX Sleep

* Add a README

* Turn on RGB by default

* Add info.json

* Address comments by @drashna

* Only define Eject in keymap
2018-05-22 14:19:55 -07:00
yiancar
470c50ddb6 Update documentation for rgb matrix (#3023)
* Update documentation for rgb matrix

- Updated keycodes.md to include RGB matrix keycodes + necessary link
2018-05-22 14:18:40 -07:00
GreenShadowMaker
06b3637266 added some helpful notes to the documentation (#2981) 2018-05-22 12:48:33 -07:00
WillyPillow
508801c948 Import userspace config.h according to USER_NAME (#2983)
* Import userspace config.h according to USER_NAME

* Use USER_PATH instead of directly using USER_NAME
2018-05-22 12:47:28 -07:00
Danny
7658f10fba Fix led enabled slave (#3022)
* Account for backlight enabled flag when passing backlight level to slave

* Add BL_TOGG to keymap for testing

* Apply backlight fix to Iris

* Port I2C LED backlight control from Iris to Levinson
2018-05-22 12:40:43 -07:00
noroadsleft
4b1f60a3f5 Refactor update for 6ball (#3017) 2018-05-22 12:12:50 -07:00
Danny
def0ff48c0 Add mike808 Viterbi layout (#3019) 2018-05-22 12:12:06 -07:00
rfvizarra
5018892fa8 A personal layout for the orthodox keyboard (#3006)
* A personal layout for the orthodox keyboard

* Added layout readme.md

* Consolidated inclues with #include QMK_KEYBOARD_H

* Moved layer tones setup to config.h

* Replace persistent_default_layer_set calls with set_single_persistent_default_layer

* Simplified the process_record_user function using layer_state_set_user function and MO() to set the lower, raise, nav and media layers

* Removed AUDIO_ENABLE ifdefs and persistent_default_layer_set() as they are not needed any more
2018-05-22 07:04:53 -07:00
Maarten Dekkers
ddbe60dc36 Fix Atom47 configurator layout (#3018) 2018-05-22 07:03:10 -07:00
QMK Bot
61f30ba542 convert to unix line-endings [skip ci] 2018-05-22 02:16:00 +00:00
Maarten Dekkers
1e8be6b741 Fix atom47 keyboard revision naming (#3013)
* Fixed Atom47 revisions, rev1 is rev3

* Remove rev1 folder

* Added bootloader to info.json

* Renamed layout

* Change readme for atom47

* Remove bootloader line from info.json
2018-05-21 19:12:56 -07:00
Joe Wasson
36fe0828cf Remove ISO imposter key from TKL keymap (#3014) 2018-05-21 18:17:15 -07:00
Jack Humbert
4d26137e2a Create CNAME 2018-05-21 16:29:37 -04:00
Drashna Jaelre
9483a88d75 Add 80 key layout to Ergodone, as it appears to support it (#2984)
* Add 80 key layout to Ergodone

* Add layouts

* Missed a comma .....
2018-05-20 21:45:38 -07:00
Drashna Jaelre
4dc89d974b Fix Ergodox EZ Info.json files (#2979)
* Fix Ergodox EZ Info.json files

* Ugh, column stagger!

* Whoops, added offset to wrong axis

* Add changes to Ergodone and Ergodox Infinity
2018-05-20 21:34:18 -07:00
Drashna Jaelre
8e0040e01a Fix Orthodox height 2018-05-20 21:33:38 -07:00
Drashna Jaelre
8729be5434 Fix compile issues for atmega328p 2018-05-20 21:30:14 -07:00
Barry Huang
f698bbcd65 Capslock indicator add (#3007)
* Capslock indicator add

* edit

* name correction

* led_set_user(usb_led); delete
2018-05-20 10:28:33 -07:00
yiancar
068b80383f HS60 ANSI keymap (#3010)
* Added Modular keyboards L,R and NUM

Created code modules for the 3 modules of the modular keyboard.
Original idea by MechboardsUK. Uses i2c implementation similar to lets
split

* Remove modular from master

This is to fix incorrect branching

* HS60 ANSI update

* HS60 ANSI update
2018-05-20 10:28:05 -07:00
MechMerlin
3e0ec8b171 Kira 75 QMK Support (#3003)
* preliminary check in of Kira75

* Layout done

* make an appropriate keymap and fix layout commas

* formatting changes and housekeeping

* add info.json contents for QMK Configurator support

* add RGB underglow support

* add support for caps and num lock leds
2018-05-20 10:25:34 -07:00
Campbell Barton
c1d30e4a57 qwerty_code_friendly: correct typos (#3002)
* qwerty_code_friendly: correct typos

* qwerty_code_friendly: right thumb for media keys

Allows for single handed media control.
2018-05-20 10:05:01 -07:00
MechMerlin
0b591fd843 Merlin community layouts (#3004)
* community layout support for eagle_viper v2 and remove mechmerlin keymap dir

* community layout support for eagle_viper v2 and remove mechmerlin keymap dir

* Change to QMK_KEYBOARD_H and remove merlin keymap in favor of cmmunity layouts

* community layout support 60_ansi

* community layout support for 60_ansi
2018-05-20 09:59:02 -07:00
MechMerlin
c9102f9e35 Renamed jd40's LAYOUT to LAYOUT_kc (#3000)
Made a new LAYOUT without all the KC_##
2018-05-18 21:00:48 -07:00
MechMerlin
d5f44feb75 checking in xxinophobia's changes to get ISO enter working correctly (#2999) 2018-05-18 21:00:13 -07:00
sennin32
1edb8bf190 change do60 config (#2996)
* add do60 support

* DO60 on market config v0.2.8

* remove do60x

* Changes for matching new naming rule
2018-05-18 20:59:05 -07:00
Joe Burchett
c55c646fa3 fix broken links in readme.md for bigseries (#2997) 2018-05-18 16:33:03 -07:00
Xyverz
27e3458f44 Updating my maps in upstream master (#2987)
* Adding Rama M10-A Macropad

* ch-ch-ch changes...

* Major overhaul based on SMT's keymap.

* more changes.

* Moved the FKeys to the ADJUST layer.

* More rearranging.

* Alias in Atreus62 keymap to make it more legible
Added config.h to fix tapping_term issue for Caps Lock key in OSX

* Added OrthoDox layout.

* More layout changes.

* Fixing things with the keyboard.

* Finishing touches.

Set left-hand master in config.h
Embedded the arrow keys in keymap.c

* Revised keymap making this easier to use.

* additions and changes.

* changes to various keymaps.

* Minor adjustments to OrthoDox layout.

* Added Eco keymap. Updated Let's Split keymap.

* Added gherkin

* Removed my M10A keymap

* Planck Keymap Updates

Updated my Planck keymap and created a simple keymap for Seph's Preonic.

* Added readme

* readme fixes

* Update readme.md

more clarification

* Keymap Tweaks

Removed the Power button setting from the keymap. It was in a
horrible location. I'll work on getting it setup somewhere else
sometime later.

* Added Readme

I finally got around to adding a readme to this keymap. I've also added minor changes to the layout.

* Fixed Keymap Error

* Fixed Readme

* adding iris and levinson keymaps

* Tweaks to keymap

* added youngJZ keymap

* Changes to keymap
Added a readme.md

* Levinson changes

Added the readme.md and rules.mk files.
Configured RGB underglow and backlighting.

* fixed readme

* changes to keymaps

* Updated keymap

* Updated readme.md

* Updated Readme (again)

* Updated Readme

Fixed formatting. Again.

* Updated readme

This is the last readme update for this keyboard update. I hope.

* Added Contra keymap

* Kinesis Keymap Update

* Updated Keymaps

I've updated my Kinesis (Stapelberg) layout and my Clueboard 66 layout.
I've also updated my Kinesis Readme.

* Clueboard Keymap update

Added media keys to my Clueboard 66 Rev2 layout.

* Added keymap

Added Minidox keymap & rules.
Added user function to Let's Split keymap that turns off the red
 LEDs on the Pro Micros.

* New Zen keymap

Added Zen keyboard to my list of keyboards, so had to generate a new
keymap for it.

Also adding some changes to my MiniDox keymap and config.h, as well
as my Levinson's config.h.

The config.h file changes enable ee_hands.

* A few changes for useability

I made a few changes to the Minidox keymap to see if I can't make it more useable.

I'm also working on streamlining the Zen keyboard keymap to reduce layers.

* Re-vamped Iris keymap.

* changes

* minor keymap change

This was a minor keymap change to use mod_tap for the backspace key:
ALT when held, BSPC when tapped.

* Added Fourier keymap

* Keymap Cleanup

Moved KC_ESC to KC_CAPS, and changed KC_ESC to KC_GRV
This is because of muscle memory, I kept hitting ESC when trying to hit TAB.

* Keymap Adjustments

Swapped Caps/Esc, put Caps in Raise/Lower layers, put Grv in normal
Esc position. Adjusted the readme.md to reflect these changes.

* minor tweaks

Added code to disable red ProMicro LEDs after flashing.

* Clean-up

* Corrections to keymap.

Fixed a foul-up in the Zen keymap where the lctrl was where the LOWER
should have been.

* Changes to make this fall in line with the new Layout features

* Moving to LAYOUTs for 4x12 boards

* fixed config.h file

* standardization changes

* Reverted Atreus62 keymap to LAYOUT format

* Switch Preonic and Nyquist to ortho_5x12

* Corrections to config.h

* config.h file tweaks

* config.h file tweaks
2018-05-18 15:32:50 -07:00
Harley Laue
8cdb4a9150 Add Contra layout & cleanup a few things (#2998)
* Have Del become backspace on the bottom layer for grid layouts
* Fix modtap for ESC
* Add sleep to Adjust layer
2018-05-18 13:58:23 -07:00
skullY
e721deb4a6 trigger api update 2018-05-18 12:56:26 -07:00
MechMerlin
2411652a33 remove a KC-NO in row 1 (#2994) 2018-05-18 07:45:06 -07:00
Jack Humbert
7c19e9fa04 pwm ws driver (not working) 2018-05-18 01:32:24 -04:00
MechMerlin
effc3e380f Add QMK Configurator support and remove Layouts definitions (#2977)
* Add QMK Configurator support and remove userspace definitions

* fix that build breakage

* Unsupport community layouts but use standard layouts
2018-05-17 15:21:06 -07:00
GreenShadowMaker
227c3b909a Add copy of knops/mini default keymap with comments for new user (#2989) 2018-05-17 07:05:34 -07:00
M1K3L08
42a72c633b Fixed sprintf overflow 2018-05-16 21:05:43 -04:00
Drashna Jaelre
9f2bb11412 Make sure new features (RGB Matrix) are actually listed 2018-05-15 22:35:17 -04:00
Drashna Jaelre
f5f0475f53 Fix Orthodox Info.json files 2018-05-15 22:34:56 -04:00
Jack Humbert
9fccfc8dd5 conditional autio 2018-05-15 11:36:19 -04:00
Jack Humbert
1cb72a9c59 dont break other revs 2018-05-10 16:17:50 -04:00
Jack Humbert
82146ecfc0 dont break other revs 2018-05-10 15:54:33 -04:00
Jack Humbert
4a1984d33e merge from master 2018-05-10 15:01:26 -04:00
Jack Humbert
676080372c try mouse wheel again 2018-04-24 11:58:36 -04:00
Jack Humbert
0af7415981 Merge branch 'master' of github.com:qmk/qmk_firmware into planck_rev6 2018-04-15 20:43:39 -04:00
Jack Humbert
df371458b3 flip direction 2018-04-06 12:36:20 -04:00
Jack Humbert
e0e5efbead muse working with encoder as control 2018-04-04 16:49:39 -04:00
Jack Humbert
edb4460e64 start muse implementation 2018-04-04 02:29:52 -04:00
Jack Humbert
fe72bfa070 adds default encoder res 2018-04-03 21:10:57 -04:00
Jack Humbert
25642c8840 adds default encoder res 2018-04-03 21:07:18 -04:00
Jack Humbert
03b1904b2e Merge branch 'master' of github.com:qmk/qmk_firmware into planck_rev6 2018-04-03 21:00:22 -04:00
Jack Humbert
bb71a988c2 flesh out dip and encoder support 2018-04-03 20:57:11 -04:00
Jack Humbert
ddee61c9ba adds ws2812 driver for arm 2018-03-25 16:09:40 -04:00
Jack Humbert
91efe74365 music map init, dip scan added 2018-03-22 01:35:33 -04:00
Jack Humbert
12a64ff24b initial files for rev 6 with encoder 2018-03-16 03:38:20 -04:00
Jack Humbert
b034896cd3 update submodule 2018-03-05 20:24:20 -05:00
Some Person
2bd625b754 bla 2018-03-05 19:58:38 -05:00
Jack Humbert
da32068f48 update to qwerty 2018-02-26 21:29:07 -05:00
Jack Humbert
b308d6709e working 2018-02-23 12:09:03 -05:00
Jack Humbert
123ad0de95 try more stuff 2018-02-23 11:29:30 -05:00
Jack Humbert
00fc38435f master working 2018-02-22 21:22:47 -05:00
Jack Humbert
8b5b41bb47 update handwire with arm changes 2018-02-19 22:00:38 -05:00
Jack Humbert
4bdde668e1 Merge branch 'master' of github.com:qmk/qmk_firmware into handwire 2018-02-19 21:47:46 -05:00
Jack Humbert
3c0d86eb47 a little progress 2018-02-15 02:06:06 -05:00
Jack Humbert
f60166c1a1 Merge branch 'master' of github.com:qmk/qmk_firmware into handwire 2018-02-14 15:35:30 -05:00
Jack Humbert
7d59f83b2e adds matrix i2c swap 2018-02-14 15:35:24 -05:00
Jack Humbert
be81cd8c98 adds i2c slave implementation 2018-02-10 16:32:05 -05:00
Jack Humbert
b075df1c87 merge 2018-02-09 13:30:28 -05:00
Jack Humbert
8a91aa5e6c Merge branch 'master' of github.com:qmk/qmk_firmware into handwire 2018-02-07 17:33:18 -05:00
Jack Humbert
fae437cfad update matrix 2018-02-07 17:17:39 -05:00
Jack Humbert
fc91bf4a65 updated matrix and keymap 2018-02-01 14:48:25 -05:00
Jack Humbert
78ea99d154 start f303 handwire 2018-01-31 13:31:20 -05:00
Jack Humbert
2165f9d654 get one channel working 2018-01-27 02:05:09 -05:00
Jack Humbert
31df12c84f chibios stack size inc 2018-01-26 23:56:48 -05:00
Jack Humbert
d09d9f32bd Merge branch 'master' into arm_audio_fixes 2018-01-26 22:54:57 -05:00
Jack Humbert
690a08cbbb fix up arm audio implementation 2018-01-15 16:06:49 -05:00
419 changed files with 24891 additions and 2523 deletions

1
.gitmodules vendored
View File

@ -1,6 +1,7 @@
[submodule "lib/chibios"]
path = lib/chibios
url = https://github.com/qmk/ChibiOS
branch = handwire
[submodule "lib/chibios-contrib"]
path = lib/chibios-contrib
url = https://github.com/qmk/ChibiOS-Contrib

View File

@ -67,7 +67,7 @@ $(eval $(call NEXT_PATH_ELEMENT))
# It's really a very simple if else chain, if you squint enough,
# but the makefile syntax makes it very verbose.
# If we are in a subfolder of keyboards
#
#
# *** No longer needed **
#
# ifeq ($(CURRENT_PATH_ELEMENT),keyboards)
@ -320,6 +320,14 @@ define PARSE_KEYBOARD
KEYMAPS += $$(notdir $$(patsubst %/.,%,$$(wildcard $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_3)/keymaps/*/.)))
KEYMAPS += $$(notdir $$(patsubst %/.,%,$$(wildcard $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_4)/keymaps/*/.)))
KEYMAPS += $$(notdir $$(patsubst %/.,%,$$(wildcard $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_5)/keymaps/*/.)))
# get subkeymaps too
KEYMAPS += $$(patsubst $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_1)/keymaps/%,%,$$(patsubst %/.,%,$$(wildcard $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_1)/keymaps/*/*/.)))
KEYMAPS += $$(patsubst $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_2)/keymaps/%,%,$$(patsubst %/.,%,$$(wildcard $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_2)/keymaps/*/*/.)))
KEYMAPS += $$(patsubst $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_3)/keymaps/%,%,$$(patsubst %/.,%,$$(wildcard $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_3)/keymaps/*/*/.)))
KEYMAPS += $$(patsubst $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_4)/keymaps/%,%,$$(patsubst %/.,%,$$(wildcard $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_4)/keymaps/*/*/.)))
KEYMAPS += $$(patsubst $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_5)/keymaps/%,%,$$(patsubst %/.,%,$$(wildcard $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_5)/keymaps/*/*/.)))
# this might be needed, but in a different form
#KEYMAPS := $$(sort $$(filter-out $$(KEYBOARD_FOLDER_1) $$(KEYBOARD_FOLDER_2) \
$$(KEYBOARD_FOLDER_3) $$(KEYBOARD_FOLDER_4) $$(KEYBOARD_FOLDER_5), $$(KEYMAPS)))
@ -353,9 +361,11 @@ define PARSE_KEYBOARD
LAYOUT_KEYMAPS :=
$$(foreach LAYOUT,$$(KEYBOARD_LAYOUTS),$$(eval LAYOUT_KEYMAPS += $$(notdir $$(patsubst %/.,%,$$(wildcard $(ROOT_DIR)/layouts/*/$$(LAYOUT)/*/.)))))
KEYMAPS := $$(sort $$(KEYMAPS) $$(LAYOUT_KEYMAPS))
# $$(eval $$(info $$(KEYMAPS)))
# if the rule after removing the start of it is empty (we haven't specified a kemap or target)
# compile all the keymaps
ifeq ($$(RULE),)
@ -411,7 +421,8 @@ define PARSE_KEYMAP
MAKE_TARGET := $$(patsubst :%,%,$$(RULE))
# We need to generate an unique indentifer to append to the COMMANDS list
CURRENT_KB_UNDER := $$(subst /,_,$$(CURRENT_KB))
COMMAND := COMMAND_KEYBOARD_$$(CURRENT_KB_UNDER)_KEYMAP_$$(CURRENT_KM)
CURRENT_KM_UNDER := $$(subst /,_,$$(CURRENT_KM))
COMMAND := COMMAND_KEYBOARD_$$(CURRENT_KB_UNDER)_KEYMAP_$$(CURRENT_KM_UNDER)
# If we are compiling a keyboard without a subproject, we want to display just the name
# of the keyboard, otherwise keyboard/subproject
KB_SP := $$(CURRENT_KB)

View File

@ -19,8 +19,9 @@ KEYBOARD_FOLDER_4 := $(notdir $(KEYBOARD_FOLDER_PATH_4))
KEYBOARD_FOLDER_5 := $(notdir $(KEYBOARD_FOLDER_PATH_5))
KEYBOARD_FILESAFE := $(subst /,_,$(KEYBOARD))
KEYMAP_FILESAFE := $(subst /,_,$(KEYMAP))
TARGET ?= $(KEYBOARD_FILESAFE)_$(KEYMAP)
TARGET ?= $(KEYBOARD_FILESAFE)_$(KEYMAP_FILESAFE)
KEYBOARD_OUTPUT := $(BUILD_DIR)/obj_$(KEYBOARD_FILESAFE)
# Force expansion
@ -176,26 +177,44 @@ MAIN_KEYMAP_PATH_3 := $(KEYBOARD_PATH_3)/keymaps/$(KEYMAP)
MAIN_KEYMAP_PATH_4 := $(KEYBOARD_PATH_4)/keymaps/$(KEYMAP)
MAIN_KEYMAP_PATH_5 := $(KEYBOARD_PATH_5)/keymaps/$(KEYMAP)
PARENT_MAIN_KEYMAP_PATH_1 := $(patsubst %/,%,$(dir $(MAIN_KEYMAP_PATH_1)))
PARENT_MAIN_KEYMAP_PATH_2 := $(patsubst %/,%,$(dir $(MAIN_KEYMAP_PATH_2)))
PARENT_MAIN_KEYMAP_PATH_3 := $(patsubst %/,%,$(dir $(MAIN_KEYMAP_PATH_3)))
PARENT_MAIN_KEYMAP_PATH_4 := $(patsubst %/,%,$(dir $(MAIN_KEYMAP_PATH_4)))
PARENT_MAIN_KEYMAP_PATH_5 := $(patsubst %/,%,$(dir $(MAIN_KEYMAP_PATH_5)))
# $(info $(PARENT_MAIN_KEYMAP_PATH_1))
ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_5)/keymap.c)","")
-include $(MAIN_KEYMAP_PATH_5)/rules.mk
KEYMAP_C := $(MAIN_KEYMAP_PATH_5)/keymap.c
KEYMAP_PATH := $(MAIN_KEYMAP_PATH_5)
else ifneq ("$(wildcard $(PARENT_MAIN_KEYMAP_PATH_5)/keymap.c)","")
KEYMAP_C := $(PARENT_MAIN_KEYMAP_PATH_5)/keymap.c
KEYMAP_PATH := $(MAIN_KEYMAP_PATH_5)
else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_4)/keymap.c)","")
-include $(MAIN_KEYMAP_PATH_4)/rules.mk
KEYMAP_C := $(MAIN_KEYMAP_PATH_4)/keymap.c
KEYMAP_PATH := $(MAIN_KEYMAP_PATH_4)
else ifneq ("$(wildcard $(PARENT_MAIN_KEYMAP_PATH_4)/keymap.c)","")
KEYMAP_C := $(PARENT_MAIN_KEYMAP_PATH_4)/keymap.c
KEYMAP_PATH := $(MAIN_KEYMAP_PATH_4)
else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_3)/keymap.c)","")
-include $(MAIN_KEYMAP_PATH_3)/rules.mk
KEYMAP_C := $(MAIN_KEYMAP_PATH_3)/keymap.c
KEYMAP_PATH := $(MAIN_KEYMAP_PATH_3)
else ifneq ("$(wildcard $(PARENT_MAIN_KEYMAP_PATH_3)/keymap.c)","")
KEYMAP_C := $(PARENT_MAIN_KEYMAP_PATH_3)/keymap.c
KEYMAP_PATH := $(MAIN_KEYMAP_PATH_3)
else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_2)/keymap.c)","")
-include $(MAIN_KEYMAP_PATH_2)/rules.mk
KEYMAP_C := $(MAIN_KEYMAP_PATH_2)/keymap.c
KEYMAP_PATH := $(MAIN_KEYMAP_PATH_2)
else ifneq ("$(wildcard $(PARENT_MAIN_KEYMAP_PATH_2)/keymap.c)","")
KEYMAP_C := $(PARENT_MAIN_KEYMAP_PATH_2)/keymap.c
KEYMAP_PATH := $(MAIN_KEYMAP_PATH_2)
else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_1)/keymap.c)","")
-include $(MAIN_KEYMAP_PATH_1)/rules.mk
KEYMAP_C := $(MAIN_KEYMAP_PATH_1)/keymap.c
KEYMAP_PATH := $(MAIN_KEYMAP_PATH_1)
else ifneq ("$(wildcard $(PARENT_MAIN_KEYMAP_PATH_1)/keymap.c)","")
KEYMAP_C := $(PARENT_MAIN_KEYMAP_PATH_1)/keymap.c
KEYMAP_PATH := $(MAIN_KEYMAP_PATH_1)
else ifneq ($(LAYOUTS),)
include build_layout.mk
else
@ -203,26 +222,34 @@ else
# this state should never be reached
endif
PARENT_KEYMAP_PATH := $(patsubst %/,%,$(dir $(KEYMAP_PATH)))
# User space stuff
ifeq ("$(USER_NAME)","")
USER_NAME := $(KEYMAP)
endif
USER_PATH := users/$(USER_NAME)
-include $(USER_PATH)/rules.mk
ifneq ("$(wildcard users/$(KEYMAP)/config.h)","")
CONFIG_H += users/$(KEYMAP)/config.h
endif
# Object files directory
# To put object files in current directory, use a dot (.), do NOT make
# this an empty or blank macro!
KEYMAP_OUTPUT := $(BUILD_DIR)/obj_$(TARGET)
-include $(PARENT_KEYMAP_PATH)/rules.mk
-include $(KEYMAP_PATH)/rules.mk
-include $(USER_PATH)/rules.mk
ifneq ("$(wildcard $(PARENT_KEYMAP_PATH)/config.h)","")
CONFIG_H += $(PARENT_KEYMAP_PATH)/config.h
endif
ifneq ("$(wildcard $(KEYMAP_PATH)/config.h)","")
CONFIG_H += $(KEYMAP_PATH)/config.h
endif
ifneq ("$(wildcard $(USER_PATH)/config.h)","")
CONFIG_H += $(USER_PATH)/config.h
endif
# # project specific files
SRC += $(KEYBOARD_SRC) \
@ -233,6 +260,7 @@ SRC += $(KEYBOARD_SRC) \
#EXTRALDFLAGS = -Wl,--relax
# Search Path
VPATH += $(PARENT_KEYMAP_PATH)
VPATH += $(KEYMAP_PATH)
VPATH += $(KEYBOARD_PATHS)
VPATH += $(COMMON_VPATH)

View File

@ -3,11 +3,15 @@ LAYOUTS_REPOS := $(patsubst %/,%,$(sort $(dir $(wildcard $(LAYOUTS_PATH)/*/))))
define SEARCH_LAYOUTS_REPO
LAYOUT_KEYMAP_PATH := $$(LAYOUTS_REPO)/$$(LAYOUT)/$$(KEYMAP)
PARENT_LAYOUT_KEYMAP_PATH := $(patsubst %/,%,$(dir $(LAYOUT_KEYMAP_PATH)))
LAYOUT_KEYMAP_C := $$(LAYOUT_KEYMAP_PATH)/keymap.c
PARENT_LAYOUT_KEYMAP_C := $$(PARENT_LAYOUT_KEYMAP_PATH)/keymap.c
ifneq ("$$(wildcard $$(LAYOUT_KEYMAP_C))","")
-include $$(LAYOUT_KEYMAP_PATH)/rules.mk
KEYMAP_C := $$(LAYOUT_KEYMAP_C)
KEYMAP_PATH := $$(LAYOUT_KEYMAP_PATH)
else ifneq ("$$(wildcard $$(PARENT_LAYOUT_KEYMAP_C))","")
KEYMAP_C := $$(PARENT_LAYOUT_KEYMAP_C)
KEYMAP_PATH := $$(LAYOUT_KEYMAP_PATH)
endif
endef
@ -15,4 +19,4 @@ define SEARCH_LAYOUTS
$$(foreach LAYOUTS_REPO,$$(LAYOUTS_REPOS),$$(eval $$(call SEARCH_LAYOUTS_REPO)))
endef
$(foreach LAYOUT,$(LAYOUTS),$(eval $(call SEARCH_LAYOUTS)))
$(foreach LAYOUT,$(LAYOUTS),$(eval $(call SEARCH_LAYOUTS)))

View File

@ -3,16 +3,16 @@ include message.mk
# Directory common source files exist
TOP_DIR = .
TMK_DIR = tmk_core
TMK_PATH = $(TOP_DIR)/$(TMK_DIR)
LIB_PATH = $(TOP_DIR)/lib
TMK_PATH = $(TMK_DIR)
LIB_PATH = lib
QUANTUM_DIR = quantum
QUANTUM_PATH = $(TOP_DIR)/$(QUANTUM_DIR)
QUANTUM_PATH = $(QUANTUM_DIR)
DRIVER_DIR = drivers
DRIVER_PATH = $(TOP_DIR)/$(DRIVER_DIR)
DRIVER_PATH = $(DRIVER_DIR)
BUILD_DIR := $(TOP_DIR)/.build
BUILD_DIR := .build
COMMON_VPATH := $(TOP_DIR)
COMMON_VPATH += $(TMK_PATH)
@ -21,4 +21,4 @@ COMMON_VPATH += $(QUANTUM_PATH)/keymap_extras
COMMON_VPATH += $(QUANTUM_PATH)/audio
COMMON_VPATH += $(QUANTUM_PATH)/process_keycode
COMMON_VPATH += $(QUANTUM_PATH)/api
COMMON_VPATH += $(DRIVER_PATH)
COMMON_VPATH += $(DRIVER_PATH)

View File

@ -20,6 +20,13 @@ SERIAL_SRC += $(wildcard $(SERIAL_PATH)/system/*.c)
SERIAL_DEFS += -DSERIAL_LINK_ENABLE
COMMON_VPATH += $(SERIAL_PATH)
COMMON_VPATH += $(DRIVER_PATH)
ifeq ($(PLATFORM),AVR)
COMMON_VPATH += $(DRIVER_PATH)/avr
else
COMMON_VPATH += $(DRIVER_PATH)/arm
endif
ifeq ($(strip $(API_SYSEX_ENABLE)), yes)
OPT_DEFS += -DAPI_SYSEX_ENABLE
SRC += $(QUANTUM_DIR)/api/api_sysex.c
@ -117,7 +124,7 @@ endif
ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes)
OPT_DEFS += -DRGB_MATRIX_ENABLE
SRC += is31fl3731.c
SRC += i2c_master.c
I2C_ENABLE = yes
SRC += $(QUANTUM_DIR)/color.c
SRC += $(QUANTUM_DIR)/rgb_matrix.c
CIE1931_CURVE = yes
@ -197,6 +204,25 @@ ifeq ($(strip $(USB_HID_ENABLE)), yes)
include $(TMK_DIR)/protocol/usb_hid.mk
endif
ifeq ($(strip $(I2C_SLAVE_ENABLE)), yes)
I2C_ENABLE = yes
OPT_DEFS += -DI2C_SLAVE_ENABLE
endif
ifeq ($(strip $(ENCODER_ENABLE)), yes)
OPT_DEFS += -DENCODER_ENABLE
SRC += $(QUANTUM_DIR)/encoder.c
endif
ifeq ($(strip $(QWIIC_KEYBOARD_ENABLE)), yes)
SRC += qwiic/qwiic_keyboard.c
OPT_DEFS += -DQWIIC_KEYBOARD_ENABLE
endif
ifeq ($(strip $(I2C_ENABLE)), yes)
SRC += twi2c.c
endif
QUANTUM_SRC:= \
$(QUANTUM_DIR)/quantum.c \
$(QUANTUM_DIR)/keymap_common.c \

1
docs/CNAME Normal file
View File

@ -0,0 +1 @@
docs.qmk.fm

View File

@ -19,7 +19,7 @@ Otherwise, you can either download it directly ([zip](https://github.com/qmk/qmk
## How to Compile
Before you are able to compile, you'll need to [install an environment](01_Getting_Started/01_Install_Build_Tools.md) for AVR or/and ARM development. Once that is complete, you'll use the `make` command to build a keyboard and keymap with the following notation:
Before you are able to compile, you'll need to [install an environment](getting_started_build_tools.md) for AVR or/and ARM development. Once that is complete, you'll use the `make` command to build a keyboard and keymap with the following notation:
make planck/rev4:default
@ -29,4 +29,4 @@ This would build the `rev4` revision of the `planck` with the `default` keymap.
## How to Customize
QMK has lots of [features](05_Features/index.md) to explore, and a good deal of [reference documentation](http://docs.qmk.fm) to dig through. Most features are taken advantage of by modifying your [keymap](07_Reference/Keymap_Overview.md), and changing the [keycodes](06_Keycodes/index.md).
QMK has lots of [features](features.md) to explore, and a good deal of [reference documentation](http://docs.qmk.fm) to dig through. Most features are taken advantage of by modifying your [keymap](keymap.md), and changing the [keycodes](keycodes.md).

View File

@ -43,6 +43,7 @@
* [Pointing Device](feature_pointing_device.md)
* [PS/2 Mouse](feature_ps2_mouse.md)
* [RGB Lighting](feature_rgblight.md)
* [RGB Matrix](feature_rgb_matrix.md)
* [Space Cadet Shift](feature_space_cadet.md)
* [Space Cadet Shift Enter](feature_space_shift_cadet.md)
* [Stenography](feature_stenography.md)

View File

@ -34,6 +34,7 @@
* [Bootmagic](feature_bootmagic.md)
* [Command](feature_command.md)
* [Dynamic Macros](feature_dynamic_macros.md)
* [Encoders](feature_encoders.md)
* [Grave Escape](feature_grave_esc.md)
* [Key Lock](feature_key_lock.md)
* [Layouts](feature_layouts.md)

View File

@ -101,7 +101,7 @@ You'll find all our documentation in the `qmk_firmware/docs` directory, or if yo
Most first-time QMK contributors start with their personal keymaps. We try to keep keymap standards pretty casual (keymaps, after all, reflect the personality of their creators) but we do ask that you follow these guidelines to make it easier for others to discover and learn from your keymap.
* Write a `readme.md` using [the template](https://docs.qmk.fm/documentation_templates.html#).
* Write a `readme.md` using [the template](documentation_templates.md).
* All Keymap PR's are squashed, so if you care about how your commits are squashed you should do it yourself
* Do not lump features in with keymap PR's. Submit the feature first and then a second PR for the keymap.
* Do not include `Makefile`s in your keymap folder (they're no longer used)
@ -113,7 +113,7 @@ Keyboards are the raison d'être for QMK. Some keyboards are community maintaine
We also ask that you follow these guidelines:
* Write a `readme.md` using [the template](https://docs.qmk.fm/documentation_templates.html#).
* Write a `readme.md` using [the template](documentation_templates.md).
* Keep the number of commits reasonable or we will squash your PR
* Do not lump core features in with new keyboards. Submit the feature first and then submit a separate PR for the keyboard.
* Name `.c`/`.h` file after the immediate parent folder, eg `/keyboards/<kb1>/<kb2>/<kb2>.[ch]`
@ -140,7 +140,7 @@ We also ask that you follow these guidelines:
* Keep the number of commits reasonable or we will squash your PR
* Do not lump keyboards or keymaps in with core changes. Submit your core changes first.
* Write [Unit Tests](http://docs.qmk.fm/unit_testing.html) for your feature
* Write [Unit Tests](unit_testing.md) for your feature
* Follow the style of the file you are editing. If the style is unclear or there are mixed styles you should conform to the [coding conventions](#coding-conventions) above.
## Refactoring

41
docs/feature_encoders.md Normal file
View File

@ -0,0 +1,41 @@
# Encoders
Basic encoders are supported by adding this to your `rules.mk`:
ENCODER_ENABLE = yes
and this to your `config.h`:
#define NUMBER_OF_ENCODERS 1
#define ENCODERS_PAD_A { B12 }
#define ENCODERS_PAD_B { B13 }
Each PAD_A/B variable defines an array so multiple encoders can be defined, e.g.:
#define ENCODERS_PAD_A { encoder1a, encoder2a }
#define ENCODERS_PAD_B { encoder1a, encoder2b }
If your encoder's clockwise directions are incorrect, you can swap the A & B pad definitions.
Additionally, the resolution can be specified in the same file (the default & suggested is 4):
#define ENCODER_RESOLUTION 4
## Callbacks
The callback functions can be inserted into your `<keyboard>.c`:
void encoder_update_kb(uint8_t index, bool clockwise) {
encoder_update_user(index, clockwise);
}
or `keymap.c`:
void encoder_update_user(uint8_t index, bool clockwise) {
}
## Hardware
The A an B lines of the encoders should be wired directly to the MCU, and the C/common lines should be wired to ground.

View File

@ -17,14 +17,16 @@ void matrix_scan_user(void) {
leader_end();
SEQ_ONE_KEY(KC_F) {
register_code(KC_S);
unregister_code(KC_S);
// Anything you can do in a macro.
SEND_STRING("QMK is awesome.");
}
SEQ_TWO_KEYS(KC_D, KC_D) {
SEND_STRING(SS_LCTRL("a")SS_LCTRL("c"));
}
SEQ_THREE_KEYS(KC_D, KC_D, KC_S) {
SEND_STRING("https://start.duckduckgo.com"SS_TAP(X_ENTER));
}
SEQ_TWO_KEYS(KC_A, KC_S) {
register_code(KC_H);
unregister_code(KC_H);
}
SEQ_THREE_KEYS(KC_A, KC_S, KC_D) {
register_code(KC_LGUI);
register_code(KC_S);
unregister_code(KC_S);
@ -34,4 +36,6 @@ void matrix_scan_user(void) {
}
```
As you can see, you have three function. you can use - `SEQ_ONE_KEY` for single-key sequences (Leader followed by just one key), and `SEQ_TWO_KEYS` and `SEQ_THREE_KEYS` for longer sequences. Each of these accepts one or more keycodes as arguments. This is an important point: You can use keycodes from **any layer on your keyboard**. That layer would need to be active for the leader macro to fire, obviously.
As you can see, you have a few function. You can use `SEQ_ONE_KEY` for single-key sequences (Leader followed by just one key), and `SEQ_TWO_KEYS`, `SEQ_THREE_KEYS` up to `SEQ_FIVE_KEYS` for longer sequences.
Each of these accepts one or more keycodes as arguments. This is an important point: You can use keycodes from **any layer on your keyboard**. That layer would need to be active for the leader macro to fire, obviously.

View File

@ -88,11 +88,36 @@ const uint16_t RGBLED_GRADIENT_RANGES[] PROGMEM = {360, 240, 180, 120, 90};
Look in `rgblights.h` for all available functions, but if you want to control all or some LEDs your goto functions are:
```c
rgblight_disable(); // turn all lights off
rgblight_enable(); // turn lights on, based on their previous state (stored in EEPROM)
// turn all lights off (stored in EEPROM)
rgblight_disable();
// turn lights on, based on their previous state (stored in EEPROM)
rgblight_enable();
// turn all lights off (not stored in EEPROM)
rgblight_disable_noeeprom();
// turn lights on, based on their previous state (not stored in EEPROM)
rgblight_enable_noeeprom();
// where r/g/b is a number from 0..255. Turns all the LEDs to this color (ignores mode, not stored in EEPROM).
rgblight_setrgb(r, g, b);
// HSV color control - h is a value from 0..360 and s/v is a value from 0..255 (stored in EEPROM)
rgblight_sethsv(h, s, v);
// HSV color control - h is a value from 0..360 and s/v is a value from 0..255 (not stored in EEPROM)
rgblight_sethsv_noeeprom(h, s, v);
// Sets the mode, if rgb animations are enabled (stored in eeprom)
rgblight_mode(x);
// Sets the mode, if rgb animations are enabled (not stored in eeprom)
rgblight_mode_noeeprom(x);
// MODE 1, solid color
// MODE 2-5, breathing
// MODE 6-8, rainbow mood
// MODE 9-14, rainbow swirl
// MODE 15-20, snake
// MODE 21-23, knight
// MODE 24, xmas
// MODE 25-34, static rainbow
rgblight_setrgb(r, g, b); // where r/g/b is a number from 0..255. Turns all the LEDs to this color
rgblight_sethsv(h, s, v); // HSV color control - h is a value from 0..360 and s/v is a value from 0..255
rgblight_setrgb_at(r,g,b, LED); // control a single LED. 0 <= LED < RGBLED_NUM
rgblight_sethsv_at(h,s,v, LED); // control a single LED. 0 <= LED < RGBLED_NUM
```
@ -126,7 +151,7 @@ note: for backwards compatibility, `RGB_SMOD` is an alias for `RGB_MOD`.
## Hardware Modification
![Planck with RGB Underglow](https://raw.githubusercontent.com/qmk/qmk_firmware/master/keyboards/planck/keymaps/yang/planck-with-rgb-underglow.jpg)
![Planck with RGB Underglow](https://raw.githubusercontent.com/qmk/qmk_firmware/3774a7fcdab5544fc787f4c200be05fcd417e31f/keyboards/planck/keymaps/yang/planck-with-rgb-underglow.jpg)
Here is a quick demo on Youtube (with NPKC KC60) (https://www.youtube.com/watch?v=VKrpPAHlisY).

View File

@ -6,9 +6,9 @@ Hit the semicolon key once, send a semicolon. Hit it twice, rapidly -- send a co
With this feature one can specify keys that behave differently, based on the amount of times they have been tapped, and when interrupted, they get handled before the interrupter.
To make it clear how this is different from `ACTION_FUNCTION_TAP`, lets explore a certain setup! We want one key to send `Space` on single tap, but `Enter` on double-tap.
To make it clear how this is different from `ACTION_FUNCTION_TAP`, let's explore a certain setup! We want one key to send `Space` on single tap, but `Enter` on double-tap.
With `ACTION_FUNCTION_TAP`, it is quite a rain-dance to set this up, and has the problem that when the sequence is interrupted, the interrupting key will be send first. Thus, `SPC a` will result in `a SPC` being sent, if they are typed within `TAPPING_TERM`. With the tap dance feature, that'll come out as `SPC a`, correctly.
With `ACTION_FUNCTION_TAP`, it is quite a rain-dance to set this up, and has the problem that when the sequence is interrupted, the interrupting key will be sent first. Thus, `SPC a` will result in `a SPC` being sent, if they are typed within `TAPPING_TERM`. With the tap dance feature, that'll come out as `SPC a`, correctly.
The implementation hooks into two parts of the system, to achieve this: into `process_record_quantum()`, and the matrix scan. We need the latter to be able to time out a tap sequence even when a key is not being pressed, so `SPC` alone will time out and register after `TAPPING_TERM` time.
@ -16,13 +16,13 @@ But lets start with how to use it, first!
First, you will need `TAP_DANCE_ENABLE=yes` in your `rules.mk`, because the feature is disabled by default. This adds a little less than 1k to the firmware size. Next, you will want to define some tap-dance keys, which is easiest to do with the `TD()` macro, that - similar to `F()`, takes a number, which will later be used as an index into the `tap_dance_actions` array.
This array specifies what actions shall be taken when a tap-dance key is in action. Currently, there are three possible options:
This array specifies what actions shall be taken when a tap-dance key is in action. Currently, there are five possible options:
* `ACTION_TAP_DANCE_DOUBLE(kc1, kc2)`: Sends the `kc1` keycode when tapped once, `kc2` otherwise. When the key is held, the appropriate keycode is registered: `kc1` when pressed and held, `kc2` when tapped once, then pressed and held.
* `ACTION_TAP_DANCE_DUAL_ROLE(kc, layer)`: Sends the `kc` keycode when tapped once, or moves to `layer`. (this functions like the `TO` layer keycode).
* `ACTION_TAP_DANCE_FN(fn)`: Calls the specified function - defined in the user keymap - with the final tap count of the tap dance action.
* `ACTION_TAP_DANCE_FN_ADVANCED(on_each_tap_fn, on_dance_finished_fn, on_dance_reset_fn)`: Calls the first specified function - defined in the user keymap - on every tap, the second function on when the dance action finishes (like the previous option), and the last function when the tap dance action resets.
** `ACTION_TAP_DANCE_FN_ADVANCED_TIME(on_each_tap_fn, on_dance_finished_fn, on_dance_reset_fn, tap_specific_tapping_term)`: This functions identically to the `ACTION_TAP_DANCE_FN_ADVANCED` function, but uses a custom tapping term for it, instead of the predefined `TAPPING_TERM`.
* `ACTION_TAP_DANCE_FN_ADVANCED(on_each_tap_fn, on_dance_finished_fn, on_dance_reset_fn)`: Calls the first specified function - defined in the user keymap - on every tap, the second function when the dance action finishes (like the previous option), and the last function when the tap dance action resets.
* `ACTION_TAP_DANCE_FN_ADVANCED_TIME(on_each_tap_fn, on_dance_finished_fn, on_dance_reset_fn, tap_specific_tapping_term)`: This functions identically to the `ACTION_TAP_DANCE_FN_ADVANCED` function, but uses a custom tapping term for it, instead of the predefined `TAPPING_TERM`.
The first option is enough for a lot of cases, that just want dual roles. For example, `ACTION_TAP_DANCE_DOUBLE(KC_SPC, KC_ENT)` will result in `Space` being sent on single-tap, `Enter` otherwise.

View File

@ -17,8 +17,10 @@ QMK has a staggering number of features for building your keyboard. It can take
* [Pointing Device](feature_pointing_device.md) - Framework for connecting your custom pointing device to your keyboard.
* [PS2 Mouse](feature_ps2_mouse.md) - Driver for connecting a PS/2 mouse directly to your keyboard.
* [RGB Light](feature_rgblight.md) - RGB lighting for your keyboard.
* [RGB Matrix](feature_rgb_matrix.md) - RGB Matrix lights for per key lighting.
* [Space Cadet](feature_space_cadet.md) - Use your left/right shift keys to type parenthesis and brackets.
* [Stenography](feature_stenography.md) - Put your keyboard into Plover mode for stenography use.
* [Swap Hands](feature_swap_hands.md) - Mirror your keyboard for one handed usage.
* [Tap Dance](feature_tap_dance.md) - Make a single key do as many things as you want.
* [Terminal](feature_terminal.md) - CLI interface to the internals of your keyboard.
* [Thermal Printer](feature_thermal_printer.md) - Connect a thermal printer to your keyboard to be able to toggle on a printed log of everything you type.

View File

@ -4,6 +4,8 @@ This page describes setting up the build environment for QMK. These instructions
<!-- FIXME: We should have ARM instructions somewhere. -->
Note: If it is your first time here, Check out the "Complete Newbs guide" instead
## Linux
To ensure you are always up to date, you can just run `sudo util/install_dependencies.sh`. That should always install all the dependencies needed. **This will run `apt-get upgrade`.**

View File

@ -284,6 +284,22 @@ This is a reference only. Each group of keys links to the page documenting their
|`RGB_MODE_XMAS` |`RGB_M_X` |Christmas animation mode |
|`RGB_MODE_GRADIENT`|`RGB_M_G` |Static gradient animation mode |
## [RGB Matrix Lighting](feature_rgb_matrix.md)
|Key |Aliases |Description |
|-------------------|----------|--------------------------------------------------------------------|
|`RGB_TOG` | |Toggle RGB lighting on or off |
|`RGB_MODE_FORWARD` |`RGB_MOD` |Cycle through modes, reverse direction when Shift is held |
|`RGB_MODE_REVERSE` |`RGB_RMOD`|Cycle through modes in reverse, forward direction when Shift is held|
|`RGB_HUI` | |Increase hue |
|`RGB_HUD` | |Decrease hue |
|`RGB_SAI` | |Increase saturation |
|`RGB_SAD` | |Decrease saturation |
|`RGB_VAI` | |Increase value (brightness) |
|`RGB_VAD` | |Decrease value (brightness) |
|`RGB_SPI` | |Increase effect speed (does no support eeprom yet) |
|`RGB_SPD` | |Decrease effect speed (does no support eeprom yet) |
## [Thermal Printer](feature_thermal_printer.md)
|Key |Description |

View File

@ -2,7 +2,7 @@
Your computer keyboard has a processor inside of it, not unlike the one inside your computer. This processor runs software that is responsible for detecting button presses and sending reports about the state of the keyboard when they are pressed or released. QMK fills the role of that software, detecting button presses and passing that information on to the host computer. When you build your custom layout you are creating the equivalent of an .exe for your keyboard.
QMK tries to put a lot of power into your hands by making easy things easy, and hard things possible. You don't have to know how to program to create powerful layouts, you only have to follow a few simple syntax rules.
QMK tries to put a lot of power into your hands by making easy things easy, and hard things possible. You don't have to know how to program to create powerful layouts, you only have to follow a few simple syntax rules.
# Getting Started
@ -12,13 +12,19 @@ Before you can build keymaps you need to install some software and setup your bu
### Text Editor
You'll need a program that can edit and save **plain text** files. If you are on Windows you can make due with Notepad, and on Linux you can use Gedit, both of which are simple but functional text editors. On macOS you can not use TextEdit.app, it will not save plain text files. You will need to install another program such as Sublime Text.
You'll need a program that can edit and save **plain text** files. If you are on Windows you can make due with Notepad, and on Linux you can use Gedit, both of which are simple but functional text editors. On macOS be careful with TextEdit.app, it will not save plain text files unless you make sure to select "Make Plain text" from the "Format" menu, or you can use another program such as Sublime Text.
?> Not sure which text editor to use? Laurence Bradford wrote [a great introduction](https://learntocodewith.me/programming/basics/text-editors/) to the subject.
### QMK Toolbox
QMK Toolbox is a Windows and macOS program that allows you to both program and debug your custom keyboard. You will want to install it so that you can easily flash your keyboard and receive the debugging messages that your keyboard will print.
QMK Toolbox is an optional graphical Windows and macOS program that allows you to both program and debug your custom keyboard. You will likely prefer it to easily flash your keyboard and receive the debugging messages that your keyboard will print.
Download the files from the links below:
For Windows: "qmk_toolbox.exe" or "qmk_toolbox_install.exe" (with installer)
For Mac: "QMK.Toolbox.app.zip" or "QMK.Toolbox.pkg" (with installer)
* [Newest Release](https://github.com/qmk/qmk_toolbox/releases/latest)
* [Source Code](https://github.com/qmk/qmk_toolbox/)
@ -43,6 +49,8 @@ You will need to install msys2 and git.
You will need to install homebrew. Follow the instructions on the homebrew homepage: https://brew.sh
After homebrew is installed continue with "Download QMK", following step "Setup QMK" runs a script that will install other packages.
### Linux
You will need to install git. It's extremely likely you already have it, but if not one of the following commands should install it:

183
drivers/arm/twi2c.c Normal file
View File

@ -0,0 +1,183 @@
/* Copyright 2018 Jack Humbert
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "twi2c.h"
#include <string.h>
#include <hal.h>
#include "chprintf.h"
#include "memstreams.h"
#include "printf.h"
#include "hal_i2cslave.h"
/**
* I2C slave test routine.
*
* To use: Add file to a project, call startComms() with the address of a serial stream
*
* There are two different responses:
* a) A read-only transaction - returns the "Initial Reply" message
* b) A write then read transaction - calls a message processor and returns the generated reply.
* Stretches clock until reply available.
*/
// static const I2CConfig masterI2CConfig = {
// 400000
// };
I2CSlaveMsgCB twi2c_incoming_message_process, twi2c_catch_error, twi2c_clear_after_send;
twi2c_message_received twi2c_message_received_callback;
static uint8_t twi2c_address;
static const I2CConfig i2cconfig = {
STM32_TIMINGR_PRESC(15U) |
STM32_TIMINGR_SCLDEL(4U) | STM32_TIMINGR_SDADEL(2U) |
STM32_TIMINGR_SCLH(15U) | STM32_TIMINGR_SCLL(21U),
0,
0
};
/**
* Track I2C errors
*/
uint8_t gotI2cError = 0;
uint32_t lastI2cErrorFlags = 0;
// Called from ISR to log error
void noteI2cError(uint32_t flags)
{
lastI2cErrorFlags = flags;
gotI2cError = 1;
}
/**
* Generic error handler
*
* Called in interrupt context, so need to watch what we do
*/
void twi2c_catch_error(I2CDriver *i2cp)
{
noteI2cError(i2cp->errors);
}
/**
* Callback after sending of response complete - restores default reply in case polled
*/
uint8_t twi2c_start(void) {
i2cStart(&I2C_DRIVER, &i2cconfig);
return 0;
}
void twi2c_init(void) {
palSetGroupMode(GPIOB,6,7, PAL_MODE_INPUT); // Try releasing special pins for a short time
chThdSleepMilliseconds(10);
palSetPadMode(GPIOB, 6, PAL_MODE_ALTERNATE(4) | PAL_STM32_OTYPE_OPENDRAIN | PAL_STM32_PUPDR_PULLUP);
palSetPadMode(GPIOB, 7, PAL_MODE_ALTERNATE(4) | PAL_STM32_OTYPE_OPENDRAIN | PAL_STM32_PUPDR_PULLUP);
// try high drive (from kiibohd)
// I2C_DRIVER.i2c->C2 |= I2Cx_C2_HDRS;
// try glitch fixing (from kiibohd)
// I2C_DRIVER.i2c->FLT = 4;
}
uint8_t twi2c_write(uint8_t data) {
return i2cMasterTransmitTimeout(&I2C_DRIVER, twi2c_address/2, &data, 1, NULL, 0, MS2ST(100));
}
uint8_t twi2c_transmit(uint8_t address, uint8_t * data, uint16_t length) {
return i2cMasterTransmitTimeout(&I2C_DRIVER, address/2, data, length, NULL, 0, MS2ST(100));
}
uint8_t twi2c_receive(uint8_t address, uint8_t * data, uint16_t length) {
return i2cMasterReceiveTimeout(&I2C_DRIVER, address/2, data, length, MS2ST(100));
}
uint8_t twi2c_incoming_body[50] = {0};
uint8_t twi2c_outgoing_body[1024] = {0};
// Response to received messages
I2CSlaveMsg twi2c_incoming_message = {
sizeof(twi2c_incoming_body),
twi2c_incoming_body,
NULL,
twi2c_incoming_message_process,
twi2c_catch_error /* Error hook */
};
void twi2c_incoming_message_process(I2CDriver * i2cp) {
size_t len = i2cSlaveBytes(i2cp);
(*twi2c_message_received_callback)(i2cp, twi2c_incoming_body, len);
}
// Response to received messages
I2CSlaveMsg twi2c_outgoing_message = {
sizeof(twi2c_outgoing_body),
twi2c_outgoing_body,
NULL,
twi2c_clear_after_send,
twi2c_catch_error
};
void twi2c_clear_after_send(I2CDriver *i2cp) {
twi2c_outgoing_message.size = 0; // Clear receive message
//i2cSlaveReplyI(i2cp, &initialReply);
}
uint8_t twi2c_reply(I2CDriver * i2cp, uint8_t * data, uint16_t length) {
memcpy(twi2c_outgoing_body, data, length);
twi2c_outgoing_message.size = length;
i2cSlaveReplyI(i2cp, &twi2c_outgoing_message);
return 0;
}
uint8_t twi2c_transmit_receive(uint8_t address, uint8_t * tx_body, uint16_t tx_length, uint8_t * rx_body, uint16_t rx_length) {
return i2cMasterTransmitTimeout(&I2C_DRIVER, address/2, tx_body, tx_length, rx_body, rx_length, MS2ST(100));
}
uint8_t twi2c_start_listening(uint8_t address, twi2c_message_received callback) {
twi2c_message_received_callback = callback;
I2C_DRIVER.slaveTimeout = MS2ST(100);
i2cSlaveConfigure(&I2C_DRIVER, &twi2c_incoming_message, &twi2c_outgoing_message);
i2cMatchAddress(&I2C_DRIVER, address/2);
return 0;
}
uint8_t twi2c_remove_listening(uint8_t address) {
i2cUnmatchAddress(&I2C_DRIVER, address/2);
return 0;
}
uint8_t twi2c_add_listening(uint8_t address) {
i2cMatchAddress(&I2C_DRIVER, address/2);
return 0;
}
uint8_t twi2c_remove_listening_i(uint8_t address) {
i2cUnmatchAddressI(&I2C_DRIVER, address/2);
return 0;
}
uint8_t twi2c_add_listening_i(uint8_t address) {
i2cMatchAddressI(&I2C_DRIVER, address/2);
return 0;
}
void twi2c_stop(void) {
i2cUnmatchAll(&I2C_DRIVER);
i2cStop(&I2C_DRIVER);
}

51
drivers/arm/twi2c.h Normal file
View File

@ -0,0 +1,51 @@
/* Copyright 2018 Jack Humbert
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TWI2C_H
#define TWI2C_H
#include "ch.h"
#include "hal.h"
#ifndef I2C_DRIVER
#define I2C_DRIVER I2CD1
#endif
#define slaveI2Caddress 0x30 /* Address in our terms - halved by later code */
//#define myOtherI2Caddress 0x19
I2CSlaveMsgCB twi2c_incoming_message_process, twi2c_catch_error, twi2c_clear_after_send;
typedef void (*twi2c_message_received)(I2CDriver *, uint8_t *, uint16_t);
void twi2c_init(void);
uint8_t twi2c_start(void);
uint8_t twi2c_write(uint8_t data);
uint8_t twi2c_read_ack(void);
uint8_t twi2c_read_nack(void);
uint8_t twi2c_transmit(uint8_t address, uint8_t* data, uint16_t length);
uint8_t twi2c_receive(uint8_t address, uint8_t* data, uint16_t length);
uint8_t twi2c_writeReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length);
uint8_t twi2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length);
void twi2c_stop(void);
uint8_t twi2c_reply(I2CDriver * i2cp, uint8_t * data, uint16_t length);
uint8_t twi2c_transmit_receive(uint8_t address, uint8_t * tx_body, uint16_t tx_length, uint8_t * rx_body, uint16_t rx_length);
uint8_t twi2c_start_listening(uint8_t address, twi2c_message_received callback);
uint8_t twi2c_add_listening(uint8_t address);
uint8_t twi2c_remove_listening(uint8_t address);
uint8_t twi2c_add_listening_i(uint8_t address);
uint8_t twi2c_remove_listening_i(uint8_t address);
#endif

159
drivers/arm/ws2812.c Normal file
View File

@ -0,0 +1,159 @@
/*
* LEDDriver.c
*
* Created on: Aug 26, 2013
* Author: Omri Iluz
*/
#include "ws2812.h"
#include "stdlib.h"
static uint8_t *fb;
static int sLeds;
static stm32_gpio_t *sPort;
static uint32_t sMask;
uint8_t* dma_source;
void setColor(uint8_t color, uint8_t *buf,uint32_t mask){
int i;
for (i=0;i<8;i++){
buf[i]=((color<<i)&0b10000000?0x0:mask);
}
}
void setColorRGB(Color c, uint8_t *buf, uint32_t mask){
setColor(c.G,buf, mask);
setColor(c.R,buf+8, mask);
setColor(c.B,buf+16, mask);
}
/**
* @brief Initialize Led Driver
* @details Initialize the Led Driver based on parameters.
* Following initialization, the frame buffer would automatically be
* exported to the supplied port and pins in the right timing to drive
* a chain of WS2812B controllers
* @note The function assumes the controller is running at 72Mhz
* @note Timing is critical for WS2812. While all timing is done in hardware
* need to verify memory bandwidth is not exhausted to avoid DMA delays
*
* @param[in] leds length of the LED chain controlled by each pin
* @param[in] port which port would be used for output
* @param[in] mask Which pins would be used for output, each pin is a full chain
* @param[out] o_fb initialized frame buffer
*
*/
void ledDriverInit(int leds, stm32_gpio_t *port, uint32_t mask, uint8_t **o_fb) {
sLeds=leds;
sPort=port;
sMask=mask;
palSetGroupMode(port, sMask, 0, PAL_MODE_OUTPUT_PUSHPULL|PAL_STM32_OSPEED_HIGHEST|PAL_STM32_PUPDR_FLOATING);
// configure pwm timers -
// timer 2 as master, active for data transmission and inactive to disable transmission during reset period (50uS)
// timer 3 as slave, during active time creates a 1.25 uS signal, with duty cycle controlled by frame buffer values
static PWMConfig pwmc2 = {72000000 / 90, /* 800Khz PWM clock frequency. 1/90 of PWMC3 */
(72000000 / 90) * 0.05, /*Total period is 50ms (20FPS), including sLeds cycles + reset length for ws2812b and FB writes */
NULL,
{ {PWM_OUTPUT_ACTIVE_HIGH, NULL},
{PWM_OUTPUT_DISABLED, NULL},
{PWM_OUTPUT_DISABLED, NULL},
{PWM_OUTPUT_DISABLED, NULL}},
TIM_CR2_MMS_2, /* master mode selection */
0, };
/* master mode selection */
static PWMConfig pwmc3 = {72000000,/* 72Mhz PWM clock frequency. */
90, /* 90 cycles period (1.25 uS per period @72Mhz */
NULL,
{ {PWM_OUTPUT_ACTIVE_HIGH, NULL},
{PWM_OUTPUT_ACTIVE_HIGH, NULL},
{PWM_OUTPUT_ACTIVE_HIGH, NULL},
{PWM_OUTPUT_ACTIVE_HIGH, NULL}},
0,
0,
};
dma_source = chHeapAlloc(NULL, 1);
fb = chHeapAlloc(NULL, ((sLeds) * 24)+10);
*o_fb=fb;
int j;
for (j = 0; j < (sLeds) * 24; j++) fb[j] = 0;
dma_source[0] = sMask;
// DMA stream 2, triggered by channel3 pwm signal. if FB indicates, reset output value early to indicate "0" bit to ws2812
dmaStreamAllocate(STM32_DMA1_STREAM2, 10, NULL, NULL);
dmaStreamSetPeripheral(STM32_DMA1_STREAM2, &(sPort->BSRR.H.clear));
dmaStreamSetMemory0(STM32_DMA1_STREAM2, fb);
dmaStreamSetTransactionSize(STM32_DMA1_STREAM2, (sLeds) * 24);
dmaStreamSetMode(
STM32_DMA1_STREAM2,
STM32_DMA_CR_DIR_M2P | STM32_DMA_CR_MINC | STM32_DMA_CR_PSIZE_BYTE
| STM32_DMA_CR_MSIZE_BYTE | STM32_DMA_CR_CIRC | STM32_DMA_CR_PL(2));
// DMA stream 3, triggered by pwm update event. output high at beginning of signal
dmaStreamAllocate(STM32_DMA1_STREAM3, 10, NULL, NULL);
dmaStreamSetPeripheral(STM32_DMA1_STREAM3, &(sPort->BSRR.H.set));
dmaStreamSetMemory0(STM32_DMA1_STREAM3, dma_source);
dmaStreamSetTransactionSize(STM32_DMA1_STREAM3, 1);
dmaStreamSetMode(
STM32_DMA1_STREAM3, STM32_DMA_CR_TEIE |
STM32_DMA_CR_DIR_M2P | STM32_DMA_CR_PSIZE_BYTE | STM32_DMA_CR_MSIZE_BYTE
| STM32_DMA_CR_CIRC | STM32_DMA_CR_PL(3));
// DMA stream 6, triggered by channel1 update event. reset output value late to indicate "1" bit to ws2812.
// always triggers but no affect if dma stream 2 already change output value to 0
dmaStreamAllocate(STM32_DMA1_STREAM6, 10, NULL, NULL);
dmaStreamSetPeripheral(STM32_DMA1_STREAM6, &(sPort->BSRR.H.clear));
dmaStreamSetMemory0(STM32_DMA1_STREAM6, dma_source);
dmaStreamSetTransactionSize(STM32_DMA1_STREAM6, 1);
dmaStreamSetMode(
STM32_DMA1_STREAM6,
STM32_DMA_CR_DIR_M2P | STM32_DMA_CR_PSIZE_BYTE | STM32_DMA_CR_MSIZE_BYTE
| STM32_DMA_CR_CIRC | STM32_DMA_CR_PL(3));
pwmStart(&PWMD2, &pwmc2);
pwmStart(&PWMD3, &pwmc3);
// set pwm3 as slave, triggerd by pwm2 oc1 event. disables pwmd2 for synchronization.
PWMD3.tim->SMCR |= TIM_SMCR_SMS_0 | TIM_SMCR_SMS_2 | TIM_SMCR_TS_0;
PWMD2.tim->CR1 &= ~TIM_CR1_CEN;
// set pwm values.
// 28 (duty in ticks) / 90 (period in ticks) * 1.25uS (period in S) = 0.39 uS
pwmEnableChannel(&PWMD3, 2, 28);
// 58 (duty in ticks) / 90 (period in ticks) * 1.25uS (period in S) = 0.806 uS
pwmEnableChannel(&PWMD3, 0, 58);
// active during transfer of 90 cycles * sLeds * 24 bytes * 1/90 multiplier
pwmEnableChannel(&PWMD2, 0, 90 * sLeds * 24 / 90);
// stop and reset counters for synchronization
PWMD2.tim->CNT = 0;
// Slave (TIM3) needs to "update" immediately after master (TIM2) start in order to start in sync.
// this initial sync is crucial for the stability of the run
PWMD3.tim->CNT = 89;
PWMD3.tim->DIER |= TIM_DIER_CC3DE | TIM_DIER_CC1DE | TIM_DIER_UDE;
dmaStreamEnable(STM32_DMA1_STREAM3);
dmaStreamEnable(STM32_DMA1_STREAM6);
dmaStreamEnable(STM32_DMA1_STREAM2);
// all systems go! both timers and all channels are configured to resonate
// in complete sync without any need for CPU cycles (only DMA and timers)
// start pwm2 for system to start resonating
PWMD2.tim->CR1 |= TIM_CR1_CEN;
}
void ledDriverWaitCycle(void){
while (PWMD2.tim->CNT < 90 * sLeds * 24 / 90){chThdSleepMicroseconds(1);};
}
void testPatternFB(uint8_t *fb){
int i;
Color tmpC = {rand()%256, rand()%256, rand()%256};
for (i=0;i<sLeds;i++){
setColorRGB(tmpC,fb+24*i, sMask);
}
}
void ws2812_setleds(LED_TYPE *ledarray, uint16_t number_of_leds) {
// uint8_t i = 0;
// while (i < number_of_leds) {
// ws2812_write_led(i, ledarray[i].r, ledarray[i].g, ledarray[i].b);
// i++;
// }
}
void ws2812_setleds_rgbw(LED_TYPE *ledarray, uint16_t number_of_leds) {
}

31
drivers/arm/ws2812.h Normal file
View File

@ -0,0 +1,31 @@
/*
* LEDDriver.h
*
* Created on: Aug 26, 2013
* Author: Omri Iluz
*/
#ifndef WS2812_H_
#define WS2812_H_
#include "hal.h"
#include "rgblight_types.h"
#define sign(x) (( x > 0 ) - ( x < 0 ))
typedef struct Color Color;
struct Color {
uint8_t R;
uint8_t G;
uint8_t B;
};
void ledDriverInit(int leds, stm32_gpio_t *port, uint32_t mask, uint8_t **o_fb);
void setColorRGB(Color c, uint8_t *buf, uint32_t mask);
void testPatternFB(uint8_t *fb);
void ledDriverWaitCycle(void);
void ws2812_setleds(LED_TYPE *ledarray, uint16_t number_of_leds);
void ws2812_setleds_rgbw(LED_TYPE *ledarray, uint16_t number_of_leds);
#endif /* LEDDRIVER_H_ */

View File

@ -1,22 +0,0 @@
/* Library made by: g4lvanix
* Github repository: https://github.com/g4lvanix/I2C-master-lib
*/
#ifndef I2C_MASTER_H
#define I2C_MASTER_H
#define I2C_READ 0x01
#define I2C_WRITE 0x00
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);
#endif // I2C_MASTER_H

View File

@ -1,244 +0,0 @@
/* Copyright 2017 Jason Williams
* Copyright 2018 Jack Humbert
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "is31fl3731.h"
#include <avr/interrupt.h>
#include <avr/io.h>
#include <util/delay.h>
#include <string.h>
#include "i2c_master.h"
#include "progmem.h"
// This is a 7-bit address, that gets left-shifted and bit 0
// set to 0 for write, 1 for read (as per I2C protocol)
// The address will vary depending on your wiring:
// 0b1110100 AD <-> GND
// 0b1110111 AD <-> VCC
// 0b1110101 AD <-> SCL
// 0b1110110 AD <-> SDA
#define ISSI_ADDR_DEFAULT 0x74
#define ISSI_REG_CONFIG 0x00
#define ISSI_REG_CONFIG_PICTUREMODE 0x00
#define ISSI_REG_CONFIG_AUTOPLAYMODE 0x08
#define ISSI_REG_CONFIG_AUDIOPLAYMODE 0x18
#define ISSI_CONF_PICTUREMODE 0x00
#define ISSI_CONF_AUTOFRAMEMODE 0x04
#define ISSI_CONF_AUDIOMODE 0x08
#define ISSI_REG_PICTUREFRAME 0x01
#define ISSI_REG_SHUTDOWN 0x0A
#define ISSI_REG_AUDIOSYNC 0x06
#define ISSI_COMMANDREGISTER 0xFD
#define ISSI_BANK_FUNCTIONREG 0x0B // helpfully called 'page nine'
// Transfer buffer for TWITransmitData()
uint8_t g_twi_transfer_buffer[20];
// These buffers match the IS31FL3731 PWM registers 0x24-0xB3.
// Storing them like this is optimal for I2C transfers to the registers.
// We could optimize this and take out the unused registers from these
// buffers and the transfers in IS31FL3731_write_pwm_buffer() but it's
// probably not worth the extra complexity.
uint8_t g_pwm_buffer[DRIVER_COUNT][144];
bool g_pwm_buffer_update_required = false;
uint8_t g_led_control_registers[DRIVER_COUNT][18] = { { 0 }, { 0 } };
bool g_led_control_registers_update_required = false;
// This is the bit pattern in the LED control registers
// (for matrix A, add one to register for matrix B)
//
// reg - b7 b6 b5 b4 b3 b2 b1 b0
// 0x00 - R08,R07,R06,R05,R04,R03,R02,R01
// 0x02 - G08,G07,G06,G05,G04,G03,G02,R00
// 0x04 - B08,B07,B06,B05,B04,B03,G01,G00
// 0x06 - - , - , - , - , - ,B02,B01,B00
// 0x08 - - , - , - , - , - , - , - , -
// 0x0A - B17,B16,B15, - , - , - , - , -
// 0x0C - G17,G16,B14,B13,B12,B11,B10,B09
// 0x0E - R17,G15,G14,G13,G12,G11,G10,G09
// 0x10 - R16,R15,R14,R13,R12,R11,R10,R09
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);
}
void IS31FL3731_write_pwm_buffer( uint8_t addr, uint8_t *pwm_buffer )
{
// assumes bank is already selected
// transmit PWM registers in 9 transfers of 16 bytes
// 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 )
{
// 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++ )
{
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);
}
}
void IS31FL3731_init( uint8_t addr )
{
// In order to avoid the LEDs being driven with garbage data
// in the LED driver's PWM registers, first enable software shutdown,
// then set up the mode and other settings, clear the PWM registers,
// then disable software shutdown.
// select "function register" bank
IS31FL3731_write_register( addr, ISSI_COMMANDREGISTER, ISSI_BANK_FUNCTIONREG );
// enable software shutdown
IS31FL3731_write_register( addr, ISSI_REG_SHUTDOWN, 0x00 );
// this delay was copied from other drivers, might not be needed
_delay_ms( 10 );
// picture mode
IS31FL3731_write_register( addr, ISSI_REG_CONFIG, ISSI_REG_CONFIG_PICTUREMODE );
// display frame 0
IS31FL3731_write_register( addr, ISSI_REG_PICTUREFRAME, 0x00 );
// audio sync off
IS31FL3731_write_register( addr, ISSI_REG_AUDIOSYNC, 0x00 );
// select bank 0
IS31FL3731_write_register( addr, ISSI_COMMANDREGISTER, 0 );
// turn off all LEDs in the LED control register
for ( int i = 0x00; i <= 0x11; i++ )
{
IS31FL3731_write_register( addr, i, 0x00 );
}
// turn off all LEDs in the blink control register (not really needed)
for ( int i = 0x12; i <= 0x23; i++ )
{
IS31FL3731_write_register( addr, i, 0x00 );
}
// set PWM on all LEDs to 0
for ( int i = 0x24; i <= 0xB3; i++ )
{
IS31FL3731_write_register( addr, i, 0x00 );
}
// select "function register" bank
IS31FL3731_write_register( addr, ISSI_COMMANDREGISTER, ISSI_BANK_FUNCTIONREG );
// disable software shutdown
IS31FL3731_write_register( addr, ISSI_REG_SHUTDOWN, 0x01 );
// select bank 0 and leave it selected.
// 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 )
{
if ( index >= 0 && index < DRIVER_LED_TOTAL ) {
is31_led led = g_is31_leds[index];
// Subtract 0x24 to get the second index of g_pwm_buffer
g_pwm_buffer[led.driver][led.r - 0x24] = red;
g_pwm_buffer[led.driver][led.g - 0x24] = green;
g_pwm_buffer[led.driver][led.b - 0x24] = blue;
g_pwm_buffer_update_required = true;
}
}
void IS31FL3731_set_color_all( uint8_t red, uint8_t green, uint8_t blue )
{
for ( int i = 0; i < DRIVER_LED_TOTAL; i++ )
{
IS31FL3731_set_color( i, red, green, blue );
}
}
void IS31FL3731_set_led_control_register( uint8_t index, bool red, bool green, bool blue )
{
is31_led led = g_is31_leds[index];
uint8_t control_register_r = (led.r - 0x24) / 8;
uint8_t control_register_g = (led.g - 0x24) / 8;
uint8_t control_register_b = (led.b - 0x24) / 8;
uint8_t bit_r = (led.r - 0x24) % 8;
uint8_t bit_g = (led.g - 0x24) % 8;
uint8_t bit_b = (led.b - 0x24) % 8;
if ( red ) {
g_led_control_registers[led.driver][control_register_r] |= (1 << bit_r);
} else {
g_led_control_registers[led.driver][control_register_r] &= ~(1 << bit_r);
}
if ( green ) {
g_led_control_registers[led.driver][control_register_g] |= (1 << bit_g);
} else {
g_led_control_registers[led.driver][control_register_g] &= ~(1 << bit_g);
}
if ( blue ) {
g_led_control_registers[led.driver][control_register_b] |= (1 << bit_b);
} else {
g_led_control_registers[led.driver][control_register_b] &= ~(1 << bit_b);
}
g_led_control_registers_update_required = true;
}
void IS31FL3731_update_pwm_buffers( uint8_t addr1, uint8_t addr2 )
{
if ( g_pwm_buffer_update_required )
{
IS31FL3731_write_pwm_buffer( addr1, g_pwm_buffer[0] );
IS31FL3731_write_pwm_buffer( addr2, g_pwm_buffer[1] );
}
g_pwm_buffer_update_required = false;
}
void IS31FL3731_update_led_control_registers( uint8_t addr1, uint8_t addr2 )
{
if ( g_led_control_registers_update_required )
{
for ( int i=0; i<18; i++ )
{
IS31FL3731_write_register(addr1, i, g_led_control_registers[0][i] );
IS31FL3731_write_register(addr2, i, g_led_control_registers[1][i] );
}
}
}

122
drivers/avr/i2c_master.c → drivers/avr/twi2c.c Executable file → Normal file
View File

@ -5,44 +5,44 @@
#include <avr/io.h>
#include <util/twi.h>
#include "i2c_master.h"
#include "twi2c.h"
#define F_SCL 400000UL // SCL frequency
#define Prescaler 1
#define TWBR_val ((((F_CPU / F_SCL) / Prescaler) - 16 ) / 2)
void i2c_init(void)
void twi2c_init(void)
{
TWBR = (uint8_t)TWBR_val;
}
uint8_t i2c_start(uint8_t address)
uint8_t twi2c_start(uint8_t address)
{
// 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)) );
// check if the start condition was successfully transmitted
if((TWSR & 0xF8) != TW_START){ return 1; }
// 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)) );
// 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;
}
uint8_t i2c_write(uint8_t data)
uint8_t twi2c_write(uint8_t data)
{
// load data into data register
TWDR = data;
@ -50,26 +50,26 @@ uint8_t i2c_write(uint8_t 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;
}
uint8_t i2c_read_ack(void)
uint8_t twi2c_read_ack(void)
{
// start TWI module and acknowledge data after reception
TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWEA);
TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWEA);
// wait for end of transmission
while( !(TWCR & (1<<TWINT)) );
// return received data from TWDR
return TWDR;
}
uint8_t i2c_read_nack(void)
uint8_t twi2c_read_nack(void)
{
// start receiving without acknowledging reception
TWCR = (1<<TWINT) | (1<<TWEN);
// wait for end of transmission
@ -78,71 +78,71 @@ uint8_t i2c_read_nack(void)
return TWDR;
}
uint8_t i2c_transmit(uint8_t address, uint8_t* data, uint16_t length)
uint8_t twi2c_transmit(uint8_t address, uint8_t* data, uint16_t length)
{
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;
}
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);
if (twi2c_start(address | I2C_WRITE)) return 1;
for (uint16_t i = 0; i < length; i++)
{
if (i2c_write(data[i])) return 1;
if (twi2c_write(data[i])) return 1;
}
i2c_stop();
twi2c_stop();
return 0;
}
uint8_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length)
uint8_t twi2c_receive(uint8_t address, uint8_t* data, uint16_t length)
{
if (i2c_start(devaddr)) return 1;
i2c_write(regaddr);
if (i2c_start(devaddr | 0x01)) return 1;
if (twi2c_start(address | I2C_READ)) return 1;
for (uint16_t i = 0; i < (length-1); i++)
{
data[i] = i2c_read_ack();
data[i] = twi2c_read_ack();
}
data[(length-1)] = i2c_read_nack();
data[(length-1)] = twi2c_read_nack();
i2c_stop();
twi2c_stop();
return 0;
}
void i2c_stop(void)
uint8_t twi2c_writeReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length)
{
if (twi2c_start(devaddr | 0x00)) return 1;
twi2c_write(regaddr);
for (uint16_t i = 0; i < length; i++)
{
if (twi2c_write(data[i])) return 1;
}
twi2c_stop();
return 0;
}
uint8_t twi2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length)
{
if (twi2c_start(devaddr)) return 1;
twi2c_write(regaddr);
if (twi2c_start(devaddr | 0x01)) return 1;
for (uint16_t i = 0; i < (length-1); i++)
{
data[i] = twi2c_read_ack();
}
data[(length-1)] = twi2c_read_nack();
twi2c_stop();
return 0;
}
void twi2c_stop(void)
{
// transmit STOP condition
TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWSTO);

22
drivers/avr/twi2c.h Normal file
View File

@ -0,0 +1,22 @@
/* Library made by: g4lvanix
* Github repository: https://github.com/g4lvanix/I2C-master-lib
*/
#ifndef TWI2C_H
#define TWI2C_H
#define I2C_READ 0x01
#define I2C_WRITE 0x00
void twi2c_init(void);
uint8_t twi2c_start(uint8_t address);
uint8_t twi2c_write(uint8_t data);
uint8_t twi2c_read_ack(void);
uint8_t twi2c_read_nack(void);
uint8_t twi2c_transmit(uint8_t address, uint8_t* data, uint16_t length);
uint8_t twi2c_receive(uint8_t address, uint8_t* data, uint16_t length);
uint8_t twi2c_writeReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length);
uint8_t twi2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length);
void twi2c_stop(void);
#endif // I2C_MASTER_H

244
drivers/is31fl3731.c Normal file
View File

@ -0,0 +1,244 @@
/* Copyright 2017 Jason Williams
* Copyright 2018 Jack Humbert
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "is31fl3731.h"
#include "wait.h"
#include <string.h>
#include "twi2c.h"
#include "progmem.h"
// This is a 7-bit address, that gets left-shifted and bit 0
// set to 0 for write, 1 for read (as per I2C protocol)
// The address will vary depending on your wiring:
// 0b1110100 AD <-> GND
// 0b1110111 AD <-> VCC
// 0b1110101 AD <-> SCL
// 0b1110110 AD <-> SDA
#define ISSI_ADDR_DEFAULT 0x74
#define ISSI_REG_CONFIG 0x00
#define ISSI_REG_CONFIG_PICTUREMODE 0x00
#define ISSI_REG_CONFIG_AUTOPLAYMODE 0x08
#define ISSI_REG_CONFIG_AUDIOPLAYMODE 0x18
#define ISSI_CONF_PICTUREMODE 0x00
#define ISSI_CONF_AUTOFRAMEMODE 0x04
#define ISSI_CONF_AUDIOMODE 0x08
#define ISSI_REG_PICTUREFRAME 0x01
#define ISSI_REG_SHUTDOWN 0x0A
#define ISSI_REG_AUDIOSYNC 0x06
#define ISSI_COMMANDREGISTER 0xFD
#define ISSI_BANK_FUNCTIONREG 0x0B // helpfully called 'page nine'
// Transfer buffer for TWITransmitData()
uint8_t g_twi_transfer_buffer[20];
// These buffers match the IS31FL3731 PWM registers 0x24-0xB3.
// Storing them like this is optimal for I2C transfers to the registers.
// We could optimize this and take out the unused registers from these
// buffers and the transfers in IS31FL3731_write_pwm_buffer() but it's
// probably not worth the extra complexity.
uint8_t g_pwm_buffer[DRIVER_COUNT][144];
bool g_pwm_buffer_update_required = false;
uint8_t g_led_control_registers[DRIVER_COUNT][18] = { { 0 }, { 0 } };
bool g_led_control_registers_update_required = false;
// This is the bit pattern in the LED control registers
// (for matrix A, add one to register for matrix B)
//
// reg - b7 b6 b5 b4 b3 b2 b1 b0
// 0x00 - R08,R07,R06,R05,R04,R03,R02,R01
// 0x02 - G08,G07,G06,G05,G04,G03,G02,R00
// 0x04 - B08,B07,B06,B05,B04,B03,G01,G00
// 0x06 - - , - , - , - , - ,B02,B01,B00
// 0x08 - - , - , - , - , - , - , - , -
// 0x0A - B17,B16,B15, - , - , - , - , -
// 0x0C - G17,G16,B14,B13,B12,B11,B10,B09
// 0x0E - R17,G15,G14,G13,G12,G11,G10,G09
// 0x10 - R16,R15,R14,R13,R12,R11,R10,R09
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(twi2c_transmit(addr << 1, g_twi_transfer_buffer,2) != 0);
twi2c_transmit(addr << 1, g_twi_transfer_buffer,2);
}
void IS31FL3731_write_pwm_buffer( uint8_t addr, uint8_t *pwm_buffer )
{
// assumes bank is already selected
// transmit PWM registers in 9 transfers of 16 bytes
// 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 )
{
// 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++ )
{
g_twi_transfer_buffer[1 + j] = pwm_buffer[i + j];
}
//Transmit buffer until succesful
//while(twi2c_transmit(addr << 1, g_twi_transfer_buffer,17) != 0);
twi2c_transmit(addr << 1, g_twi_transfer_buffer,17);
}
}
void IS31FL3731_init( uint8_t addr )
{
// In order to avoid the LEDs being driven with garbage data
// in the LED driver's PWM registers, first enable software shutdown,
// then set up the mode and other settings, clear the PWM registers,
// then disable software shutdown.
// select "function register" bank
IS31FL3731_write_register( addr, ISSI_COMMANDREGISTER, ISSI_BANK_FUNCTIONREG );
// enable software shutdown
IS31FL3731_write_register( addr, ISSI_REG_SHUTDOWN, 0x00 );
// this delay was copied from other drivers, might not be needed
wait_ms( 10 );
// picture mode
IS31FL3731_write_register( addr, ISSI_REG_CONFIG, ISSI_REG_CONFIG_PICTUREMODE );
// display frame 0
IS31FL3731_write_register( addr, ISSI_REG_PICTUREFRAME, 0x00 );
// audio sync off
IS31FL3731_write_register( addr, ISSI_REG_AUDIOSYNC, 0x00 );
// select bank 0
IS31FL3731_write_register( addr, ISSI_COMMANDREGISTER, 0 );
// turn off all LEDs in the LED control register
for ( int i = 0x00; i <= 0x11; i++ )
{
IS31FL3731_write_register( addr, i, 0x00 );
}
// turn off all LEDs in the blink control register (not really needed)
for ( int i = 0x12; i <= 0x23; i++ )
{
IS31FL3731_write_register( addr, i, 0x00 );
}
// set PWM on all LEDs to 0
for ( int i = 0x24; i <= 0xB3; i++ )
{
IS31FL3731_write_register( addr, i, 0x00 );
}
// select "function register" bank
IS31FL3731_write_register( addr, ISSI_COMMANDREGISTER, ISSI_BANK_FUNCTIONREG );
// disable software shutdown
IS31FL3731_write_register( addr, ISSI_REG_SHUTDOWN, 0x01 );
// select bank 0 and leave it selected.
// 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 )
{
if ( index >= 0 && index < DRIVER_LED_TOTAL ) {
is31_led led = g_is31_leds[index];
// Subtract 0x24 to get the second index of g_pwm_buffer
g_pwm_buffer[led.driver][led.r - 0x24] = red;
g_pwm_buffer[led.driver][led.g - 0x24] = green;
g_pwm_buffer[led.driver][led.b - 0x24] = blue;
g_pwm_buffer_update_required = true;
}
}
void IS31FL3731_set_color_all( uint8_t red, uint8_t green, uint8_t blue )
{
for ( int i = 0; i < DRIVER_LED_TOTAL; i++ )
{
IS31FL3731_set_color( i, red, green, blue );
}
}
void IS31FL3731_set_led_control_register( uint8_t index, bool red, bool green, bool blue )
{
is31_led led = g_is31_leds[index];
uint8_t control_register_r = (led.r - 0x24) / 8;
uint8_t control_register_g = (led.g - 0x24) / 8;
uint8_t control_register_b = (led.b - 0x24) / 8;
uint8_t bit_r = (led.r - 0x24) % 8;
uint8_t bit_g = (led.g - 0x24) % 8;
uint8_t bit_b = (led.b - 0x24) % 8;
if ( red ) {
g_led_control_registers[led.driver][control_register_r] |= (1 << bit_r);
} else {
g_led_control_registers[led.driver][control_register_r] &= ~(1 << bit_r);
}
if ( green ) {
g_led_control_registers[led.driver][control_register_g] |= (1 << bit_g);
} else {
g_led_control_registers[led.driver][control_register_g] &= ~(1 << bit_g);
}
if ( blue ) {
g_led_control_registers[led.driver][control_register_b] |= (1 << bit_b);
} else {
g_led_control_registers[led.driver][control_register_b] &= ~(1 << bit_b);
}
g_led_control_registers_update_required = true;
}
void IS31FL3731_update_pwm_buffers( uint8_t addr1, uint8_t addr2 )
{
if ( g_pwm_buffer_update_required )
{
IS31FL3731_write_pwm_buffer( addr1, g_pwm_buffer[0] );
IS31FL3731_write_pwm_buffer( addr2, g_pwm_buffer[1] );
}
g_pwm_buffer_update_required = false;
}
void IS31FL3731_update_led_control_registers( uint8_t addr1, uint8_t addr2 )
{
if ( g_led_control_registers_update_required )
{
for ( int i=0; i<18; i++ )
{
IS31FL3731_write_register(addr1, i, g_led_control_registers[0][i] );
IS31FL3731_write_register(addr2, i, g_led_control_registers[1][i] );
}
}
}

View File

@ -23,7 +23,7 @@
#include <stdbool.h>
typedef struct is31_led {
uint8_t driver:2;
uint8_t driver:2;
uint8_t r;
uint8_t g;
uint8_t b;

View File

@ -0,0 +1,292 @@
/* Copyright 2018 Jack Humbert
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "qwiic_keyboard.h"
#include "keymap.h"
#include "matrix.h"
#include "keyboard.h"
#include "twi2c.h"
#include <string.h>
#include "usb_main.h"
#include "usb_driver.h"
#define QWIIC_KEYBOARD_LAYERS 16
#define QWIIC_KEYBOARD_ROWS 8
#define QWIIC_KEYBOARD_COLS 8
#if (QWIIC_KEYBOARD_COLS <= 8)
typedef uint8_t qwiic_row_t;
#elif (QWIIC_KEYBOARD_COLS <= 16)
typedef uint16_t qwiic_row_t;
#elif (QWIIC_KEYBOARD_COLS <= 32)
typedef uint32_t qwiic_row_t;
#else
#error "QWIIC_KEYBOARD_COLS: invalid value"
#endif
#define QWIIC_KEYBOARD_HANDSHAKE_ADDRESS 0b01010100
#define QWIIC_KEYBOARD_LISTENING_ADDRESS_START 0b01010110
#define QWIIC_KEYBOARD_MAX_DEVICES 1
#define QWIIC_KEYBOARD_KEYMAP_MESSAGE_SIZE (QWIIC_KEYBOARD_LAYERS * QWIIC_KEYBOARD_ROWS * QWIIC_KEYBOARD_COLS)
#define QWIIC_KEYBOARD_MATRIX_MESSAGE_SIZE (QWIIC_KEYBOARD_ROWS)
void qwiic_keyboard_write_keymap(uint8_t * pointer);
void qwiic_keyboard_read_keymap(uint8_t * pointer, uint8_t index);
bool qwiic_keyboard_master = false;
bool qwiic_keyboard_received_message = false;
bool qwiic_keyboard_connected[QWIIC_KEYBOARD_MAX_DEVICES] = { false };
uint8_t qwiic_keyboard_keymap_message[QWIIC_KEYBOARD_KEYMAP_MESSAGE_SIZE] = {0};
uint8_t qwiic_keyboard_matrix_message[QWIIC_KEYBOARD_MATRIX_MESSAGE_SIZE] = {0};
twi2c_message_received qwiic_keyboard_message_received_ptr = qwiic_keyboard_message_received;
float song_one_up[][2] = SONG(ONE_UP_SOUND);
float song_zelda[][2] = SONG(ZELDA_PUZZLE);
uint8_t first_message = 0;
uint8_t first_message_slave = 0;
uint16_t qwiic_keyboard_keymap[QWIIC_KEYBOARD_MAX_DEVICES][QWIIC_KEYBOARD_LAYERS][QWIIC_KEYBOARD_ROWS][QWIIC_KEYBOARD_COLS] = {0};
bool qwiic_keyboard_keymap_initialised[QWIIC_KEYBOARD_MAX_DEVICES] = { false };
uint8_t qwiic_keyboard_listening_address[QWIIC_KEYBOARD_MAX_DEVICES] = { 0 };
#define QWIIC_KEYBOARD_NOT_PROCESSING 255
uint8_t qwiic_keyboard_processing_slave = QWIIC_KEYBOARD_NOT_PROCESSING;
void qwiic_keyboard_init(void) {
twi2c_init();
twi2c_start();
twi2c_start_listening(QWIIC_KEYBOARD_HANDSHAKE_ADDRESS, qwiic_keyboard_message_received_ptr);
}
void qwiic_keyboard_set_master(void) {
if (!qwiic_keyboard_received_message) {
twi2c_stop();
twi2c_start();
qwiic_keyboard_master = true;
if (first_message == 0) {
PLAY_SONG(song_one_up);
}
first_message += 1;
}
}
void qwiic_keyboard_set_slave(void) {
qwiic_keyboard_received_message = true;
if (first_message_slave == 0) {
PLAY_SONG(song_zelda);
}
first_message_slave += 1;
}
static uint8_t keymap_command[1] = { 0x01 };
static uint8_t matrix_command[1] = { 0x02 };
static uint8_t look_counter = 0;
// uint8_t get_available_device_index(void) {
// for (uint8_t i = 0; i < QWIIC_KEYBOARD_MAX_DEVICES; i++) {
// if (!qwiic_keyboard_connected[i])
// return i;
// }
// return 255;
// }
void qwiic_keyboard_get_matrix(uint8_t device_i) {
// msg_t ret = twi2c_transmit_receive(qwiic_keyboard_listening_address[device_i],
// matrix_command, 1,
// qwiic_keyboard_matrix_message, QWIIC_KEYBOARD_MATRIX_MESSAGE_SIZE
// );
twi2c_transmit(qwiic_keyboard_listening_address[device_i], matrix_command, 1);
msg_t ret = twi2c_receive(qwiic_keyboard_listening_address[device_i],
qwiic_keyboard_matrix_message, QWIIC_KEYBOARD_MATRIX_MESSAGE_SIZE
);
switch (ret) {
// majority of this is pulled from keyboard.c:keyboard_task()
case I2C_OK:
qwiic_keyboard_processing_slave = device_i;
static qwiic_row_t matrix_prev[QWIIC_KEYBOARD_ROWS];
qwiic_row_t matrix_row = 0;
qwiic_row_t matrix_change = 0;
#ifdef QMK_KEYS_PER_SCAN
uint8_t keys_processed = 0;
#endif
for (uint8_t r = 0; r < QWIIC_KEYBOARD_ROWS; r++) {
matrix_row = qwiic_keyboard_matrix_message[r];
matrix_change = matrix_row ^ matrix_prev[r];
if (matrix_change) {
for (uint8_t c = 0; c < QWIIC_KEYBOARD_COLS; c++) {
if (matrix_change & ((qwiic_row_t)1<<c)) {
action_exec((keyevent_t){
.key = (keypos_t){ .row = r, .col = c },
.pressed = (matrix_row & ((qwiic_row_t)1<<c)),
.time = (timer_read() | 1) /* time should not be 0 */
});
// record a processed key
matrix_prev[r] ^= ((qwiic_row_t)1<<c);
#ifdef QMK_KEYS_PER_SCAN
// only jump out if we have processed "enough" keys.
if (++keys_processed >= QMK_KEYS_PER_SCAN)
#endif
// process a key per task call
goto QWIIC_MATRIX_LOOP_END;
}
}
}
}
// call with pseudo tick event when no real key event.
#ifdef QMK_KEYS_PER_SCAN
// we can get here with some keys processed now.
if (!keys_processed)
#endif
action_exec(TICK);
QWIIC_MATRIX_LOOP_END:
qwiic_keyboard_processing_slave = QWIIC_KEYBOARD_NOT_PROCESSING;
// if (first_message == 100) {
// PLAY_SONG(song_one_up);
// }
// first_message += 1;
break;
case I2C_ERROR:
break;
default:
twi2c_start();
break;
}
}
void qwiic_keyboard_task(void) {
if (USB_DRIVER.state == USB_ACTIVE)
qwiic_keyboard_set_master();
if (qwiic_keyboard_master) {
for (uint8_t device_i = 0; device_i < QWIIC_KEYBOARD_MAX_DEVICES; device_i++) {
if (qwiic_keyboard_connected[device_i]) {
// send empty message, expecting matrix info
if (!qwiic_keyboard_keymap_initialised[device_i]) {
// if (MSG_OK == twi2c_transmit_receive(qwiic_keyboard_listening_address[device_i],
// keymap_command, 1,
// qwiic_keyboard_keymap_message, QWIIC_KEYBOARD_KEYMAP_MESSAGE_SIZE
// )) {
twi2c_transmit(qwiic_keyboard_listening_address[device_i], keymap_command, 1);
if (MSG_OK == twi2c_receive(qwiic_keyboard_listening_address[device_i],
qwiic_keyboard_keymap_message, QWIIC_KEYBOARD_KEYMAP_MESSAGE_SIZE
)) {
// load keymap into memory
qwiic_keyboard_keymap_initialised[device_i] = true;
qwiic_keyboard_read_keymap(qwiic_keyboard_keymap_message, device_i);
qwiic_keyboard_get_matrix(device_i);
}
} else {
qwiic_keyboard_get_matrix(device_i);
} // end else - not init
} else { // if not connected
//if (look_counter == 0) {
// send new address to listen on, expect back keymap
uint8_t new_address = QWIIC_KEYBOARD_LISTENING_ADDRESS_START + (device_i*2);
uint8_t address_copy = 0;
twi2c_transmit(QWIIC_KEYBOARD_HANDSHAKE_ADDRESS, &new_address, 1);
if (MSG_OK == twi2c_receive(QWIIC_KEYBOARD_HANDSHAKE_ADDRESS,
&address_copy, 1
)) {
// if (MSG_OK == twi2c_transmit_receive(QWIIC_KEYBOARD_HANDSHAKE_ADDRESS,
// &new_address, 1,
// &address_copy, 1
// )) {
send_byte(address_copy);
//if (address_copy == new_address) {
PLAY_SONG(song_one_up);
qwiic_keyboard_connected[device_i] = true;
qwiic_keyboard_listening_address[device_i] = new_address;
//}
}
//} // end if - look for new
} // end else - connected
} // end for - devices
look_counter = ((look_counter + 1) % 150);
} // end if - master
}
void qwiic_keyboard_message_received(I2CDriver *i2cp, uint8_t * body, uint16_t size) {
qwiic_keyboard_set_slave();
switch (body[0]) {
// send keymap
case 0x01:
qwiic_keyboard_write_keymap(qwiic_keyboard_keymap_message);
twi2c_reply(i2cp, qwiic_keyboard_keymap_message, QWIIC_KEYBOARD_KEYMAP_MESSAGE_SIZE);
break;
// send matrix
case 0x02:
case 0x00:
for (uint8_t row = 0; row < QWIIC_KEYBOARD_ROWS; row++) {
if (row < MATRIX_ROWS) {
qwiic_keyboard_matrix_message[row] = matrix_get_row(row);
} else {
qwiic_keyboard_matrix_message[row] = 0;
}
}
twi2c_reply(i2cp, qwiic_keyboard_matrix_message, QWIIC_KEYBOARD_MATRIX_MESSAGE_SIZE);
break;
default:
qwiic_keyboard_listening_address[0] = body[0];
twi2c_add_listening(body[0]);
twi2c_remove_listening(QWIIC_KEYBOARD_HANDSHAKE_ADDRESS);
qwiic_keyboard_connected[0] = true;
qwiic_keyboard_master = false;
twi2c_reply(i2cp, qwiic_keyboard_listening_address, 1);
break;
}
}
// qwiic_keyboard_message_received_ptr = qwiic_keyboard_message_received;
__attribute__((optimize("O0")))
void qwiic_keyboard_write_keymap(uint8_t * pointer) {
for (uint8_t layer = 0; layer < QWIIC_KEYBOARD_LAYERS; layer++) {
for (uint8_t row = 0; row < QWIIC_KEYBOARD_ROWS; row++) {
for (uint8_t col = 0; col < QWIIC_KEYBOARD_COLS; col++) {
uint16_t keycode = 0;
keycode = pgm_read_word(&keymaps[layer][row][col]);
*pointer++ = (keycode >> 8);
*pointer++ = (keycode & 0xFF);
}
}
}
}
void qwiic_keyboard_read_keymap(uint8_t * pointer, uint8_t index) {
for (uint8_t layer = 0; layer < QWIIC_KEYBOARD_LAYERS; layer++) {
for (uint8_t row = 0; row < QWIIC_KEYBOARD_ROWS; row++) {
for (uint8_t col = 0; col < QWIIC_KEYBOARD_COLS; col++) {
uint16_t keycode = ((*pointer++) << 8);
keycode |= (*pointer++);
qwiic_keyboard_keymap[index][layer][row][col] = keycode;
}
}
}
}
// overwrite the built-in function - slaves don't need to process keycodes
bool is_keyboard_master(void) {
return qwiic_keyboard_master;
}
// overwrite the built-in function
uint16_t keymap_key_to_keycode(uint8_t layer, keypos_t key) {
if (qwiic_keyboard_processing_slave == QWIIC_KEYBOARD_NOT_PROCESSING) {
// Read entire word (16bits)
return pgm_read_word(&keymaps[(layer)][(key.row)][(key.col)]);
} else {
// trick the built-in handling to accept our replacement keymap
return qwiic_keyboard_keymap[qwiic_keyboard_processing_slave][(layer)][(key.row)][(key.col)];
}
}

Some files were not shown because too many files have changed in this diff Show More