summaryrefslogtreecommitdiff
path: root/keyboards
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards')
-rw-r--r--keyboards/atreus/Makefile1
-rw-r--r--keyboards/chibios_test/Makefile14
-rw-r--r--keyboards/chibios_test/boards/GENERIC_STM32_F103/board.c (renamed from keyboards/stm32_f103_onekey/boards/GENERIC_STM32_F103/board.c)0
-rw-r--r--keyboards/chibios_test/boards/GENERIC_STM32_F103/board.h (renamed from keyboards/stm32_f103_onekey/boards/GENERIC_STM32_F103/board.h)0
-rw-r--r--keyboards/chibios_test/boards/GENERIC_STM32_F103/board.mk (renamed from keyboards/stm32_f103_onekey/boards/GENERIC_STM32_F103/board.mk)0
-rw-r--r--keyboards/chibios_test/boards/GENERIC_STM32_F103/mini_stm32_mapping.png (renamed from keyboards/stm32_f103_onekey/boards/GENERIC_STM32_F103/mini_stm32_mapping.png)bin162908 -> 162908 bytes
-rw-r--r--keyboards/chibios_test/boards/maple_mini_mapping.png (renamed from keyboards/stm32_f103_onekey/boards/maple_mini_mapping.png)bin237977 -> 237977 bytes
-rw-r--r--keyboards/chibios_test/chibios_test.c1
-rw-r--r--keyboards/chibios_test/chibios_test.h6
-rw-r--r--keyboards/chibios_test/config.h (renamed from keyboards/teensy_lc_onekey/config.h)9
-rw-r--r--keyboards/chibios_test/keymaps/default/keymap.c (renamed from keyboards/stm32_f072_onekey/keymaps/default/keymap.c)2
-rw-r--r--keyboards/chibios_test/ld/MKL26Z64.ld (renamed from keyboards/teensy_lc_onekey/ld/MKL26Z64.ld)0
-rw-r--r--keyboards/chibios_test/ld/STM32F103x8_stm32duino_bootloader.ld (renamed from keyboards/stm32_f103_onekey/ld/STM32F103x8_stm32duino_bootloader.ld)0
-rw-r--r--keyboards/chibios_test/stm32_f072_onekey/Makefile (renamed from keyboards/stm32_f072_onekey/Makefile)11
-rw-r--r--keyboards/chibios_test/stm32_f072_onekey/bootloader_defs.h (renamed from keyboards/stm32_f072_onekey/bootloader_defs.h)0
-rw-r--r--keyboards/chibios_test/stm32_f072_onekey/chconf.h (renamed from keyboards/stm32_f072_onekey/chconf.h)0
-rw-r--r--keyboards/chibios_test/stm32_f072_onekey/config.h7
-rw-r--r--keyboards/chibios_test/stm32_f072_onekey/halconf.h (renamed from keyboards/stm32_f072_onekey/halconf.h)0
-rw-r--r--keyboards/chibios_test/stm32_f072_onekey/led.c (renamed from keyboards/stm32_f072_onekey/led.c)0
-rw-r--r--keyboards/chibios_test/stm32_f072_onekey/matrix.c (renamed from keyboards/stm32_f072_onekey/matrix.c)0
-rw-r--r--keyboards/chibios_test/stm32_f072_onekey/mcuconf.h (renamed from keyboards/stm32_f072_onekey/mcuconf.h)0
-rw-r--r--keyboards/chibios_test/stm32_f072_onekey/stm32_f072_onekey.c (renamed from keyboards/stm32_f072_onekey/stm32_f072_onekey.c)0
-rw-r--r--keyboards/chibios_test/stm32_f072_onekey/stm32_f072_onekey.h (renamed from keyboards/stm32_f072_onekey/stm32_f072_onekey.h)2
-rw-r--r--keyboards/chibios_test/stm32_f103_onekey/Makefile (renamed from keyboards/stm32_f103_onekey/Makefile)14
-rw-r--r--keyboards/chibios_test/stm32_f103_onekey/bootloader_defs.h (renamed from keyboards/stm32_f103_onekey/bootloader_defs.h)0
-rw-r--r--keyboards/chibios_test/stm32_f103_onekey/chconf.h (renamed from keyboards/stm32_f103_onekey/chconf.h)0
-rw-r--r--keyboards/chibios_test/stm32_f103_onekey/config.h6
-rwxr-xr-xkeyboards/chibios_test/stm32_f103_onekey/flash.sh (renamed from keyboards/stm32_f103_onekey/flash.sh)0
-rw-r--r--keyboards/chibios_test/stm32_f103_onekey/halconf.h (renamed from keyboards/stm32_f103_onekey/halconf.h)0
-rw-r--r--keyboards/chibios_test/stm32_f103_onekey/led.c (renamed from keyboards/stm32_f103_onekey/led.c)0
-rw-r--r--keyboards/chibios_test/stm32_f103_onekey/matrix.c (renamed from keyboards/stm32_f103_onekey/matrix.c)0
-rw-r--r--keyboards/chibios_test/stm32_f103_onekey/mcuconf.h (renamed from keyboards/stm32_f103_onekey/mcuconf.h)0
-rw-r--r--keyboards/chibios_test/stm32_f103_onekey/stm32_f103_onekey.c (renamed from keyboards/stm32_f103_onekey/stm32_f103_onekey.c)0
-rw-r--r--keyboards/chibios_test/stm32_f103_onekey/stm32_f103_onekey.h (renamed from keyboards/stm32_f103_onekey/stm32_f103_onekey.h)2
-rw-r--r--keyboards/chibios_test/teensy_lc_onekey/Makefile49
-rw-r--r--keyboards/chibios_test/teensy_lc_onekey/Makefile.3.0 (renamed from keyboards/teensy_lc_onekey/Makefile.3.0)0
-rw-r--r--keyboards/chibios_test/teensy_lc_onekey/Makefile.3.2 (renamed from keyboards/teensy_lc_onekey/Makefile.3.2)0
-rw-r--r--keyboards/chibios_test/teensy_lc_onekey/chconf.h (renamed from keyboards/teensy_lc_onekey/chconf.h)0
-rw-r--r--keyboards/chibios_test/teensy_lc_onekey/config.h6
-rw-r--r--keyboards/chibios_test/teensy_lc_onekey/halconf.h (renamed from keyboards/teensy_lc_onekey/halconf.h)0
-rw-r--r--keyboards/chibios_test/teensy_lc_onekey/instructions.md (renamed from keyboards/teensy_lc_onekey/instructions.md)0
-rw-r--r--keyboards/chibios_test/teensy_lc_onekey/led.c (renamed from keyboards/teensy_lc_onekey/led.c)0
-rw-r--r--keyboards/chibios_test/teensy_lc_onekey/matrix.c (renamed from keyboards/teensy_lc_onekey/matrix.c)0
-rw-r--r--keyboards/chibios_test/teensy_lc_onekey/mcuconf.h (renamed from keyboards/teensy_lc_onekey/mcuconf.h)0
-rw-r--r--keyboards/chibios_test/teensy_lc_onekey/teensy_lc_onekey.c (renamed from keyboards/teensy_lc_onekey/teensy_lc_onekey.c)0
-rw-r--r--keyboards/chibios_test/teensy_lc_onekey/teensy_lc_onekey.h (renamed from keyboards/teensy_lc_onekey/teensy_lc_onekey.h)2
-rw-r--r--keyboards/ergodox_ez/matrix.c12
-rw-r--r--keyboards/infinity_ergodox/MEMO.txt385
-rw-r--r--keyboards/infinity_ergodox/Makefile (renamed from keyboards/teensy_lc_onekey/Makefile)33
-rw-r--r--keyboards/infinity_ergodox/bootloader_defs.h1
-rw-r--r--keyboards/infinity_ergodox/chconf.h524
-rw-r--r--keyboards/infinity_ergodox/config.h (renamed from keyboards/stm32_f103_onekey/config.h)23
-rw-r--r--keyboards/infinity_ergodox/halconf.h353
-rw-r--r--keyboards/infinity_ergodox/infinity_ergodox.c11
-rw-r--r--keyboards/infinity_ergodox/infinity_ergodox.h44
-rw-r--r--keyboards/infinity_ergodox/keymaps/default/keymap.c111
-rw-r--r--keyboards/infinity_ergodox/led.c49
-rw-r--r--keyboards/infinity_ergodox/matrix.c169
-rw-r--r--keyboards/infinity_ergodox/mcuconf.h74
-rw-r--r--keyboards/lets_split/Makefile78
-rw-r--r--keyboards/lets_split/config.h (renamed from keyboards/stm32_f072_onekey/config.h)54
-rw-r--r--keyboards/lets_split/eeprom-lefthand.eep2
-rw-r--r--keyboards/lets_split/eeprom-righthand.eep2
-rw-r--r--keyboards/lets_split/i2c.c159
-rw-r--r--keyboards/lets_split/i2c.h31
-rw-r--r--keyboards/lets_split/imgs/split-keyboard-i2c-schematic.pngbin0 -> 26565 bytes
-rw-r--r--keyboards/lets_split/imgs/split-keyboard-serial-schematic.pngbin0 -> 19487 bytes
-rw-r--r--keyboards/lets_split/keymaps/default/keymap.c214
-rw-r--r--keyboards/lets_split/lets_split.c30
-rw-r--r--keyboards/lets_split/lets_split.h25
-rw-r--r--keyboards/lets_split/matrix.c311
-rw-r--r--keyboards/lets_split/pro_micro.h362
-rw-r--r--keyboards/lets_split/readme.md102
-rw-r--r--keyboards/lets_split/serial.c225
-rw-r--r--keyboards/lets_split/serial.h26
-rw-r--r--keyboards/lets_split/split_util.c76
-rw-r--r--keyboards/lets_split/split_util.h22
-rw-r--r--keyboards/stm32_f103_onekey/keymaps/default/keymap.c25
-rw-r--r--keyboards/teensy_lc_onekey/keymaps/default/keymap.c32
79 files changed, 3572 insertions, 125 deletions
diff --git a/keyboards/atreus/Makefile b/keyboards/atreus/Makefile
index 72b694faac..95ee1d4d7b 100644
--- a/keyboards/atreus/Makefile
+++ b/keyboards/atreus/Makefile
@@ -5,6 +5,7 @@ ifdef TEENSY2
ATRUES_UPLOAD_COMMAND = teensy_loader_cli -w -mmcu=$(MCU) $(TARGET).hex
else
OPT_DEFS += -DATREUS_ASTAR
+ OPT_DEFS += -DCATERINA_BOOTLOADER
ATRUES_UPLOAD_COMMAND = while [ ! -r $(USB) ]; do sleep 1; done; \
avrdude -p $(MCU) -c avr109 -U flash:w:$(TARGET).hex -P $(USB)
endif
diff --git a/keyboards/chibios_test/Makefile b/keyboards/chibios_test/Makefile
new file mode 100644
index 0000000000..d9f2b8b83b
--- /dev/null
+++ b/keyboards/chibios_test/Makefile
@@ -0,0 +1,14 @@
+SUBPROJECT_DEFAULT = stm32_f072_onekey
+
+#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration
+MOUSEKEY_ENABLE ?= yes # Mouse keys
+EXTRAKEY_ENABLE ?= yes # Audio control and System control
+CONSOLE_ENABLE ?= yes # Console for debug
+COMMAND_ENABLE ?= yes # Commands for debug and configuration
+SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend
+NKRO_ENABLE ?= yes # USB Nkey Rollover
+CUSTOM_MATRIX ?= yes # Custom matrix file
+
+ifndef QUANTUM_DIR
+ include ../../Makefile
+endif \ No newline at end of file
diff --git a/keyboards/stm32_f103_onekey/boards/GENERIC_STM32_F103/board.c b/keyboards/chibios_test/boards/GENERIC_STM32_F103/board.c
index 31319ef575..31319ef575 100644
--- a/keyboards/stm32_f103_onekey/boards/GENERIC_STM32_F103/board.c
+++ b/keyboards/chibios_test/boards/GENERIC_STM32_F103/board.c
diff --git a/keyboards/stm32_f103_onekey/boards/GENERIC_STM32_F103/board.h b/keyboards/chibios_test/boards/GENERIC_STM32_F103/board.h
index 7253e77826..7253e77826 100644
--- a/keyboards/stm32_f103_onekey/boards/GENERIC_STM32_F103/board.h
+++ b/keyboards/chibios_test/boards/GENERIC_STM32_F103/board.h
diff --git a/keyboards/stm32_f103_onekey/boards/GENERIC_STM32_F103/board.mk b/keyboards/chibios_test/boards/GENERIC_STM32_F103/board.mk
index d692c0ee46..d692c0ee46 100644
--- a/keyboards/stm32_f103_onekey/boards/GENERIC_STM32_F103/board.mk
+++ b/keyboards/chibios_test/boards/GENERIC_STM32_F103/board.mk
diff --git a/keyboards/stm32_f103_onekey/boards/GENERIC_STM32_F103/mini_stm32_mapping.png b/keyboards/chibios_test/boards/GENERIC_STM32_F103/mini_stm32_mapping.png
index c44a7d9ebc..c44a7d9ebc 100644
--- a/keyboards/stm32_f103_onekey/boards/GENERIC_STM32_F103/mini_stm32_mapping.png
+++ b/keyboards/chibios_test/boards/GENERIC_STM32_F103/mini_stm32_mapping.png
Binary files differ
diff --git a/keyboards/stm32_f103_onekey/boards/maple_mini_mapping.png b/keyboards/chibios_test/boards/maple_mini_mapping.png
index 12cfa81db2..12cfa81db2 100644
--- a/keyboards/stm32_f103_onekey/boards/maple_mini_mapping.png
+++ b/keyboards/chibios_test/boards/maple_mini_mapping.png
Binary files differ
diff --git a/keyboards/chibios_test/chibios_test.c b/keyboards/chibios_test/chibios_test.c
new file mode 100644
index 0000000000..efe2d4a5d6
--- /dev/null
+++ b/keyboards/chibios_test/chibios_test.c
@@ -0,0 +1 @@
+#include "chibios_test.h"
diff --git a/keyboards/chibios_test/chibios_test.h b/keyboards/chibios_test/chibios_test.h
new file mode 100644
index 0000000000..25b0317710
--- /dev/null
+++ b/keyboards/chibios_test/chibios_test.h
@@ -0,0 +1,6 @@
+#ifndef KEYBOARDS_CHIBIOS_TEST_CHIBIOS_TEST_H_
+#define KEYBOARDS_CHIBIOS_TEST_CHIBIOS_TEST_H_
+
+#include "quantum.h"
+
+#endif /* KEYBOARDS_CHIBIOS_TEST_CHIBIOS_TEST_H_ */
diff --git a/keyboards/teensy_lc_onekey/config.h b/keyboards/chibios_test/config.h
index 19b14fe61a..c32a77b37f 100644
--- a/keyboards/teensy_lc_onekey/config.h
+++ b/keyboards/chibios_test/config.h
@@ -18,18 +18,17 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef CONFIG_H
#define CONFIG_H
-
/* USB Device descriptor parameter */
#define VENDOR_ID 0xFEED
#define PRODUCT_ID 0x6464
#define DEVICE_VER 0x0001
/* in python2: list(u"whatever".encode('utf-16-le')) */
/* at most 32 characters or the ugly hack in usb_main.c borks */
-#define MANUFACTURER "TMK"
+#define MANUFACTURER "QMK"
#define USBSTR_MANUFACTURER 'T', '\x00', 'M', '\x00', 'K', '\x00', ' ', '\x00', '\xc6', '\x00'
-#define PRODUCT "ChibiOS TMK test"
-#define USBSTR_PRODUCT 'C', '\x00', 'h', '\x00', 'i', '\x00', 'b', '\x00', 'i', '\x00', 'O', '\x00', 'S', '\x00', ' ', '\x00', 'T', '\x00', 'M', '\x00', 'K', '\x00', ' ', '\x00', 't', '\x00', 'e', '\x00', 's', '\x00', 't', '\x00'
-#define DESCRIPTION "TMK keyboard firmware over ChibiOS"
+#define PRODUCT "ChibiOS QMK test"
+#define USBSTR_PRODUCT 'C', '\x00', 'h', '\x00', 'i', '\x00', 'b', '\x00', 'i', '\x00', 'O', '\x00', 'S', '\x00', ' ', '\x00', 'Q', '\x00', 'M', '\x00', 'K', '\x00', ' ', '\x00', 't', '\x00', 'e', '\x00', 's', '\x00', 't', '\x00'
+#define DESCRIPTION "QMK keyboard firmware test for ChibiOS"
/* key matrix size */
#define MATRIX_ROWS 1
diff --git a/keyboards/stm32_f072_onekey/keymaps/default/keymap.c b/keyboards/chibios_test/keymaps/default/keymap.c
index 6c48149f83..239d70007a 100644
--- a/keyboards/stm32_f072_onekey/keymaps/default/keymap.c
+++ b/keyboards/chibios_test/keymaps/default/keymap.c
@@ -15,7 +15,7 @@ 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 "stm32_f072_onekey.h"
+#include "chibios_test.h"
const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
{{KC_CAPS}}, // test with KC_CAPS, KC_A, KC_BTLD
diff --git a/keyboards/teensy_lc_onekey/ld/MKL26Z64.ld b/keyboards/chibios_test/ld/MKL26Z64.ld
index fb141f888c..fb141f888c 100644
--- a/keyboards/teensy_lc_onekey/ld/MKL26Z64.ld
+++ b/keyboards/chibios_test/ld/MKL26Z64.ld
diff --git a/keyboards/stm32_f103_onekey/ld/STM32F103x8_stm32duino_bootloader.ld b/keyboards/chibios_test/ld/STM32F103x8_stm32duino_bootloader.ld
index 00613328ed..00613328ed 100644
--- a/keyboards/stm32_f103_onekey/ld/STM32F103x8_stm32duino_bootloader.ld
+++ b/keyboards/chibios_test/ld/STM32F103x8_stm32duino_bootloader.ld
diff --git a/keyboards/stm32_f072_onekey/Makefile b/keyboards/chibios_test/stm32_f072_onekey/Makefile
index 24abcb0e09..eae38c4b2b 100644
--- a/keyboards/stm32_f072_onekey/Makefile
+++ b/keyboards/chibios_test/stm32_f072_onekey/Makefile
@@ -36,15 +36,6 @@ ARMV = 6
# Build Options
# comment out to disable the options.
#
-#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration
-MOUSEKEY_ENABLE ?= yes # Mouse keys
-EXTRAKEY_ENABLE ?= yes # Audio control and System control
-CONSOLE_ENABLE ?= yes # Console for debug
-COMMAND_ENABLE ?= yes # Commands for debug and configuration
-SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend
-NKRO_ENABLE ?= yes # USB Nkey Rollover
-CUSTOM_MATRIX ?= yes # Custom matrix file
-
ifndef QUANTUM_DIR
- include ../../Makefile
+ include ../../../Makefile
endif
diff --git a/keyboards/stm32_f072_onekey/bootloader_defs.h b/keyboards/chibios_test/stm32_f072_onekey/bootloader_defs.h
index 02c48c4e6d..02c48c4e6d 100644
--- a/keyboards/stm32_f072_onekey/bootloader_defs.h
+++ b/keyboards/chibios_test/stm32_f072_onekey/bootloader_defs.h
diff --git a/keyboards/stm32_f072_onekey/chconf.h b/keyboards/chibios_test/stm32_f072_onekey/chconf.h
index 99fa8ce398..99fa8ce398 100644
--- a/keyboards/stm32_f072_onekey/chconf.h
+++ b/keyboards/chibios_test/stm32_f072_onekey/chconf.h
diff --git a/keyboards/chibios_test/stm32_f072_onekey/config.h b/keyboards/chibios_test/stm32_f072_onekey/config.h
new file mode 100644
index 0000000000..bbaf0dc4bf
--- /dev/null
+++ b/keyboards/chibios_test/stm32_f072_onekey/config.h
@@ -0,0 +1,7 @@
+#ifndef KEYBOARDS_CHIBIOS_TEST_STM32_F072_ONEKEY_CONFIG_H_
+#define KEYBOARDS_CHIBIOS_TEST_STM32_F072_ONEKEY_CONFIG_H_
+
+#include "../config.h"
+
+
+#endif /* KEYBOARDS_CHIBIOS_TEST_STM32_F072_ONEKEY_CONFIG_H_ */
diff --git a/keyboards/stm32_f072_onekey/halconf.h b/keyboards/chibios_test/stm32_f072_onekey/halconf.h
index 1a450d6327..1a450d6327 100644
--- a/keyboards/stm32_f072_onekey/halconf.h
+++ b/keyboards/chibios_test/stm32_f072_onekey/halconf.h
diff --git a/keyboards/stm32_f072_onekey/led.c b/keyboards/chibios_test/stm32_f072_onekey/led.c
index 18edb8ba89..18edb8ba89 100644
--- a/keyboards/stm32_f072_onekey/led.c
+++ b/keyboards/chibios_test/stm32_f072_onekey/led.c
diff --git a/keyboards/stm32_f072_onekey/matrix.c b/keyboards/chibios_test/stm32_f072_onekey/matrix.c
index a05b38cd4c..a05b38cd4c 100644
--- a/keyboards/stm32_f072_onekey/matrix.c
+++ b/keyboards/chibios_test/stm32_f072_onekey/matrix.c
diff --git a/keyboards/stm32_f072_onekey/mcuconf.h b/keyboards/chibios_test/stm32_f072_onekey/mcuconf.h
index 3d877aaa2b..3d877aaa2b 100644
--- a/keyboards/stm32_f072_onekey/mcuconf.h
+++ b/keyboards/chibios_test/stm32_f072_onekey/mcuconf.h
diff --git a/keyboards/stm32_f072_onekey/stm32_f072_onekey.c b/keyboards/chibios_test/stm32_f072_onekey/stm32_f072_onekey.c
index 820d062ffd..820d062ffd 100644
--- a/keyboards/stm32_f072_onekey/stm32_f072_onekey.c
+++ b/keyboards/chibios_test/stm32_f072_onekey/stm32_f072_onekey.c
diff --git a/keyboards/stm32_f072_onekey/stm32_f072_onekey.h b/keyboards/chibios_test/stm32_f072_onekey/stm32_f072_onekey.h
index 1f798c8255..0455ad342f 100644
--- a/keyboards/stm32_f072_onekey/stm32_f072_onekey.h
+++ b/keyboards/chibios_test/stm32_f072_onekey/stm32_f072_onekey.h
@@ -1,5 +1,5 @@
#ifndef STM32_F072_ONEKEY_H
#define STM32_F072_ONEKEY_H
-#include "quantum.h"
+#include "chibios_test.h"
#endif
diff --git a/keyboards/stm32_f103_onekey/Makefile b/keyboards/chibios_test/stm32_f103_onekey/Makefile
index 5c1793c867..307ca5b198 100644
--- a/keyboards/stm32_f103_onekey/Makefile
+++ b/keyboards/chibios_test/stm32_f103_onekey/Makefile
@@ -46,19 +46,7 @@ ARMV = 7
# <tmk_dir>/tmk_core/tool/chibios/ch-bootloader-jump.patch
#STM32_BOOTLOADER_ADDRESS = 0x1FFFC800
-# Build Options
-# comment out to disable the options.
-#
-#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration
-## BOOTMAGIC is not supported on STM32 chips yet.
-MOUSEKEY_ENABLE ?= yes # Mouse keys
-EXTRAKEY_ENABLE ?= yes # Audio control and System control
-# CONSOLE_ENABLE ?= yes # Console for debug
-COMMAND_ENABLE ?= yes # Commands for debug and configuration
-SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
-NKRO_ENABLE ?= yes # USB Nkey Rollover
-CUSTOM_MATRIX ?= yes # Custom matrix file
ifndef QUANTUM_DIR
- include ../../Makefile
+ include ../../../Makefile
endif
diff --git a/keyboards/stm32_f103_onekey/bootloader_defs.h b/keyboards/chibios_test/stm32_f103_onekey/bootloader_defs.h
index 0f45203cb6..0f45203cb6 100644
--- a/keyboards/stm32_f103_onekey/bootloader_defs.h
+++ b/keyboards/chibios_test/stm32_f103_onekey/bootloader_defs.h
diff --git a/keyboards/stm32_f103_onekey/chconf.h b/keyboards/chibios_test/stm32_f103_onekey/chconf.h
index dfb1f9dfb9..dfb1f9dfb9 100644
--- a/keyboards/stm32_f103_onekey/chconf.h
+++ b/keyboards/chibios_test/stm32_f103_onekey/chconf.h
diff --git a/keyboards/chibios_test/stm32_f103_onekey/config.h b/keyboards/chibios_test/stm32_f103_onekey/config.h
new file mode 100644
index 0000000000..de0b906f35
--- /dev/null
+++ b/keyboards/chibios_test/stm32_f103_onekey/config.h
@@ -0,0 +1,6 @@
+#ifndef KEYBOARDS_CHIBIOS_TEST_STM32_F103_ONEKEY_CONFIG_H_
+#define KEYBOARDS_CHIBIOS_TEST_STM32_F103_ONEKEY_CONFIG_H_
+
+#include "../config.h"
+
+#endif /* KEYBOARDS_CHIBIOS_TEST_STM32_F103_ONEKEY_CONFIG_H_ */
diff --git a/keyboards/stm32_f103_onekey/flash.sh b/keyboards/chibios_test/stm32_f103_onekey/flash.sh
index 15501dfa57..15501dfa57 100755
--- a/keyboards/stm32_f103_onekey/flash.sh
+++ b/keyboards/chibios_test/stm32_f103_onekey/flash.sh
diff --git a/keyboards/stm32_f103_onekey/halconf.h b/keyboards/chibios_test/stm32_f103_onekey/halconf.h
index 1a450d6327..1a450d6327 100644
--- a/keyboards/stm32_f103_onekey/halconf.h
+++ b/keyboards/chibios_test/stm32_f103_onekey/halconf.h
diff --git a/keyboards/stm32_f103_onekey/led.c b/keyboards/chibios_test/stm32_f103_onekey/led.c
index f5c55f7d9b..f5c55f7d9b 100644
--- a/keyboards/stm32_f103_onekey/led.c
+++ b/keyboards/chibios_test/stm32_f103_onekey/led.c
diff --git a/keyboards/stm32_f103_onekey/matrix.c b/keyboards/chibios_test/stm32_f103_onekey/matrix.c
index ea9d8d057b..ea9d8d057b 100644
--- a/keyboards/stm32_f103_onekey/matrix.c
+++ b/keyboards/chibios_test/stm32_f103_onekey/matrix.c
diff --git a/keyboards/stm32_f103_onekey/mcuconf.h b/keyboards/chibios_test/stm32_f103_onekey/mcuconf.h
index 626332a6aa..626332a6aa 100644
--- a/keyboards/stm32_f103_onekey/mcuconf.h
+++ b/keyboards/chibios_test/stm32_f103_onekey/mcuconf.h
diff --git a/keyboards/stm32_f103_onekey/stm32_f103_onekey.c b/keyboards/chibios_test/stm32_f103_onekey/stm32_f103_onekey.c
index 7fa99bb28d..7fa99bb28d 100644
--- a/keyboards/stm32_f103_onekey/stm32_f103_onekey.c
+++ b/keyboards/chibios_test/stm32_f103_onekey/stm32_f103_onekey.c
diff --git a/keyboards/stm32_f103_onekey/stm32_f103_onekey.h b/keyboards/chibios_test/stm32_f103_onekey/stm32_f103_onekey.h
index e4d0dd9c4f..89a62b2bbe 100644
--- a/keyboards/stm32_f103_onekey/stm32_f103_onekey.h
+++ b/keyboards/chibios_test/stm32_f103_onekey/stm32_f103_onekey.h
@@ -1,4 +1,4 @@
#ifndef STM32_F103_ONEKEY_H
#define STM32_F103_ONEKEY_H
-#include "quantum.h"
+#include "chibios_test.h"
#endif
diff --git a/keyboards/chibios_test/teensy_lc_onekey/Makefile b/keyboards/chibios_test/teensy_lc_onekey/Makefile
new file mode 100644
index 0000000000..43ea9d82d9
--- /dev/null
+++ b/keyboards/chibios_test/teensy_lc_onekey/Makefile
@@ -0,0 +1,49 @@
+# project specific files
+SRC = matrix.c \
+ led.c
+
+## chip/board settings
+# - the next two should match the directories in
+# <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
+# - For Teensies, FAMILY = KINETIS and SERIES is either
+# KL2x (LC) or K20x (3.0,3.1,3.2).
+MCU_FAMILY = KINETIS
+MCU_SERIES = KL2x
+
+# Linker script to use
+# - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
+# or <this_dir>/ld/
+# - NOTE: a custom ld script is needed for EEPROM on Teensy LC
+# - LDSCRIPT =
+# - MKL26Z64 for Teensy LC
+# - MK20DX128 for Teensy 3.0
+# - MK20DX256 for Teensy 3.1 and 3.2
+MCU_LDSCRIPT = MKL26Z64
+
+# Startup code to use
+# - it should exist in <chibios>/os/common/ports/ARMCMx/compilers/GCC/mk/
+# - STARTUP =
+# - kl2x for Teensy LC
+# - k20x5 for Teensy 3.0
+# - k20x7 for Teensy 3.1 and 3.2
+MCU_STARTUP = kl2x
+
+# Board: it should exist either in <chibios>/os/hal/boards/
+# or <this_dir>/boards
+# - BOARD =
+# - PJRC_TEENSY_LC for Teensy LC
+# - PJRC_TEENSY_3 for Teensy 3.0
+# - PJRC_TEENSY_3_1 for Teensy 3.1 or 3.2
+BOARD = PJRC_TEENSY_LC
+
+# Cortex version
+# Teensy LC is cortex-m0plus; Teensy 3.x are cortex-m4
+MCU = cortex-m0plus
+
+# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
+# I.e. 6 for Teensy LC; 7 for Teensy 3.x
+ARMV = 6
+
+ifndef QUANTUM_DIR
+ include ../../../Makefile
+endif \ No newline at end of file
diff --git a/keyboards/teensy_lc_onekey/Makefile.3.0 b/keyboards/chibios_test/teensy_lc_onekey/Makefile.3.0
index dbf12c3631..dbf12c3631 100644
--- a/keyboards/teensy_lc_onekey/Makefile.3.0
+++ b/keyboards/chibios_test/teensy_lc_onekey/Makefile.3.0
diff --git a/keyboards/teensy_lc_onekey/Makefile.3.2 b/keyboards/chibios_test/teensy_lc_onekey/Makefile.3.2
index 41bfa41a0c..41bfa41a0c 100644
--- a/keyboards/teensy_lc_onekey/Makefile.3.2
+++ b/keyboards/chibios_test/teensy_lc_onekey/Makefile.3.2
diff --git a/keyboards/teensy_lc_onekey/chconf.h b/keyboards/chibios_test/teensy_lc_onekey/chconf.h
index cb36996c33..cb36996c33 100644
--- a/keyboards/teensy_lc_onekey/chconf.h
+++ b/keyboards/chibios_test/teensy_lc_onekey/chconf.h
diff --git a/keyboards/chibios_test/teensy_lc_onekey/config.h b/keyboards/chibios_test/teensy_lc_onekey/config.h
new file mode 100644
index 0000000000..d9eb05d2ac
--- /dev/null
+++ b/keyboards/chibios_test/teensy_lc_onekey/config.h
@@ -0,0 +1,6 @@
+#ifndef KEYBOARDS_CHIBIOS_TEST_TEENSY_LC_ONEKEY_CONFIG_H_
+#define KEYBOARDS_CHIBIOS_TEST_TEENSY_LC_ONEKEY_CONFIG_H_
+
+#include "../config.h"
+
+#endif /* KEYBOARDS_CHIBIOS_TEST_TEENSY_LC_ONEKEY_CONFIG_H_ */
diff --git a/keyboards/teensy_lc_onekey/halconf.h b/keyboards/chibios_test/teensy_lc_onekey/halconf.h
index b1d2cd5502..b1d2cd5502 100644
--- a/keyboards/teensy_lc_onekey/halconf.h
+++ b/keyboards/chibios_test/teensy_lc_onekey/halconf.h
diff --git a/keyboards/teensy_lc_onekey/instructions.md b/keyboards/chibios_test/teensy_lc_onekey/instructions.md
index 16886a015c..16886a015c 100644
--- a/keyboards/teensy_lc_onekey/instructions.md
+++ b/keyboards/chibios_test/teensy_lc_onekey/instructions.md
diff --git a/keyboards/teensy_lc_onekey/led.c b/keyboards/chibios_test/teensy_lc_onekey/led.c
index dfa60c1076..dfa60c1076 100644
--- a/keyboards/teensy_lc_onekey/led.c
+++ b/keyboards/chibios_test/teensy_lc_onekey/led.c
diff --git a/keyboards/teensy_lc_onekey/matrix.c b/keyboards/chibios_test/teensy_lc_onekey/matrix.c
index 7dab04f02b..7dab04f02b 100644
--- a/keyboards/teensy_lc_onekey/matrix.c
+++ b/keyboards/chibios_test/teensy_lc_onekey/matrix.c
diff --git a/keyboards/teensy_lc_onekey/mcuconf.h b/keyboards/chibios_test/teensy_lc_onekey/mcuconf.h
index c636590197..c636590197 100644
--- a/keyboards/teensy_lc_onekey/mcuconf.h
+++ b/keyboards/chibios_test/teensy_lc_onekey/mcuconf.h
diff --git a/keyboards/teensy_lc_onekey/teensy_lc_onekey.c b/keyboards/chibios_test/teensy_lc_onekey/teensy_lc_onekey.c
index b6c4327932..b6c4327932 100644
--- a/keyboards/teensy_lc_onekey/teensy_lc_onekey.c
+++ b/keyboards/chibios_test/teensy_lc_onekey/teensy_lc_onekey.c
diff --git a/keyboards/teensy_lc_onekey/teensy_lc_onekey.h b/keyboards/chibios_test/teensy_lc_onekey/teensy_lc_onekey.h
index f598bcf66d..ea1c84e2f5 100644
--- a/keyboards/teensy_lc_onekey/teensy_lc_onekey.h
+++ b/keyboards/chibios_test/teensy_lc_onekey/teensy_lc_onekey.h
@@ -1,4 +1,4 @@
#ifndef TEENSY_LC_ONEKEY_H
#define TEENSY_LC_ONEKEY_H
-#include "quantum.h"
+#include "chibios_test.h"
#endif
diff --git a/keyboards/ergodox_ez/matrix.c b/keyboards/ergodox_ez/matrix.c
index 9c1efa1d05..dc29cf5cd0 100644
--- a/keyboards/ergodox_ez/matrix.c
+++ b/keyboards/ergodox_ez/matrix.c
@@ -39,6 +39,17 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "timer.h"
#endif
+/*
+ * This constant define not debouncing time in msecs, but amount of matrix
+ * scan loops which should be made to get stable debounced results.
+ *
+ * On Ergodox matrix scan rate is relatively low, because of slow I2C.
+ * Now it's only 317 scans/second, or about 3.15 msec/scan.
+ * According to Cherry specs, debouncing time is 5 msec.
+ *
+ * And so, there is no sense to have DEBOUNCE higher than 2.
+ */
+
#ifndef DEBOUNCE
# define DEBOUNCE 5
#endif
@@ -181,6 +192,7 @@ uint8_t matrix_scan(void)
if (debouncing) {
if (--debouncing) {
wait_us(1);
+ // this should be wait_ms(1) but has been left as-is at EZ's request
} else {
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
matrix[i] = matrix_debouncing[i];
diff --git a/keyboards/infinity_ergodox/MEMO.txt b/keyboards/infinity_ergodox/MEMO.txt
new file mode 100644
index 0000000000..e2886aa002
--- /dev/null
+++ b/keyboards/infinity_ergodox/MEMO.txt
@@ -0,0 +1,385 @@
+flabbergast's TMK/ChibiOS port
+==============================
+2015/10/16
+
+
+Build
+-----
+$ git clone -b chibios https://github.com/flabbergast/tmk_keyboard.git
+
+$ cd tmk_keyboard
+$ git submodule add -f -b kinetis https://github.com/flabbergast/ChibiOS.git tmk_core/tool/chibios/chibios
+or
+$ cd tmk_keyboard/tmk_core/tool/chibios
+$ git clone -b kinetis https://github.com/flabbergast/ChibiOS.git tmk_core/tool/chibios/chibios
+
+$ cd tmk_keyboard/keyboard/infinity_chibios
+$ make
+
+
+
+
+Chibios Configuration
+---------------------
+halconf.h: for HAL configuration
+ placed in project directory
+ read in chibios/os/hal/hal.mk
+ included in chibios/os/hal/include/hal.h
+mcuconf.h: for MCU configuration
+ placed in project directory
+ included in halconf.h
+
+
+Chibios Term
+------------
+PAL = Port Abstraction Layer
+ palWritePad
+ palReadPad
+ palSetPad
+ chibios/os/hal/include/pal.h
+
+LLD = Low Level Driver
+
+
+Makefile
+--------
+ # <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
+ MCU_FAMILY = KINETIS
+ MCU_SERIES = KL2x
+
+ # - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
+ # or <this_dir>/ld/
+ MCU_LDSCRIPT = MKL26Z64
+
+ # - it should exist in <chibios>/os/common/ports/ARMCMx/compilers/GCC/mk/
+ MCU_STARTUP = kl2x
+
+ # Board: it should exist either in <chibios>/os/hal/boards/
+ # or <this_dir>/boards
+ BOARD = PJRC_TEENSY_LC
+
+ MCU = cortex-m0
+
+ # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
+ ARMV = 6
+
+
+halconf.h
+---------
+
+
+mcuconf.h
+---------
+
+
+chconf.h
+--------
+
+
+ld script
+---------
+--- ../../tmk_core/tool/chibios/chibios/os/common/ports/ARMCMx/compilers/GCC/ld/MKL26Z64.ld 2015-10-15 09:08:58.732904304 +0900
++++ ld/MKL26Z64.ld 2015-10-15 08:48:06.430215496 +0900
+@@ -27,7 +27,8 @@
+ {
+ flash0 : org = 0x00000000, len = 0xc0
+ flashcfg : org = 0x00000400, len = 0x10
+- flash : org = 0x00000410, len = 64k - 0x410
++ flash : org = 0x00000410, len = 62k - 0x410
++ eeprom_emu : org = 0x0000F800, len = 2k
+ ram : org = 0x1FFFF800, len = 8k
+ }
+
+@@ -35,6 +36,10 @@
+ __ram_size__ = LENGTH(ram);
+ __ram_end__ = __ram_start__ + __ram_size__;
+
++__eeprom_workarea_start__ = ORIGIN(eeprom_emu);
++__eeprom_workarea_size__ = LENGTH(eeprom_emu);
++__eeprom_workarea_end__ = __eeprom_workarea_start__ + __eeprom_workarea_size__;
++
+ SECTIONS
+ {
+ . = 0;
+
+
+
+Configuration/Startup for Infinity 60%
+--------------------------------------
+Configuration:
+
+
+Clock:
+Inifinity
+ FEI(FLL Engaged Internal) mode with core clock:48MHz, bus clock:48MHz, flash clock:24MHz
+ Clock dividor:
+ SIM_CLKDIV1[OUTDIV1] = 0 divide-by-1 for core clock
+ SIM_CLKDIV1[OUTDIV2] = 0 divide-by-1 for bus clock
+ SIM_CLKDIV1[OUTDIV4] = 1 divide-by-2 for flash clock
+ Internal reference clock:
+ MCG_C1[IREFS] = 1 Internal Reference Select for clock source for FLL
+ MCG_C1[IRCLKEN] = 1 Internal Reference Clock Enable
+ FLL multipilication:
+ MCG_C4[DMX32] = 1
+ MCG_C4[DRST_DRS] = 01 FLL factor 1464 * 32.768kHz = 48MHz
+
+chibios/os/hal/ports/KINETIS/K20x/hal_lld.c
+ k20x_clock_init(): called in __early_init() defined in board.c
+ disable watchdog and configure clock
+
+ configurable macros:
+ KINETIS_NO_INIT: whether init or not
+ KINETIS_MCG_MODE: clock mode
+ KINETIS_MCG_MODE_FEI
+ KINETIS_MCG_MODE_PEE
+ hal/ports/KINETIS/K20x/hal_lld.h
+
+
+chibios/os/hal/boards/FREESCALE_FREEDOM_K20D50M/board.h
+ PALConfig pal_default_config
+ boardInit()
+ __early_init()
+ macro definitions for board infos, freq and mcu type
+
+chibios/os/hal/boards/FREESCALE_FREEDOM_K20D50M/board.c
+
+USB
+
+
+Startup
+-------
+ common/ports/ARMCMx/GCC/crt0_v[67]m.s
+ Reset_Handler: startup code
+ common/ports/ARMCMx/GCC/crt1.c
+ __core_init(): weak
+ __early_init(): weak
+ __late_init(): weak
+ __default_exit(): weak
+ called from Reset_Handler of crt0
+ common/ports/ARMCMx/GCC/vector.c
+ common/ports/ARMCMx/GCC/ld/*.ld
+
+chibios/os/common/ports/ARMCMx/compilers/GCC/
+├── crt0_v6m.s
+├── crt0_v7m.s
+├── crt1.c
+├── ld
+│   ├── MK20DX128BLDR3.ld
+│   ├── MK20DX128BLDR4.ld
+│   ├── MK20DX128.ld
+│   ├── MK20DX256.ld
+│   ├── MKL25Z128.ld
+│   ├── MKL26Z128.ld
+│   ├── MKL26Z64.ld
+│   └── STM32L476xG.ld
+├── mk
+│   ├── startup_k20x5.mk
+│   ├── startup_k20x7.mk
+│   ├── startup_k20x.mk
+│   ├── startup_kl2x.mk
+│   └── startup_stm32l4xx.mk
+├── rules.ld
+├── rules.mk
+└── vectors.c
+
+chibios/os/hal/
+├── boards
+│   ├── FREESCALE_FREEDOM_K20D50M
+│   │   ├── board.c
+│   │   ├── board.h
+│   │   └── board.mk
+│   ├── MCHCK_K20
+│   │   ├── board.c
+│   │   ├── board.h
+│   │   └── board.mk
+│   ├── PJRC_TEENSY_3
+│   │   ├── board.c
+│   │   ├── board.h
+│   │   └── board.mk
+│   ├── PJRC_TEENSY_3_1
+│   │   ├── board.c
+│   │   ├── board.h
+│   │   └── board.mk
+│   ├── PJRC_TEENSY_LC
+│   │   ├── board.c
+│   │   ├── board.h
+│   │   └── board.mk
+│   ├── readme.txt
+│   ├── simulator
+│   │   ├── board.c
+│   │   ├── board.h
+│   │   └── board.mk
+│   ├── ST_NUCLEO_F030R8
+│   │   ├── board.c
+│   │   ├── board.h
+│   │   ├── board.mk
+│   │   └── cfg
+│   │   └── board.chcfg
+├── hal.mk
+├── include
+│   ├── adc.h
+│   ├── can.h
+│   ├── dac.h
+│   ├── ext.h
+│   ├── gpt.h
+│   ├── hal_channels.h
+│   ├── hal_files.h
+│   ├── hal.h
+│   ├── hal_ioblock.h
+│   ├── hal_mmcsd.h
+│   ├── hal_queues.h
+│   ├── hal_streams.h
+│   ├── i2c.h
+│   ├── i2s.h
+│   ├── icu.h
+│   ├── mac.h
+│   ├── mii.h
+│   ├── mmc_spi.h
+│   ├── pal.h
+│   ├── pwm.h
+│   ├── rtc.h
+│   ├── sdc.h
+│   ├── serial.h
+│   ├── serial_usb.h
+│   ├── spi.h
+│   ├── st.h
+│   ├── uart.h
+│   └── usb.h
+├── lib
+│   └── streams
+│   ├── chprintf.c
+│   ├── chprintf.h
+│   ├── memstreams.c
+│   ├── memstreams.h
+│   ├── nullstreams.c
+│   └── nullstreams.h
+├── osal
+│   ├── nil
+│   │   ├── osal.c
+│   │   ├── osal.h
+│   │   └── osal.mk
+│   ├── os-less
+│   │   └── ARMCMx
+│   │   ├── osal.c
+│   │   ├── osal.h
+│   │   └── osal.mk
+│   └── rt
+│   ├── osal.c
+│   ├── osal.h
+│   └── osal.mk
+├── ports
+│   ├── AVR
+│   ├── common
+│   │   └── ARMCMx
+│   │   ├── mpu.h
+│   │   ├── nvic.c
+│   │   └── nvic.h
+│   ├── KINETIS
+│   │   ├── K20x
+│   │   │   ├── hal_lld.c
+│   │   │   ├── hal_lld.h
+│   │   │   ├── kinetis_registry.h
+│   │   │   ├── platform.dox
+│   │   │   ├── platform.mk
+│   │   │   ├── pwm_lld.c
+│   │   │   ├── pwm_lld.h
+│   │   │   ├── spi_lld.c
+│   │   │   └── spi_lld.h
+│   │   ├── KL2x
+│   │   │   ├── hal_lld.c
+│   │   │   ├── hal_lld.h
+│   │   │   ├── kinetis_registry.h
+│   │   │   ├── platform.mk
+│   │   │   ├── pwm_lld.c
+│   │   │   └── pwm_lld.h
+│   │   ├── LLD
+│   │   │   ├── adc_lld.c
+│   │   │   ├── adc_lld.h
+│   │   │   ├── ext_lld.c
+│   │   │   ├── ext_lld.h
+│   │   │   ├── gpt_lld.c
+│   │   │   ├── gpt_lld.h
+│   │   │   ├── i2c_lld.c
+│   │   │   ├── i2c_lld.h
+│   │   │   ├── pal_lld.c
+│   │   │   ├── pal_lld.h
+│   │   │   ├── serial_lld.c
+│   │   │   ├── serial_lld.h
+│   │   │   ├── st_lld.c
+│   │   │   ├── st_lld.h
+│   │   │   ├── usb_lld.c
+│   │   │   └── usb_lld.h
+│   │   └── README.md
+│   ├── LPC
+│   ├── simulator
+│   └── STM32
+├── src
+│   ├── adc.c
+│   ├── can.c
+│   ├── dac.c
+│   ├── ext.c
+│   ├── gpt.c
+│   ├── hal.c
+│   ├── hal_mmcsd.c
+│   ├── hal_queues.c
+│   ├── i2c.c
+│   ├── i2s.c
+│   ├── icu.c
+│   ├── mac.c
+│   ├── mmc_spi.c
+│   ├── pal.c
+│   ├── pwm.c
+│   ├── rtc.c
+│   ├── sdc.c
+│   ├── serial.c
+│   ├── serial_usb.c
+│   ├── spi.c
+│   ├── st.c
+│   ├── uart.c
+│   └── usb.c
+└── templates
+ ├── adc_lld.c
+ ├── adc_lld.h
+ ├── can_lld.c
+ ├── can_lld.h
+ ├── dac_lld.c
+ ├── dac_lld.h
+ ├── ext_lld.c
+ ├── ext_lld.h
+ ├── gpt_lld.c
+ ├── gpt_lld.h
+ ├── halconf.h
+ ├── hal_lld.c
+ ├── hal_lld.h
+ ├── i2c_lld.c
+ ├── i2c_lld.h
+ ├── i2s_lld.c
+ ├── i2s_lld.h
+ ├── icu_lld.c
+ ├── icu_lld.h
+ ├── mac_lld.c
+ ├── mac_lld.h
+ ├── mcuconf.h
+ ├── osal
+ │   ├── osal.c
+ │   ├── osal.h
+ │   └── osal.mk
+ ├── pal_lld.c
+ ├── pal_lld.h
+ ├── platform.mk
+ ├── pwm_lld.c
+ ├── pwm_lld.h
+ ├── rtc_lld.c
+ ├── rtc_lld.h
+ ├── sdc_lld.c
+ ├── sdc_lld.h
+ ├── serial_lld.c
+ ├── serial_lld.h
+ ├── spi_lld.c
+ ├── spi_lld.h
+ ├── st_lld.c
+ ├── st_lld.h
+ ├── uart_lld.c
+ ├── uart_lld.h
+ ├── usb_lld.c
+ └── usb_lld.h
diff --git a/keyboards/teensy_lc_onekey/Makefile b/keyboards/infinity_ergodox/Makefile
index 064e618159..efa32e037d 100644
--- a/keyboards/teensy_lc_onekey/Makefile
+++ b/keyboards/infinity_ergodox/Makefile
@@ -1,14 +1,15 @@
# project specific files
SRC = matrix.c \
- led.c
+ led.c
## chip/board settings
# - the next two should match the directories in
# <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
# - For Teensies, FAMILY = KINETIS and SERIES is either
# KL2x (LC) or K20x (3.0,3.1,3.2).
+# - For Infinity KB, SERIES = K20x
MCU_FAMILY = KINETIS
-MCU_SERIES = KL2x
+MCU_SERIES = K20x
# Linker script to use
# - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
@@ -18,15 +19,17 @@ MCU_SERIES = KL2x
# - MKL26Z64 for Teensy LC
# - MK20DX128 for Teensy 3.0
# - MK20DX256 for Teensy 3.1 and 3.2
-MCU_LDSCRIPT = MKL26Z64
+# - MK20DX128BLDR4 for Infinity 60% with Kiibohd bootloader
+# - MK20DX256BLDR8 for Infinity ErgoDox with Kiibohd bootloader
+MCU_LDSCRIPT = MK20DX256BLDR8
# Startup code to use
# - it should exist in <chibios>/os/common/ports/ARMCMx/compilers/GCC/mk/
# - STARTUP =
# - kl2x for Teensy LC
-# - k20x5 for Teensy 3.0
-# - k20x7 for Teensy 3.1 and 3.2
-MCU_STARTUP = kl2x
+# - k20x5 for Teensy 3.0 and Infinity 60%
+# - k20x7 for Teensy 3.1, 3.2 and Infinity ErgoDox
+MCU_STARTUP = k20x7
# Board: it should exist either in <chibios>/os/hal/boards/
# or <this_dir>/boards
@@ -34,15 +37,22 @@ MCU_STARTUP = kl2x
# - PJRC_TEENSY_LC for Teensy LC
# - PJRC_TEENSY_3 for Teensy 3.0
# - PJRC_TEENSY_3_1 for Teensy 3.1 or 3.2
-BOARD = PJRC_TEENSY_LC
+# - MCHCK_K20 for Infinity KB
+#BOARD = MCHCK_K20
+BOARD = PJRC_TEENSY_3_1
# Cortex version
-# Teensy LC is cortex-m0plus; Teensy 3.x are cortex-m4
-MCU = cortex-m0plus
+# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4
+MCU = cortex-m4
# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
# I.e. 6 for Teensy LC; 7 for Teensy 3.x
-ARMV = 6
+ARMV = 7
+
+# Vector table for application
+# 0x00000000-0x00001000 area is occupied by bootlaoder.*/
+# The CORTEX_VTOR... is needed only for MCHCK/Infinity KB
+OPT_DEFS = -DCORTEX_VTOR_INIT=0x00002000
# Build Options
# comment out to disable the options.
@@ -56,7 +66,8 @@ COMMAND_ENABLE ?= yes # Commands for debug and configuration
SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend
NKRO_ENABLE ?= yes # USB Nkey Rollover
CUSTOM_MATRIX ?= yes # Custom matrix file
+SERIAL_LINK_ENABLE = yes
ifndef QUANTUM_DIR
include ../../Makefile
-endif
+endif \ No newline at end of file
diff --git a/keyboards/infinity_ergodox/bootloader_defs.h b/keyboards/infinity_ergodox/bootloader_defs.h
new file mode 100644
index 0000000000..c67153be60
--- /dev/null
+++ b/keyboards/infinity_ergodox/bootloader_defs.h
@@ -0,0 +1 @@
+#define KIIBOHD_BOOTLOADER
diff --git a/keyboards/infinity_ergodox/chconf.h b/keyboards/infinity_ergodox/chconf.h
new file mode 100644
index 0000000000..d59c35eb68
--- /dev/null
+++ b/keyboards/infinity_ergodox/chconf.h
@@ -0,0 +1,524 @@
+/*
+ ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+/**
+ * @file templates/chconf.h
+ * @brief Configuration file template.
+ * @details A copy of this file must be placed in each project directory, it
+ * contains the application specific kernel settings.
+ *
+ * @addtogroup config
+ * @details Kernel related settings and hooks.
+ * @{
+ */
+
+#ifndef _CHCONF_H_
+#define _CHCONF_H_
+
+#define _CHIBIOS_RT_CONF_
+
+/*===========================================================================*/
+/**
+ * @name System timers settings
+ * @{
+ */
+/*===========================================================================*/
+
+/**
+ * @brief System time counter resolution.
+ * @note Allowed values are 16 or 32 bits.
+ */
+#define CH_CFG_ST_RESOLUTION 32
+
+/**
+ * @brief System tick frequency.
+ * @details Frequency of the system timer that drives the system ticks. This
+ * setting also defines the system tick time unit.
+ */
+#define CH_CFG_ST_FREQUENCY 100000
+
+/**
+ * @brief Time delta constant for the tick-less mode.
+ * @note If this value is zero then the system uses the classic
+ * periodic tick. This value represents the minimum number
+ * of ticks that is safe to specify in a timeout directive.
+ * The value one is not valid, timeouts are rounded up to
+ * this value.
+ */
+#define CH_CFG_ST_TIMEDELTA 0
+
+/** @} */
+
+/*===========================================================================*/
+/**
+ * @name Kernel parameters and options
+ * @{
+ */
+/*===========================================================================*/
+
+/**
+ * @brief Round robin interval.
+ * @details This constant is the number of system ticks allowed for the
+ * threads before preemption occurs. Setting this value to zero
+ * disables the preemption for threads with equal priority and the
+ * round robin becomes cooperative. Note that higher priority
+ * threads can still preempt, the kernel is always preemptive.
+ * @note Disabling the round robin preemption makes the kernel more compact
+ * and generally faster.
+ * @note The round robin preemption is not supported in tickless mode and
+ * must be set to zero in that case.
+ */
+#define CH_CFG_TIME_QUANTUM 20
+
+/**
+ * @brief Managed RAM size.
+ * @details Size of the RAM area to be managed by the OS. If set to zero
+ * then the whole available RAM is used. The core memory is made
+ * available to the heap allocator and/or can be used directly through
+ * the simplified core memory allocator.
+ *
+ * @note In order to let the OS manage the whole RAM the linker script must
+ * provide the @p __heap_base__ and @p __heap_end__ symbols.
+ * @note Requires @p CH_CFG_USE_MEMCORE.
+ */
+#define CH_CFG_MEMCORE_SIZE 0
+
+/**
+ * @brief Idle thread automatic spawn suppression.
+ * @details When this option is activated the function @p chSysInit()
+ * does not spawn the idle thread. The application @p main()
+ * function becomes the idle thread and must implement an
+ * infinite loop.
+ */
+#define CH_CFG_NO_IDLE_THREAD FALSE
+
+/** @} */
+
+/*===========================================================================*/
+/**
+ * @name Performance options
+ * @{
+ */
+/*===========================================================================*/
+
+/**
+ * @brief OS optimization.
+ * @details If enabled then time efficient rather than space efficient code
+ * is used when two possible implementations exist.
+ *
+ * @note This is not related to the compiler optimization options.
+ * @note The default is @p TRUE.
+ */
+#define CH_CFG_OPTIMIZE_SPEED TRUE
+
+/** @} */
+
+/*===========================================================================*/
+/**
+ * @name Subsystem options
+ * @{
+ */
+/*===========================================================================*/
+
+/**
+ * @brief Time Measurement APIs.
+ * @details If enabled then the time measurement APIs are included in
+ * the kernel.
+ *
+ * @note The default is @p TRUE.
+ */
+#define CH_CFG_USE_TM FALSE
+
+/**
+ * @brief Threads registry APIs.
+ * @details If enabled then the registry APIs are included in the kernel.
+ *
+ * @note The default is @p TRUE.
+ */
+#define CH_CFG_USE_REGISTRY TRUE
+
+/**
+ * @brief Threads synchronization APIs.
+ * @details If enabled then the @p chThdWait() function is included in
+ * the kernel.
+ *
+ * @note The default is @p TRUE.
+ */
+#define CH_CFG_USE_WAITEXIT TRUE
+
+/**
+ * @brief Semaphores APIs.
+ * @details If enabled then the Semaphores APIs are included in the kernel.
+ *
+ * @note The default is @p TRUE.
+ */
+#define CH_CFG_USE_SEMAPHORES TRUE
+
+/**
+ * @brief Semaphores queuing mode.
+ * @details If enabled then the threads are enqueued on semaphores by
+ * priority rather than in FIFO order.
+ *
+ * @note The default is @p FALSE. Enable this if you have special
+ * requirements.
+ * @note Requires @p CH_CFG_USE_SEMAPHORES.
+ */
+#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE
+
+/**
+ * @brief Mutexes APIs.
+ * @details If enabled then the mutexes APIs are included in the kernel.
+ *
+ * @note The default is @p TRUE.
+ */
+#define CH_CFG_USE_MUTEXES TRUE
+
+/**
+ * @brief Enables recursive behavior on mutexes.
+ * @note Recursive mutexes are heavier and have an increased
+ * memory footprint.
+ *
+ * @note The default is @p FALSE.
+ * @note Requires @p CH_CFG_USE_MUTEXES.
+ */
+#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE
+
+/**
+ * @brief Conditional Variables APIs.
+ * @details If enabled then the conditional variables APIs are included
+ * in the kernel.
+ *
+ * @note The default is @p TRUE.
+ * @note Requires @p CH_CFG_USE_MUTEXES.
+ */
+#define CH_CFG_USE_CONDVARS TRUE
+
+/**
+ * @brief Conditional Variables APIs with timeout.
+ * @details If enabled then the conditional variables APIs with timeout
+ * specification are included in the kernel.
+ *
+ * @note The default is @p TRUE.
+ * @note Requires @p CH_CFG_USE_CONDVARS.
+ */
+#define CH_CFG_USE_CONDVARS_TIMEOUT TRUE
+
+/**
+ * @brief Events Flags APIs.
+ * @details If enabled then the event flags APIs are included in the kernel.
+ *
+ * @note The default is @p TRUE.
+ */
+#define CH_CFG_USE_EVENTS TRUE
+
+/**
+ * @brief Events Flags APIs with timeout.
+ * @details If enabled then the events APIs with timeout specification
+ * are included in the kernel.
+ *
+ * @note The default is @p TRUE.
+ * @note Requires @p CH_CFG_USE_EVENTS.
+ */
+#define CH_CFG_USE_EVENTS_TIMEOUT TRUE
+
+/**
+ * @brief Synchronous Messages APIs.
+ * @details If enabled then the synchronous messages APIs are included
+ * in the kernel.
+ *
+ * @note The default is @p TRUE.
+ */
+#define CH_CFG_USE_MESSAGES TRUE
+
+/**
+ * @brief Synchronous Messages queuing mode.
+ * @details If enabled then messages are served by priority rather than in
+ * FIFO order.
+ *
+ * @note The default is @p FALSE. Enable this if you have special
+ * requirements.
+ * @note Requires @p CH_CFG_USE_MESSAGES.
+ */
+#define CH_CFG_USE_MESSAGES_PRIORITY FALSE
+
+/**
+ * @brief Mailboxes APIs.
+ * @details If enabled then the asynchronous messages (mailboxes) APIs are
+ * included in the kernel.
+ *
+ * @note The default is @p TRUE.
+ * @note Requires @p CH_CFG_USE_SEMAPHORES.
+ */
+#define CH_CFG_USE_MAILBOXES TRUE
+
+/**
+ * @brief I/O Queues APIs.
+ * @details If enabled then the I/O queues APIs are included in the kernel.
+ *
+ * @note The default is @p TRUE.
+ */
+#define CH_CFG_USE_QUEUES TRUE
+
+/**
+ * @brief Core Memory Manager APIs.
+ * @details If enabled then the core memory manager APIs are included
+ * in the kernel.
+ *
+ * @note The default is @p TRUE.
+ */
+#define CH_CFG_USE_MEMCORE TRUE
+
+/**
+ * @brief Heap Allocator APIs.
+ * @details If enabled then the memory heap allocator APIs are included
+ * in the kernel.
+ *
+ * @note The default is @p TRUE.
+ * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or
+ * @p CH_CFG_USE_SEMAPHORES.
+ * @note Mutexes are recommended.
+ */
+#define CH_CFG_USE_HEAP TRUE
+
+/**
+ * @brief Memory Pools Allocator APIs.
+ * @details If enabled then the memory pools allocator APIs are included
+ * in the kernel.
+ *
+ * @note The default is @p TRUE.
+ */
+#define CH_CFG_USE_MEMPOOLS TRUE
+
+/**
+ * @brief Dynamic Threads APIs.
+ * @details If enabled then the dynamic threads creation APIs are included
+ * in the kernel.
+ *
+ * @note The default is @p TRUE.
+ * @note Requires @p CH_CFG_USE_WAITEXIT.
+ * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS.
+ */
+#define CH_CFG_USE_DYNAMIC TRUE
+
+/** @} */
+
+/*===========================================================================*/
+/**
+ * @name Debug options
+ * @{
+ */
+/*===========================================================================*/
+
+/**
+ * @brief Debug option, kernel statistics.
+ *
+ * @note The default is @p FALSE.
+ */
+#define CH_DBG_STATISTICS FALSE
+
+/**
+ * @brief Debug option, system state check.
+ * @details If enabled the correct call protocol for system APIs is checked
+ * at runtime.
+ *
+ * @note The default is @p FALSE.
+ */
+#define CH_DBG_SYSTEM_STATE_CHECK FALSE
+
+/**
+ * @brief Debug option, parameters checks.
+ * @details If enabled then the checks on the API functions input
+ * parameters are activated.
+ *
+ * @note The default is @p FALSE.
+ */
+#define CH_DBG_ENABLE_CHECKS FALSE
+
+/**
+ * @brief Debug option, consistency checks.
+ * @details If enabled then all the assertions in the kernel code are
+ * activated. This includes consistency checks inside the kernel,
+ * runtime anomalies and port-defined checks.
+ *
+ * @note The default is @p FALSE.
+ */
+#define CH_DBG_ENABLE_ASSERTS FALSE
+
+/**
+ * @brief Debug option, trace buffer.
+ * @details If enabled then the context switch circular trace buffer is
+ * activated.
+ *
+ * @note The default is @p FALSE.
+ */
+#define CH_DBG_ENABLE_TRACE FALSE
+
+/**
+ * @brief Debug option, stack checks.
+ * @details If enabled then a runtime stack check is performed.
+ *
+ * @note The default is @p FALSE.
+ * @note The stack check is performed in a architecture/port dependent way.
+ * It may not be implemented or some ports.
+ * @note The default failure mode is to halt the system with the global
+ * @p panic_msg variable set to @p NULL.
+ */
+#define CH_DBG_ENABLE_STACK_CHECK FALSE
+
+/**
+ * @brief Debug option, stacks initialization.
+ * @details If enabled then the threads working area is filled with a byte
+ * value when a thread is created. This can be useful for the
+ * runtime measurement of the used stack.
+ *
+ * @note The default is @p FALSE.
+ */
+#define CH_DBG_FILL_THREADS FALSE
+
+/**
+ * @brief Debug option, threads profiling.
+ * @details If enabled then a field is added to the @p thread_t structure that
+ * counts the system ticks occurred while executing the thread.
+ *
+ * @note The default is @p FALSE.
+ * @note This debug option is not currently compatible with the
+ * tickless mode.
+ */
+#define CH_DBG_THREADS_PROFILING FALSE
+
+/** @} */
+
+/*===========================================================================*/
+/**
+ * @name Kernel hooks
+ * @{
+ */
+/*===========================================================================*/
+
+/**
+ * @brief Threads descriptor structure extension.
+ * @details User fields added to the end of the @p thread_t structure.
+ */
+#define CH_CFG_THREAD_EXTRA_FIELDS \
+ /* Add threads custom fields here.*/
+
+/**
+ * @brief Threads initialization hook.
+ * @details User initialization code added to the @p chThdInit() API.
+ *
+ * @note It is invoked from within @p chThdInit() and implicitly from all
+ * the threads creation APIs.
+ */
+#define CH_CFG_THREAD_INIT_HOOK(tp) { \
+ /* Add threads initialization code here.*/ \
+}
+
+/**
+ * @brief Threads finalization hook.
+ * @details User finalization code added to the @p chThdExit() API.
+ *
+ * @note It is inserted into lock zone.
+ * @note It is also invoked when the threads simply return in order to
+ * terminate.
+ */
+#define CH_CFG_THREAD_EXIT_HOOK(tp) { \
+ /* Add threads finalization code here.*/ \
+}
+
+/**
+ * @brief Context switch hook.
+ * @details This hook is invoked just before switching between threads.
+ */
+#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \
+ /* Context switch code here.*/ \
+}
+
+/**
+ * @brief ISR enter hook.
+ */
+#define CH_CFG_IRQ_PROLOGUE_HOOK() { \
+ /* IRQ prologue code here.*/ \
+}
+
+/**
+ * @brief ISR exit hook.
+ */
+#define CH_CFG_IRQ_EPILOGUE_HOOK() { \
+ /* IRQ epilogue code here.*/ \
+}
+
+/**
+ * @brief Idle thread enter hook.
+ * @note This hook is invoked within a critical zone, no OS functions
+ * should be invoked from here.
+ * @note This macro can be used to activate a power saving mode.
+ */
+#define CH_CFG_IDLE_ENTER_HOOK() { \
+}
+
+/**
+ * @brief Idle thread leave hook.
+ * @note This hook is invoked within a critical zone, no OS functions
+ * should be invoked from here.
+ * @note This macro can be used to deactivate a power saving mode.
+ */
+#define CH_CFG_IDLE_LEAVE_HOOK() { \
+}
+
+/**
+ * @brief Idle Loop hook.
+ * @details This hook is continuously invoked by the idle thread loop.
+ */
+#define CH_CFG_IDLE_LOOP_HOOK() { \
+ /* Idle loop code here.*/ \
+}
+
+/**
+ * @brief System tick event hook.
+ * @details This hook is invoked in the system tick handler immediately
+ * after processing the virtual timers queue.
+ */
+#define CH_CFG_SYSTEM_TICK_HOOK() { \
+ /* System tick event code here.*/ \
+}
+
+/**
+ * @brief System halt hook.
+ * @details This hook is invoked in case to a system halting error before
+ * the system is halted.
+ */
+#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \
+ /* System halt code here.*/ \
+}
+
+/**
+ * @brief Trace hook.
+ * @details This hook is invoked each time a new record is written in the
+ * trace buffer.
+ */
+#define CH_CFG_TRACE_HOOK(tep) { \
+ /* Trace code here.*/ \
+}
+
+/** @} */
+
+/*===========================================================================*/
+/* Port-specific settings (override port settings defaulted in chcore.h). */
+/*===========================================================================*/
+
+#endif /* _CHCONF_H_ */
+
+/** @} */
diff --git a/keyboards/stm32_f103_onekey/config.h b/keyboards/infinity_ergodox/config.h
index 19b14fe61a..d24ee0f056 100644
--- a/keyboards/stm32_f103_onekey/config.h
+++ b/keyboards/infinity_ergodox/config.h
@@ -26,15 +26,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* in python2: list(u"whatever".encode('utf-16-le')) */
/* at most 32 characters or the ugly hack in usb_main.c borks */
#define MANUFACTURER "TMK"
-#define USBSTR_MANUFACTURER 'T', '\x00', 'M', '\x00', 'K', '\x00', ' ', '\x00', '\xc6', '\x00'
-#define PRODUCT "ChibiOS TMK test"
-#define USBSTR_PRODUCT 'C', '\x00', 'h', '\x00', 'i', '\x00', 'b', '\x00', 'i', '\x00', 'O', '\x00', 'S', '\x00', ' ', '\x00', 'T', '\x00', 'M', '\x00', 'K', '\x00', ' ', '\x00', 't', '\x00', 'e', '\x00', 's', '\x00', 't', '\x00'
-#define DESCRIPTION "TMK keyboard firmware over ChibiOS"
+#define USBSTR_MANUFACTURER 'T', '\x00', 'M', '\x00', 'K', '\x00', ' ', '\x00'
+#define PRODUCT "Infinity keyboard/TMK"
+#define USBSTR_PRODUCT 'I', '\x00', 'n', '\x00', 'f', '\x00', 'i', '\x00', 'n', '\x00', 'i', '\x00', 't', '\x00', 'y', '\x00', ' ', '\x00', 'k', '\x00', 'e', '\x00', 'y', '\x00', 'b', '\x00', 'o', '\x00', 'a', '\x00', 'r', '\x00', 'd', '\x00', '/', '\x00', 'T', '\x00', 'M', '\x00', 'K', '\x00'
/* key matrix size */
-#define MATRIX_ROWS 1
-#define MATRIX_COLS 1
-#define DIODE_DIRECTION COL2ROW
+#define MATRIX_ROWS 18
+#define MATRIX_COLS 5
+#define LOCAL_MATRIX_ROWS 9
/* define if matrix has ghost */
//#define MATRIX_HAS_GHOST
@@ -43,16 +42,22 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define DEBOUNCE 5
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
-#define LOCKING_SUPPORT_ENABLE
+//#define LOCKING_SUPPORT_ENABLE
/* Locking resynchronize hack */
-#define LOCKING_RESYNC_ENABLE
+//#define LOCKING_RESYNC_ENABLE
/* key combination for command */
#define IS_COMMAND() ( \
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
)
+/* Keymap for Infiity prototype */
+#define INFINITY_PROTOTYPE
+#define SERIAL_LINK_BAUD 562500
+#define SERIAL_LINK_THREAD_PRIORITY (NORMALPRIO - 1)
+// The visualizer needs gfx thread priorities
+#define VISUALIZER_THREAD_PRIORITY (NORMAL_PRIORITY - 2)
/*
* Feature disable options
diff --git a/keyboards/infinity_ergodox/halconf.h b/keyboards/infinity_ergodox/halconf.h
new file mode 100644
index 0000000000..55dd5e88da
--- /dev/null
+++ b/keyboards/infinity_ergodox/halconf.h
@@ -0,0 +1,353 @@
+/*
+ ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+/**
+ * @file templates/halconf.h
+ * @brief HAL configuration header.
+ * @details HAL configuration file, this file allows to enable or disable the
+ * various device drivers from your application. You may also use
+ * this file in order to override the device drivers default settings.
+ *
+ * @addtogroup HAL_CONF
+ * @{
+ */
+
+#ifndef _HALCONF_H_
+#define _HALCONF_H_
+
+#include "mcuconf.h"
+
+/**
+ * @brief Enables the PAL subsystem.
+ */
+#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__)
+#define HAL_USE_PAL TRUE
+#endif
+
+/**
+ * @brief Enables the ADC subsystem.
+ */
+#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__)
+#define HAL_USE_ADC FALSE
+#endif
+
+/**
+ * @brief Enables the CAN subsystem.
+ */
+#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__)
+#define HAL_USE_CAN FALSE
+#endif
+
+/**
+ * @brief Enables the DAC subsystem.
+ */
+#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__)
+#define HAL_USE_DAC FALSE
+#endif
+
+/**
+ * @brief Enables the EXT subsystem.
+ */
+#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__)
+#define HAL_USE_EXT FALSE
+#endif
+
+/**
+ * @brief Enables the GPT subsystem.
+ */
+#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__)
+#define HAL_USE_GPT FALSE
+#endif
+
+/**
+ * @brief Enables the I2C subsystem.
+ */
+#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__)
+#define HAL_USE_I2C TRUE
+#endif
+
+/**
+ * @brief Enables the I2S subsystem.
+ */
+#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__)
+#define HAL_USE_I2S FALSE
+#endif
+
+/**
+ * @brief Enables the ICU subsystem.
+ */
+#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__)
+#define HAL_USE_ICU FALSE
+#endif
+
+/**
+ * @brief Enables the MAC subsystem.
+ */
+#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__)
+#define HAL_USE_MAC FALSE
+#endif
+
+/**
+ * @brief Enables the MMC_SPI subsystem.
+ */
+#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__)
+#define HAL_USE_MMC_SPI FALSE
+#endif
+
+/**
+ * @brief Enables the PWM subsystem.
+ */
+#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__)
+#define HAL_USE_PWM FALSE
+#endif
+
+/**
+ * @brief Enables the RTC subsystem.
+ */
+#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__)
+#define HAL_USE_RTC FALSE
+#endif
+
+/**
+ * @brief Enables the SDC subsystem.
+ */
+#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__)
+#define HAL_USE_SDC FALSE
+#endif
+
+/**
+ * @brief Enables the SERIAL subsystem.
+ */
+#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__)
+#define HAL_USE_SERIAL TRUE
+#endif
+
+/**
+ * @brief Enables the SERIAL over USB subsystem.
+ */
+#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__)
+#define HAL_USE_SERIAL_USB TRUE
+#endif
+
+/**
+ * @brief Enables the SPI subsystem.
+ */
+#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__)
+#define HAL_USE_SPI TRUE
+#endif
+
+/**
+ * @brief Enables the UART subsystem.
+ */
+#if !defined(HAL_USE_UART) || defined(__DOXYGEN__)
+#define HAL_USE_UART FALSE
+#endif
+
+/**
+ * @brief Enables the USB subsystem.
+ */
+#if !defined(HAL_USE_USB) || defined(__DOXYGEN__)
+#define HAL_USE_USB TRUE
+#endif
+
+/**
+ * @brief Enables the WDG subsystem.
+ */
+#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__)
+#define HAL_USE_WDG FALSE
+#endif
+
+/*===========================================================================*/
+/* ADC driver related settings. */
+/*===========================================================================*/
+
+/**
+ * @brief Enables synchronous APIs.
+ * @note Disabling this option saves both code and data space.
+ */
+#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__)
+#define ADC_USE_WAIT TRUE
+#endif
+
+/**
+ * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs.
+ * @note Disabling this option saves both code and data space.
+ */
+#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
+#define ADC_USE_MUTUAL_EXCLUSION TRUE
+#endif
+
+/*===========================================================================*/
+/* CAN driver related settings. */
+/*===========================================================================*/
+
+/**
+ * @brief Sleep mode related APIs inclusion switch.
+ */
+#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__)
+#define CAN_USE_SLEEP_MODE TRUE
+#endif
+
+/*===========================================================================*/
+/* I2C driver related settings. */
+/*===========================================================================*/
+
+/**
+ * @brief Enables the mutual exclusion APIs on the I2C bus.
+ */
+#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
+#define I2C_USE_MUTUAL_EXCLUSION TRUE
+#endif
+
+/*===========================================================================*/
+/* MAC driver related settings. */
+/*===========================================================================*/
+
+/**
+ * @brief Enables an event sources for incoming packets.
+ */
+#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__)
+#define MAC_USE_ZERO_COPY FALSE
+#endif
+
+/**
+ * @brief Enables an event sources for incoming packets.
+ */
+#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__)
+#define MAC_USE_EVENTS TRUE
+#endif
+
+/*===========================================================================*/
+/* MMC_SPI driver related settings. */
+/*===========================================================================*/
+
+/**
+ * @brief Delays insertions.
+ * @details If enabled this options inserts delays into the MMC waiting
+ * routines releasing some extra CPU time for the threads with
+ * lower priority, this may slow down the driver a bit however.
+ * This option is recommended also if the SPI driver does not
+ * use a DMA channel and heavily loads the CPU.
+ */
+#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__)
+#define MMC_NICE_WAITING TRUE
+#endif
+
+/*===========================================================================*/
+/* SDC driver related settings. */
+/*===========================================================================*/
+
+/**
+ * @brief Number of initialization attempts before rejecting the card.
+ * @note Attempts are performed at 10mS intervals.
+ */
+#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__)
+#define SDC_INIT_RETRY 100
+#endif
+
+/**
+ * @brief Include support for MMC cards.
+ * @note MMC support is not yet implemented so this option must be kept
+ * at @p FALSE.
+ */
+#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__)
+#define SDC_MMC_SUPPORT FALSE
+#endif
+
+/**
+ * @brief Delays insertions.
+ * @details If enabled this options inserts delays into the MMC waiting
+ * routines releasing some extra CPU time for the threads with
+ * lower priority, this may slow down the driver a bit however.
+ */
+#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__)
+#define SDC_NICE_WAITING TRUE
+#endif
+
+/*===========================================================================*/
+/* SERIAL driver related settings. */
+/*===========================================================================*/
+
+/**
+ * @brief Default bit rate.
+ * @details Configuration parameter, this is the baud rate selected for the
+ * default configuration.
+ */
+#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__)
+#define SERIAL_DEFAULT_BITRATE 38400
+#endif
+
+/**
+ * @brief Serial buffers size.
+ * @details Configuration parameter, you can change the depth of the queue
+ * buffers depending on the requirements of your application.
+ * @note The default is 64 bytes for both the transmission and receive
+ * buffers.
+ */
+#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__)
+#define SERIAL_BUFFERS_SIZE 128
+#endif
+
+/*===========================================================================*/
+/* SERIAL_USB driver related setting. */
+/*===========================================================================*/
+
+/**
+ * @brief Serial over USB buffers size.
+ * @details Configuration parameter, the buffer size must be a multiple of
+ * the USB data endpoint maximum packet size.
+ * @note The default is 64 bytes for both the transmission and receive
+ * buffers.
+ */
+#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__)
+#define SERIAL_USB_BUFFERS_SIZE 256
+#endif
+
+/*===========================================================================*/
+/* SPI driver related settings. */
+/*===========================================================================*/
+
+/**
+ * @brief Enables synchronous APIs.
+ * @note Disabling this option saves both code and data space.
+ */
+#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__)
+#define SPI_USE_WAIT TRUE
+#endif
+
+/**
+ * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs.
+ * @note Disabling this option saves both code and data space.
+ */
+#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
+#define SPI_USE_MUTUAL_EXCLUSION TRUE
+#endif
+
+/*===========================================================================*/
+/* USB driver related settings. */
+/*===========================================================================*/
+
+/**
+ * @brief Enables synchronous APIs.
+ * @note Disabling this option saves both code and data space.
+ */
+#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__)
+#define USB_USE_WAIT TRUE
+#endif
+
+#endif /* _HALCONF_H_ */
+
+/** @} */
diff --git a/keyboards/infinity_ergodox/infinity_ergodox.c b/keyboards/infinity_ergodox/infinity_ergodox.c
new file mode 100644
index 0000000000..85054775e8
--- /dev/null
+++ b/keyboards/infinity_ergodox/infinity_ergodox.c
@@ -0,0 +1,11 @@
+#include "infinity_ergodox.h"
+#include "ch.h"
+#include "hal.h"
+#include "serial_link/system/serial_link.h"
+
+void init_serial_link_hal(void) {
+ PORTA->PCR[1] = PORTx_PCRn_PE | PORTx_PCRn_PS | PORTx_PCRn_PFE | PORTx_PCRn_MUX(2);
+ PORTA->PCR[2] = PORTx_PCRn_DSE | PORTx_PCRn_SRE | PORTx_PCRn_MUX(2);
+ PORTE->PCR[0] = PORTx_PCRn_PE | PORTx_PCRn_PS | PORTx_PCRn_PFE | PORTx_PCRn_MUX(3);
+ PORTE->PCR[1] = PORTx_PCRn_DSE | PORTx_PCRn_SRE | PORTx_PCRn_MUX(3);
+}
diff --git a/keyboards/infinity_ergodox/infinity_ergodox.h b/keyboards/infinity_ergodox/infinity_ergodox.h
new file mode 100644
index 0000000000..de72675946
--- /dev/null
+++ b/keyboards/infinity_ergodox/infinity_ergodox.h
@@ -0,0 +1,44 @@
+#ifndef KEYBOARDS_INFINITY_ERGODOX_INFINITY_ERGODOX_H_
+#define KEYBOARDS_INFINITY_ERGODOX_INFINITY_ERGODOX_H_
+
+#include "quantum.h"
+
+#define KEYMAP( \
+ A80, A70, A60, A50, A40, A30, A20, \
+ A81, A71, A61, A51, A41, A31, A21, \
+ A82, A72, A62, A52, A42, A32, \
+ A83, A73, A63, A53, A43, A33, A23, \
+ A84, A74, A64, A54, A44, \
+ A13, A03, \
+ A04, \
+ A34, A24, A14, \
+ B20, B30, B40, B50, B60, B70, B80, \
+ B21, B31, B41, B51, B61, B71, B81, \
+ B32, B42, B52, B62, B72, B82, \
+ B23, B33, B43, B53, B63, B73, B83, \
+ B44, B54, B64, B74, B84, \
+ B03, B13, \
+ B04, \
+ B14, B24, B34 \
+) { \
+ { KC_NO, KC_NO, KC_NO, KC_##A03, KC_##A04 }, \
+ { KC_NO, KC_NO, KC_NO, KC_##A13, KC_##A14 }, \
+ { KC_##A20, KC_##A21, KC_NO, KC_##A23, KC_##A24 }, \
+ { KC_##A30, KC_##A31, KC_##A32, KC_##A33, KC_##A34 }, \
+ { KC_##A40, KC_##A41, KC_##A42, KC_##A43, KC_##A44 }, \
+ { KC_##A50, KC_##A51, KC_##A52, KC_##A53, KC_##A54 }, \
+ { KC_##A60, KC_##A61, KC_##A62, KC_##A63, KC_##A64 }, \
+ { KC_##A70, KC_##A71, KC_##A72, KC_##A73, KC_##A74 }, \
+ { KC_##A80, KC_##A81, KC_##A82, KC_##A83, KC_##A84 }, \
+ { KC_NO, KC_NO, KC_NO, KC_##B03, KC_##B04 }, \
+ { KC_NO, KC_NO, KC_NO, KC_##B13, KC_##B14 }, \
+ { KC_##B20, KC_##B21, KC_NO, KC_##B23, KC_##B24 }, \
+ { KC_##B30, KC_##B31, KC_##B32, KC_##B33, KC_##B34 }, \
+ { KC_##B40, KC_##B41, KC_##B42, KC_##B43, KC_##B44 }, \
+ { KC_##B50, KC_##B51, KC_##B52, KC_##B53, KC_##B54 }, \
+ { KC_##B60, KC_##B61, KC_##B62, KC_##B63, KC_##B64 }, \
+ { KC_##B70, KC_##B71, KC_##B72, KC_##B73, KC_##B74 }, \
+ { KC_##B80, KC_##B81, KC_##B82, KC_##B83, KC_##B84 } \
+}
+
+#endif /* KEYBOARDS_INFINITY_ERGODOX_INFINITY_ERGODOX_H_ */
diff --git a/keyboards/infinity_ergodox/keymaps/default/keymap.c b/keyboards/infinity_ergodox/keymaps/default/keymap.c
new file mode 100644
index 0000000000..c33fb7b926
--- /dev/null
+++ b/keyboards/infinity_ergodox/keymaps/default/keymap.c
@@ -0,0 +1,111 @@
+/*
+Copyright 2016 Fred Sundvik <fsundvik@gmail.com>
+Jun Wako <wakojun@gmail.com>
+
+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 "infinity_ergodox.h"
+
+const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+ KEYMAP( // layer 0 : default
+ // left hand
+ EQL, 1, 2, 3, 4, 5, ESC,
+ BSLS,Q, W, E, R, T, FN1,
+ TAB, A, S, D, F, G,
+ LSFT,Z, X, C, V, B, FN0,
+ LGUI,GRV, BSLS,LEFT,RGHT,
+ LCTL,LALT,
+ HOME,
+ BSPC,DEL, END,
+ // right hand
+ FN2, 6, 7, 8, 9, 0, MINS,
+ LBRC,Y, U, I, O, P, RBRC,
+ H, J, K, L, SCLN,QUOT,
+ FN0, N, M, COMM,DOT, SLSH,RSFT,
+ LEFT,DOWN,UP, RGHT,RGUI,
+ RALT,RCTL,
+ PGUP,
+ PGDN,ENT, SPC
+ ),
+
+ KEYMAP( // layer 1 : function and symbol keys
+ // left hand
+ TRNS,F1, F2, F3, F4, F5, F11,
+ TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,FN3,
+ TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
+ TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
+ TRNS,TRNS,TRNS,TRNS,TRNS,
+ TRNS,TRNS,
+ TRNS,
+ TRNS,TRNS,TRNS,
+ // right hand
+ F12, F6, F7, F8, F9, F10, TRNS,
+ TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
+ TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
+ TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
+ TRNS,TRNS,TRNS,TRNS,TRNS,
+ TRNS,TRNS,
+ TRNS,
+ TRNS,TRNS,TRNS
+ ),
+
+ KEYMAP( // layer 2 : keyboard functions
+ // left hand
+ BTLD,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
+ TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, FN3,
+ TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
+ TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
+ TRNS,TRNS,TRNS,TRNS,TRNS,
+ TRNS,TRNS,
+ TRNS,
+ TRNS,TRNS,TRNS,
+ // right hand
+ TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
+ TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
+ TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
+ TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
+ TRNS,TRNS,TRNS,TRNS,TRNS,
+ TRNS,TRNS,
+ TRNS,
+ TRNS,TRNS,TRNS
+ ),
+
+ KEYMAP( // layer 3: numpad
+ // left hand
+ TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
+ TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
+ TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
+ TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
+ TRNS,TRNS,TRNS,TRNS,TRNS,
+ TRNS,TRNS,
+ TRNS,
+ TRNS,TRNS,TRNS,
+ // right hand
+ TRNS,NLCK,PSLS,PAST,PAST,PMNS,BSPC,
+ TRNS,NO, P7, P8, P9, PMNS,BSPC,
+ NO, P4, P5, P6, PPLS,PENT,
+ TRNS,NO, P1, P2, P3, PPLS,PENT,
+ P0, PDOT,SLSH,PENT,PENT,
+ TRNS,TRNS,
+ TRNS,
+ TRNS,TRNS,TRNS
+ ),
+};
+const uint16_t fn_actions[] = {
+ ACTION_LAYER_MOMENTARY(1), // FN0 - switch to Layer1
+ ACTION_LAYER_SET(2, ON_PRESS), // FN1 - set Layer2
+ ACTION_LAYER_TOGGLE(3), // FN2 - toggle Layer3 aka Numpad layer
+ ACTION_LAYER_SET(0, ON_PRESS), // FN3 - set Layer0
+};
diff --git a/keyboards/infinity_ergodox/led.c b/keyboards/infinity_ergodox/led.c
new file mode 100644
index 0000000000..77195bb358
--- /dev/null
+++ b/keyboards/infinity_ergodox/led.c
@@ -0,0 +1,49 @@
+/*
+Copyright 2012 Jun Wako <wakojun@gmail.com>
+
+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 "hal.h"
+
+#include "led.h"
+
+
+void led_set(uint8_t usb_led) {
+// The LCD backlight functionality conflicts with this simple
+// red backlight
+#if !defined(LCD_BACKLIGHT_ENABLE) && defined(STATUS_LED_ENABLE)
+ // PTC1: LCD Backlight Red(0:on/1:off)
+ GPIOC->PDDR |= (1<<1);
+ PORTC->PCR[1] |= PORTx_PCRn_DSE | PORTx_PCRn_MUX(1);
+ if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
+ GPIOC->PCOR |= (1<<1);
+ } else {
+ GPIOC->PSOR |= (1<<1);
+ }
+#elif !defined(LCD_BACKLIGHT_ENABLE)
+ (void)usb_led;
+ GPIOC->PDDR |= (1<<1);
+ PORTC->PCR[1] |= PORTx_PCRn_DSE | PORTx_PCRn_MUX(1);
+ GPIOC->PSOR |= (1<<1);
+ GPIOC->PDDR |= (1<<2);
+ PORTC->PCR[2] |= PORTx_PCRn_DSE | PORTx_PCRn_MUX(1);
+ GPIOC->PSOR |= (1<<2);
+ GPIOC->PDDR |= (1<<3);
+ PORTC->PCR[3] |= PORTx_PCRn_DSE | PORTx_PCRn_MUX(1);
+ GPIOC->PSOR |= (1<<3);
+#else
+ (void)usb_led;
+#endif
+}
diff --git a/keyboards/infinity_ergodox/matrix.c b/keyboards/infinity_ergodox/matrix.c
new file mode 100644
index 0000000000..2b806cd649
--- /dev/null
+++ b/keyboards/infinity_ergodox/matrix.c
@@ -0,0 +1,169 @@
+/*
+Copyright 2016 Fred Sundvik <fsundvik@gmail.com>
+Jun Wako <wakojun@gmail.com>
+
+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 <stdint.h>
+#include <stdbool.h>
+#include <string.h>
+#include "hal.h"
+#include "timer.h"
+#include "wait.h"
+#include "print.h"
+#include "debug.h"
+#include "matrix.h"
+
+
+/*
+ * Infinity ErgoDox Pinusage:
+ * Column pins are input with internal pull-down. Row pins are output and strobe with high.
+ * Key is high or 1 when it turns on.
+ *
+ * col: { PTD1, PTD4, PTD5, PTD6, PTD7 }
+ * row: { PTB2, PTB3, PTB18, PTB19, PTC0, PTC9, PTC10, PTC11, PTD0 }
+ */
+/* matrix state(1:on, 0:off) */
+static matrix_row_t matrix[MATRIX_ROWS];
+static matrix_row_t matrix_debouncing[LOCAL_MATRIX_ROWS];
+static bool debouncing = false;
+static uint16_t debouncing_time = 0;
+
+
+void matrix_init(void)
+{
+ /* Column(sense) */
+ palSetPadMode(GPIOD, 1, PAL_MODE_INPUT_PULLDOWN);
+ palSetPadMode(GPIOD, 4, PAL_MODE_INPUT_PULLDOWN);
+ palSetPadMode(GPIOD, 5, PAL_MODE_INPUT_PULLDOWN);
+ palSetPadMode(GPIOD, 6, PAL_MODE_INPUT_PULLDOWN);
+ palSetPadMode(GPIOD, 7, PAL_MODE_INPUT_PULLDOWN);
+
+ /* Row(strobe) */
+ palSetPadMode(GPIOB, 2, PAL_MODE_OUTPUT_PUSHPULL);
+ palSetPadMode(GPIOB, 3, PAL_MODE_OUTPUT_PUSHPULL);
+ palSetPadMode(GPIOB, 18, PAL_MODE_OUTPUT_PUSHPULL);
+ palSetPadMode(GPIOB, 19, PAL_MODE_OUTPUT_PUSHPULL);
+ palSetPadMode(GPIOC, 0, PAL_MODE_OUTPUT_PUSHPULL);
+ palSetPadMode(GPIOC, 9, PAL_MODE_OUTPUT_PUSHPULL);
+ palSetPadMode(GPIOC, 10, PAL_MODE_OUTPUT_PUSHPULL);
+ palSetPadMode(GPIOC, 11, PAL_MODE_OUTPUT_PUSHPULL);
+ palSetPadMode(GPIOD, 0, PAL_MODE_OUTPUT_PUSHPULL);
+
+ memset(matrix, 0, MATRIX_ROWS);
+ memset(matrix_debouncing, 0, LOCAL_MATRIX_ROWS);
+}
+
+uint8_t matrix_scan(void)
+{
+ for (int row = 0; row < LOCAL_MATRIX_ROWS; row++) {
+ matrix_row_t data = 0;
+
+ // strobe row
+ switch (row) {
+ case 0: palSetPad(GPIOB, 2); break;
+ case 1: palSetPad(GPIOB, 3); break;
+ case 2: palSetPad(GPIOB, 18); break;
+ case 3: palSetPad(GPIOB, 19); break;
+ case 4: palSetPad(GPIOC, 0); break;
+ case 5: palSetPad(GPIOC, 9); break;
+ case 6: palSetPad(GPIOC, 10); break;
+ case 7: palSetPad(GPIOC, 11); break;
+ case 8: palSetPad(GPIOD, 0); break;
+ }
+
+ // need wait to settle pin state
+ // if you wait too short, or have a too high update rate
+ // the keyboard might freeze, or there might not be enough
+ // processing power to update the LCD screen properly.
+ // 20us, or two ticks at 100000Hz seems to be OK
+ wait_us(20);
+
+ // read col data: { PTD1, PTD4, PTD5, PTD6, PTD7 }
+ data = ((palReadPort(GPIOD) & 0xF0) >> 3) |
+ ((palReadPort(GPIOD) & 0x02) >> 1);
+
+ // un-strobe row
+ switch (row) {
+ case 0: palClearPad(GPIOB, 2); break;
+ case 1: palClearPad(GPIOB, 3); break;
+ case 2: palClearPad(GPIOB, 18); break;
+ case 3: palClearPad(GPIOB, 19); break;
+ case 4: palClearPad(GPIOC, 0); break;
+ case 5: palClearPad(GPIOC, 9); break;
+ case 6: palClearPad(GPIOC, 10); break;
+ case 7: palClearPad(GPIOC, 11); break;
+ case 8: palClearPad(GPIOD, 0); break;
+ }
+
+ if (matrix_debouncing[row] != data) {
+ matrix_debouncing[row] = data;
+ debouncing = true;
+ debouncing_time = timer_read();
+ }
+ }
+
+ uint8_t offset = 0;
+#ifdef MASTER_IS_ON_RIGHT
+ if (is_serial_link_master()) {
+ offset = MATRIX_ROWS - LOCAL_MATRIX_ROWS;
+ }
+#endif
+
+ if (debouncing && timer_elapsed(debouncing_time) > DEBOUNCE) {
+ for (int row = 0; row < LOCAL_MATRIX_ROWS; row++) {
+ matrix[offset + row] = matrix_debouncing[row];
+ }
+ debouncing = false;
+ }
+ return 1;
+}
+
+bool matrix_is_on(uint8_t row, uint8_t col)
+{
+ return (matrix[row] & (1<<col));
+}
+
+matrix_row_t matrix_get_row(uint8_t row)
+{
+ return matrix[row];
+}
+
+void matrix_print(void)
+{
+ xprintf("\nr/c 01234567\n");
+ for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
+ xprintf("%X0: ", row);
+ matrix_row_t data = matrix_get_row(row);
+ for (int col = 0; col < MATRIX_COLS; col++) {
+ if (data & (1<<col))
+ xprintf("1");
+ else
+ xprintf("0");
+ }
+ xprintf("\n");
+ }
+}
+
+void matrix_set_remote(matrix_row_t* rows, uint8_t index) {
+ uint8_t offset = 0;
+#ifdef MASTER_IS_ON_RIGHT
+ offset = MATRIX_ROWS - LOCAL_MATRIX_ROWS * (index + 2);
+#else
+ offset = LOCAL_MATRIX_ROWS * (index + 1);
+#endif
+ for (int row = 0; row < LOCAL_MATRIX_ROWS; row++) {
+ matrix[offset + row] = rows[row];
+ }
+}
diff --git a/keyboards/infinity_ergodox/mcuconf.h b/keyboards/infinity_ergodox/mcuconf.h
new file mode 100644
index 0000000000..f6730b99ca
--- /dev/null
+++ b/keyboards/infinity_ergodox/mcuconf.h
@@ -0,0 +1,74 @@
+/*
+ ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+#ifndef _MCUCONF_H_
+#define _MCUCONF_H_
+
+#define K20x_MCUCONF
+
+/*
+ * HAL driver system settings.
+ */
+
+#define K20x7
+
+/* Select the MCU clocking mode below by enabling the appropriate block. */
+
+#define KINETIS_NO_INIT FALSE
+
+/* PEE mode - 48MHz system clock driven by external crystal. */
+#define KINETIS_MCG_MODE KINETIS_MCG_MODE_PEE
+#define KINETIS_PLLCLK_FREQUENCY 72000000UL
+#define KINETIS_SYSCLK_FREQUENCY 72000000UL
+#define KINETIS_BUSCLK_FREQUENCY 36000000UL
+#define KINETIS_FLASHCLK_FREQUENCY 24000000UL
+
+#if 0
+/* FEI mode - 48 MHz with internal 32.768 kHz crystal */
+#define KINETIS_MCG_MODE KINETIS_MCG_MODE_FEI
+#define KINETIS_MCG_FLL_DMX32 1 /* Fine-tune for 32.768 kHz */
+#define KINETIS_MCG_FLL_DRS 1 /* 1464x FLL factor */
+#define KINETIS_SYSCLK_FREQUENCY 47972352UL /* 32.768 kHz * 1464 (~48 MHz) */
+#define KINETIS_CLKDIV1_OUTDIV1 1
+#define KINETIS_CLKDIV1_OUTDIV2 1
+#define KINETIS_CLKDIV1_OUTDIV4 2
+#define KINETIS_BUSCLK_FREQUENCY KINETIS_SYSCLK_FREQUENCY
+#define KINETIS_FLASHCLK_FREQUENCY KINETIS_SYSCLK_FREQUENCY/2
+#endif
+
+/*
+ * SERIAL driver system settings.
+ */
+#define KINETIS_SERIAL_USE_UART0 TRUE
+#define KINETIS_SERIAL_USE_UART1 TRUE
+
+/*
+ * USB driver settings
+ */
+#define KINETIS_USB_USE_USB0 TRUE
+/* Need to redefine this, since the default is for K20x */
+/* This is for Teensy LC; you should comment it out (or change to 5)
+ * for Teensy 3.x */
+#define KINETIS_USB_USB0_IRQ_PRIORITY 2
+
+/*
+ * SPI driver system settings.
+ */
+#define KINETIS_SPI_USE_SPI0 TRUE
+
+#define KINETIS_I2C_USE_I2C0 TRUE
+
+#endif /* _MCUCONF_H_ */
diff --git a/keyboards/lets_split/Makefile b/keyboards/lets_split/Makefile
new file mode 100644
index 0000000000..b9f07636be
--- /dev/null
+++ b/keyboards/lets_split/Makefile
@@ -0,0 +1,78 @@
+SRC += matrix.c \
+ i2c.c \
+ split_util.c \
+ serial.c
+
+# MCU name
+#MCU = at90usb1287
+MCU = atmega32u4
+
+# Processor frequency.
+# This will define a symbol, F_CPU, in all source code files equal to the
+# processor frequency in Hz. You can then use this symbol in your source code to
+# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
+# automatically to create a 32-bit value in your source code.
+#
+# This will be an integer division of F_USB below, as it is sourced by
+# F_USB after it has run through any CPU prescalers. Note that this value
+# does not *change* the processor frequency - it should merely be updated to
+# reflect the processor speed set externally so that the code can use accurate
+# software delays.
+F_CPU = 16000000
+
+#
+# LUFA specific
+#
+# Target architecture (see library "Board Types" documentation).
+ARCH = AVR8
+
+# Input clock frequency.
+# This will define a symbol, F_USB, in all source code files equal to the
+# input clock frequency (before any prescaling is performed) in Hz. This value may
+# differ from F_CPU if prescaling is used on the latter, and is required as the
+# raw input clock is fed directly to the PLL sections of the AVR for high speed
+# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
+# at the end, this will be done automatically to create a 32-bit value in your
+# source code.
+#
+# If no clock division is performed on the input clock inside the AVR (via the
+# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
+F_USB = $(F_CPU)
+
+# Interrupt driven control endpoint task(+60)
+OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
+
+
+# Boot Section Size in *bytes*
+# Teensy halfKay 512
+# Teensy++ halfKay 1024
+# Atmel DFU loader 4096
+# LUFA bootloader 4096
+# USBaspLoader 2048
+OPT_DEFS += -DBOOTLOADER_SIZE=4096
+
+# Build Options
+# change to "no" to disable the options, or define them in the Makefile in
+# the appropriate keymap folder that will get included automatically
+#
+BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000)
+MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
+EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
+CONSOLE_ENABLE ?= no # Console for debug(+400)
+COMMAND_ENABLE ?= yes # Commands for debug and configuration
+NKRO_ENABLE ?= no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
+BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality
+MIDI_ENABLE ?= no # MIDI controls
+AUDIO_ENABLE ?= yes # Audio output on port C6
+UNICODE_ENABLE ?= no # Unicode
+BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
+RGBLIGHT_ENABLE ?= no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
+
+# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
+SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
+
+CUSTOM_MATRIX = yes
+
+ifndef QUANTUM_DIR
+ include ../../Makefile
+endif \ No newline at end of file
diff --git a/keyboards/stm32_f072_onekey/config.h b/keyboards/lets_split/config.h
index bb5251e1de..6f90997ab4 100644
--- a/keyboards/stm32_f072_onekey/config.h
+++ b/keyboards/lets_split/config.h
@@ -1,5 +1,5 @@
/*
-Copyright 2015 Jun Wako <wakojun@gmail.com>
+Copyright 2012 Jun Wako <wakojun@gmail.com>
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
@@ -22,26 +22,41 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* USB Device descriptor parameter */
#define VENDOR_ID 0xFEED
-#define PRODUCT_ID 0x6464
+#define PRODUCT_ID 0x3060
#define DEVICE_VER 0x0001
-/* in python2: list(u"whatever".encode('utf-16-le')) */
-/* at most 32 characters or the ugly hack in usb_main.c borks */
-#define MANUFACTURER "TMK"
-#define USBSTR_MANUFACTURER 'T', '\x00', 'M', '\x00', 'K', '\x00', ' ', '\x00', '\xc6', '\x00'
-#define PRODUCT "ChibiOS TMK test"
-#define USBSTR_PRODUCT 'C', '\x00', 'h', '\x00', 'i', '\x00', 'b', '\x00', 'i', '\x00', 'O', '\x00', 'S', '\x00', ' ', '\x00', 'T', '\x00', 'M', '\x00', 'K', '\x00', ' ', '\x00', 't', '\x00', 'e', '\x00', 's', '\x00', 't', '\x00'
-#define DESCRIPTION "TMK keyboard firmware over ChibiOS"
+#define MANUFACTURER Wootpatoot
+#define PRODUCT Lets Split
+#define DESCRIPTION A split keyboard for the cheap makers
/* key matrix size */
-#define MATRIX_ROWS 1
-#define MATRIX_COLS 1
+// Rows are doubled-up
+#define MATRIX_ROWS 8
+#define MATRIX_COLS 6
+
+// wiring of each half
+#define MATRIX_ROW_PINS { B5, B4, E6, D7 }
+#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3 }
+
+#define CATERINA_BOOTLOADER
+
+// #define USE_I2C
+
+// #define EE_HANDS
+
+#define I2C_MASTER_LEFT
+// #define I2C_MASTER_RIGHT
+
+/* COL2ROW or ROW2COL */
#define DIODE_DIRECTION COL2ROW
/* define if matrix has ghost */
//#define MATRIX_HAS_GHOST
+/* number of backlight levels */
+// #define BACKLIGHT_LEVELS 3
+
/* Set 0 if debouncing isn't needed */
-#define DEBOUNCE 5
+#define DEBOUNCING_DELAY 5
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
#define LOCKING_SUPPORT_ENABLE
@@ -53,7 +68,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
)
-
+/* ws2812 RGB LED */
+#define ws2812_PORTREG PORTD
+#define ws2812_DDRREG DDRD
+#define ws2812_pin PD1
+#define RGBLED_NUM 28 // Number of LEDs
+#define RGBLIGHT_HUE_STEP 10
+#define RGBLIGHT_SAT_STEP 17
+#define RGBLIGHT_VAL_STEP 17
/*
* Feature disable options
@@ -61,10 +83,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* disable debug print */
-//#define NO_DEBUG
+// #define NO_DEBUG
/* disable print */
-//#define NO_PRINT
+// #define NO_PRINT
/* disable action features */
//#define NO_ACTION_LAYER
@@ -73,4 +95,4 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
//#define NO_ACTION_MACRO
//#define NO_ACTION_FUNCTION
-#endif
+#endif \ No newline at end of file
diff --git a/keyboards/lets_split/eeprom-lefthand.eep b/keyboards/lets_split/eeprom-lefthand.eep
new file mode 100644
index 0000000000..a92200b124
--- /dev/null
+++ b/keyboards/lets_split/eeprom-lefthand.eep
@@ -0,0 +1,2 @@
+:080000000000000000000001F7
+:00000001FF
diff --git a/keyboards/lets_split/eeprom-righthand.eep b/keyboards/lets_split/eeprom-righthand.eep
new file mode 100644
index 0000000000..91a6831704
--- /dev/null
+++ b/keyboards/lets_split/eeprom-righthand.eep
@@ -0,0 +1,2 @@
+:080000000000000000000000F8
+:00000001FF
diff --git a/keyboards/lets_split/i2c.c b/keyboards/lets_split/i2c.c
new file mode 100644
index 0000000000..c72789403e
--- /dev/null
+++ b/keyboards/lets_split/i2c.c
@@ -0,0 +1,159 @@
+#include <util/twi.h>
+#include <avr/io.h>
+#include <stdlib.h>
+#include <avr/interrupt.h>
+#include <util/twi.h>
+#include <stdbool.h>
+#include "i2c.h"
+
+// Limits the amount of we wait for any one i2c transaction.
+// Since were running SCL line 100kHz (=> 10μs/bit), and each transactions is
+// 9 bits, a single transaction will take around 90μs to complete.
+//
+// (F_CPU/SCL_CLOCK) => # of μC cycles to transfer a bit
+// poll loop takes at least 8 clock cycles to execute
+#define I2C_LOOP_TIMEOUT (9+1)*(F_CPU/SCL_CLOCK)/8
+
+#define BUFFER_POS_INC() (slave_buffer_pos = (slave_buffer_pos+1)%SLAVE_BUFFER_SIZE)
+
+volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE];
+
+static volatile uint8_t slave_buffer_pos;
+static volatile bool slave_has_register_set = false;
+
+// Wait for an i2c operation to finish
+inline static
+void i2c_delay(void) {
+ uint16_t lim = 0;
+ while(!(TWCR & (1<<TWINT)) && lim < I2C_LOOP_TIMEOUT)
+ lim++;
+
+ // easier way, but will wait slightly longer
+ // _delay_us(100);
+}
+
+// Setup twi to run at 100kHz
+void i2c_master_init(void) {
+ // no prescaler
+ TWSR = 0;
+ // Set TWI clock frequency to SCL_CLOCK. Need TWBR>10.
+ // Check datasheets for more info.
+ TWBR = ((F_CPU/SCL_CLOCK)-16)/2;
+}
+
+// Start a transaction with the given i2c slave address. The direction of the
+// transfer is set with I2C_READ and I2C_WRITE.
+// returns: 0 => success
+// 1 => error
+uint8_t i2c_master_start(uint8_t address) {
+ TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWSTA);
+
+ i2c_delay();
+
+ // check that we started successfully
+ if ( (TW_STATUS != TW_START) && (TW_STATUS != TW_REP_START))
+ return 1;
+
+ TWDR = address;
+ TWCR = (1<<TWINT) | (1<<TWEN);
+
+ i2c_delay();
+
+ if ( (TW_STATUS != TW_MT_SLA_ACK) && (TW_STATUS != TW_MR_SLA_ACK) )
+ return 1; // slave did not acknowledge
+ else
+ return 0; // success
+}
+
+
+// Finish the i2c transaction.
+void i2c_master_stop(void) {
+ TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWSTO);
+
+ uint16_t lim = 0;
+ while(!(TWCR & (1<<TWSTO)) && lim < I2C_LOOP_TIMEOUT)
+ lim++;
+}
+
+// Write one byte to the i2c slave.
+// returns 0 => slave ACK
+// 1 => slave NACK
+uint8_t i2c_master_write(uint8_t data) {
+ TWDR = data;
+ TWCR = (1<<TWINT) | (1<<TWEN);
+
+ i2c_delay();
+
+ // check if the slave acknowledged us
+ return (TW_STATUS == TW_MT_DATA_ACK) ? 0 : 1;
+}
+
+// Read one byte from the i2c slave. If ack=1 the slave is acknowledged,
+// if ack=0 the acknowledge bit is not set.
+// returns: byte read from i2c device
+uint8_t i2c_master_read(int ack) {
+ TWCR = (1<<TWINT) | (1<<TWEN) | (ack<<TWEA);
+
+ i2c_delay();
+ return TWDR;
+}
+
+void i2c_reset_state(void) {
+ TWCR = 0;
+}
+
+void i2c_slave_init(uint8_t address) {
+ TWAR = address << 0; // slave i2c address
+ // TWEN - twi enable
+ // TWEA - enable address acknowledgement
+ // TWINT - twi interrupt flag
+ // TWIE - enable the twi interrupt
+ TWCR = (1<<TWIE) | (1<<TWEA) | (1<<TWINT) | (1<<TWEN);
+}
+
+ISR(TWI_vect);
+
+ISR(TWI_vect) {
+ uint8_t ack = 1;
+ switch(TW_STATUS) {
+ case TW_SR_SLA_ACK:
+ // this device has been addressed as a slave receiver
+ slave_has_register_set = false;
+ break;
+
+ case TW_SR_DATA_ACK:
+ // this device has received data as a slave receiver
+ // The first byte that we receive in this transaction sets the location
+ // of the read/write location of the slaves memory that it exposes over
+ // i2c. After that, bytes will be written at slave_buffer_pos, incrementing
+ // slave_buffer_pos after each write.
+ if(!slave_has_register_set) {
+ slave_buffer_pos = TWDR;
+ // don't acknowledge the master if this memory loctaion is out of bounds
+ if ( slave_buffer_pos >= SLAVE_BUFFER_SIZE ) {
+ ack = 0;
+ slave_buffer_pos = 0;
+ }
+ slave_has_register_set = true;
+ } else {
+ i2c_slave_buffer[slave_buffer_pos] = TWDR;
+ BUFFER_POS_INC();
+ }
+ break;
+
+ case TW_ST_SLA_ACK:
+ case TW_ST_DATA_ACK:
+ // master has addressed this device as a slave transmitter and is
+ // requesting data.
+ TWDR = i2c_slave_buffer[slave_buffer_pos];
+ BUFFER_POS_INC();
+ break;
+
+ case TW_BUS_ERROR: // something went wrong, reset twi state
+ TWCR = 0;
+ default:
+ break;
+ }
+ // Reset everything, so we are ready for the next TWI interrupt
+ TWCR |= (1<<TWIE) | (1<<TWINT) | (ack<<TWEA) | (1<<TWEN);
+}
diff --git a/keyboards/lets_split/i2c.h b/keyboards/lets_split/i2c.h
new file mode 100644
index 0000000000..08ce4b0093
--- /dev/null
+++ b/keyboards/lets_split/i2c.h
@@ -0,0 +1,31 @@
+#ifndef I2C_H
+#define I2C_H
+
+#include <stdint.h>
+
+#ifndef F_CPU
+#define F_CPU 16000000UL
+#endif
+
+#define I2C_READ 1
+#define I2C_WRITE 0
+
+#define I2C_ACK 1
+#define I2C_NACK 0
+
+#define SLAVE_BUFFER_SIZE 0x10
+
+// i2c SCL clock frequency
+#define SCL_CLOCK 100000L
+
+extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE];
+
+void i2c_master_init(void);
+uint8_t i2c_master_start(uint8_t address);
+void i2c_master_stop(void);
+uint8_t i2c_master_write(uint8_t data);
+uint8_t i2c_master_read(int);
+void i2c_reset_state(void);
+void i2c_slave_init(uint8_t address);
+
+#endif
diff --git a/keyboards/lets_split/imgs/split-keyboard-i2c-schematic.png b/keyboards/lets_split/imgs/split-keyboard-i2c-schematic.png
new file mode 100644
index 0000000000..8882947187
--- /dev/null
+++ b/keyboards/lets_split/imgs/split-keyboard-i2c-schematic.png
Binary files differ
diff --git a/keyboards/lets_split/imgs/split-keyboard-serial-schematic.png b/keyboards/lets_split/imgs/split-keyboard-serial-schematic.png
new file mode 100644
index 0000000000..7621d38ed9
--- /dev/null
+++ b/keyboards/lets_split/imgs/split-keyboard-serial-schematic.png
Binary files differ
diff --git a/keyboards/lets_split/keymaps/default/keymap.c b/keyboards/lets_split/keymaps/default/keymap.c
new file mode 100644
index 0000000000..0d2d94b672
--- /dev/null
+++ b/keyboards/lets_split/keymaps/default/keymap.c
@@ -0,0 +1,214 @@
+#include "lets_split.h"
+#include "action_layer.h"
+#include "eeconfig.h"
+
+extern keymap_config_t keymap_config;
+
+// Each layer gets a name for readability, which is then used in the keymap matrix below.
+// The underscores don't mean anything - you can have a layer called STUFF or any other name.
+// Layer names don't all need to be of the same length, obviously, and you can also skip them
+// entirely and just use numbers.
+#define _QWERTY 0
+#define _COLEMAK 1
+#define _DVORAK 2
+#define _LOWER 3
+#define _RAISE 4
+#define _ADJUST 16
+
+enum custom_keycodes {
+ QWERTY = SAFE_RANGE,
+ COLEMAK,
+ DVORAK,
+ LOWER,
+ RAISE,
+ ADJUST,
+};
+
+// Fillers to make layering more clear
+#define _______ KC_TRNS
+#define XXXXXXX KC_NO
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+
+/* Qwerty
+ * ,-----------------------------------------------------------------------------------.
+ * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | Esc | A | S | D | F | G | H | J | K | L | ; | " |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_QWERTY] = KEYMAP( \
+ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \
+ KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \
+ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \
+ ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
+),
+
+/* Colemak
+ * ,-----------------------------------------------------------------------------------.
+ * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | Esc | A | R | S | T | D | H | N | E | I | O | " |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_COLEMAK] = KEYMAP( \
+ KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \
+ KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \
+ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \
+ ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
+),
+
+/* Dvorak
+ * ,-----------------------------------------------------------------------------------.
+ * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | Esc | A | O | E | U | I | D | H | T | N | S | / |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_DVORAK] = KEYMAP( \
+ KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \
+ KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \
+ KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \
+ ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
+),
+
+/* Lower
+ * ,-----------------------------------------------------------------------------------.
+ * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | | \ | | |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | | | | | | | | Next | Vol- | Vol+ | Play |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_LOWER] = KEYMAP( \
+ KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \
+ KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \
+ _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______, \
+ _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \
+),
+
+/* Raise
+ * ,-----------------------------------------------------------------------------------.
+ * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | | | | | | | | Next | Vol- | Vol+ | Play |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_RAISE] = KEYMAP( \
+ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \
+ KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \
+ _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \
+ _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \
+),
+
+/* Adjust (Lower + Raise)
+ * ,-----------------------------------------------------------------------------------.
+ * | | Reset| | | | | | | | | | Del |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | | | | | | | | | | | | |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | | | | | | | | | | | |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_ADJUST] = KEYMAP( \
+ _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \
+ _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
+)
+
+
+};
+
+#ifdef AUDIO_ENABLE
+float tone_qwerty[][2] = SONG(QWERTY_SOUND);
+float tone_dvorak[][2] = SONG(DVORAK_SOUND);
+float tone_colemak[][2] = SONG(COLEMAK_SOUND);
+#endif
+
+void persistant_default_layer_set(uint16_t default_layer) {
+ eeconfig_update_default_layer(default_layer);
+ default_layer_set(default_layer);
+}
+
+bool process_record_user(uint16_t keycode, keyrecord_t *record) {
+ switch (keycode) {
+ case QWERTY:
+ if (record->event.pressed) {
+ #ifdef AUDIO_ENABLE
+ PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
+ #endif
+ persistant_default_layer_set(1UL<<_QWERTY);
+ }
+ return false;
+ break;
+ case COLEMAK:
+ if (record->event.pressed) {
+ #ifdef AUDIO_ENABLE
+ PLAY_NOTE_ARRAY(tone_colemak, false, 0);
+ #endif
+ persistant_default_layer_set(1UL<<_COLEMAK);
+ }
+ return false;
+ break;
+ case DVORAK:
+ if (record->event.pressed) {
+ #ifdef AUDIO_ENABLE
+ PLAY_NOTE_ARRAY(tone_dvorak, false, 0);
+ #endif
+ persistant_default_layer_set(1UL<<_DVORAK);
+ }
+ return false;
+ break;
+ case LOWER:
+ if (record->event.pressed) {
+ layer_on(_LOWER);
+ update_tri_layer(_LOWER, _RAISE, _ADJUST);
+ } else {
+ layer_off(_LOWER);
+ update_tri_layer(_LOWER, _RAISE, _ADJUST);
+ }
+ return false;
+ break;
+ case RAISE:
+ if (record->event.pressed) {
+ layer_on(_RAISE);
+ update_tri_layer(_LOWER, _RAISE, _ADJUST);
+ } else {
+ layer_off(_RAISE);
+ update_tri_layer(_LOWER, _RAISE, _ADJUST);
+ }
+ return false;
+ break;
+ case ADJUST:
+ if (record->event.pressed) {
+ layer_on(_ADJUST);
+ } else {
+ layer_off(_ADJUST);
+ }
+ return false;
+ break;
+ }
+ return true;
+} \ No newline at end of file
diff --git a/keyboards/lets_split/lets_split.c b/keyboards/lets_split/lets_split.c
new file mode 100644
index 0000000000..574c116a75
--- /dev/null
+++ b/keyboards/lets_split/lets_split.c
@@ -0,0 +1,30 @@
+#include "lets_split.h"
+
+#ifdef AUDIO_ENABLE
+ float tone_startup[][2] = SONG(STARTUP_SOUND);
+ float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
+#endif
+
+void matrix_init_kb(void) {
+
+ #ifdef AUDIO_ENABLE
+ _delay_ms(20); // gets rid of tick
+ PLAY_NOTE_ARRAY(tone_startup, false, 0);
+ #endif
+
+ // // green led on
+ // DDRD |= (1<<5);
+ // PORTD &= ~(1<<5);
+
+ // // orange led on
+ // DDRB |= (1<<0);
+ // PORTB &= ~(1<<0);
+
+ matrix_init_user();
+};
+
+void shutdown_user(void) {
+ PLAY_NOTE_ARRAY(tone_goodbye, false, 0);
+ _delay_ms(150);
+ stop_all_notes();
+}
diff --git a/keyboards/lets_split/lets_split.h b/keyboards/lets_split/lets_split.h
new file mode 100644
index 0000000000..fe7ae07679
--- /dev/null
+++ b/keyboards/lets_split/lets_split.h
@@ -0,0 +1,25 @@
+#ifndef LETS_SPLIT_H
+#define LETS_SPLIT_H
+
+#include "quantum.h"
+
+void promicro_bootloader_jmp(bool program);
+
+#define KEYMAP( \
+ k00, k01, k02, k03, k04, k05, k40, k41, k42, k43, k44, k45, \
+ k10, k11, k12, k13, k14, k15, k50, k51, k52, k53, k54, k55, \
+ k20, k21, k22, k23, k24, k25, k60, k61, k62, k63, k64, k65, \
+ k30, k31, k32, k33, k34, k35, k70, k71, k72, k73, k74, k75 \
+ ) \
+ { \
+ { k00, k01, k02, k03, k04, k05 }, \
+ { k10, k11, k12, k13, k14, k15 }, \
+ { k20, k21, k22, k23, k24, k25 }, \
+ { k30, k31, k32, k33, k34, k35 }, \
+ { k40, k41, k42, k43, k44, k45 }, \
+ { k50, k51, k52, k53, k54, k55 }, \
+ { k60, k61, k62, k63, k64, k65 }, \
+ { k70, k71, k72, k73, k74, k75 } \
+ }
+
+#endif \ No newline at end of file
diff --git a/keyboards/lets_split/matrix.c b/keyboards/lets_split/matrix.c
new file mode 100644
index 0000000000..1d768c59b3
--- /dev/null
+++ b/keyboards/lets_split/matrix.c
@@ -0,0 +1,311 @@
+/*
+Copyright 2012 Jun Wako <wakojun@gmail.com>
+
+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/>.
+*/
+
+/*
+ * scan matrix
+ */
+#include <stdint.h>
+#include <stdbool.h>
+#include <avr/io.h>
+#include <avr/wdt.h>
+#include <avr/interrupt.h>
+#include <util/delay.h>
+#include "print.h"
+#include "debug.h"
+#include "util.h"
+#include "matrix.h"
+#include "i2c.h"
+#include "serial.h"
+#include "split_util.h"
+#include "pro_micro.h"
+#include "config.h"
+
+#ifndef DEBOUNCE
+# define DEBOUNCE 5
+#endif
+
+#define ERROR_DISCONNECT_COUNT 5
+
+static uint8_t debouncing = DEBOUNCE;
+static const int ROWS_PER_HAND = MATRIX_ROWS/2;
+static uint8_t error_count = 0;
+
+static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS;
+static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
+
+/* matrix state(1:on, 0:off) */
+static matrix_row_t matrix[MATRIX_ROWS];
+static matrix_row_t matrix_debouncing[MATRIX_ROWS];
+
+static matrix_row_t read_cols(void);
+static void init_cols(void);
+static void unselect_rows(void);
+static void select_row(uint8_t row);
+
+__attribute__ ((weak))
+void matrix_init_quantum(void) {
+ matrix_init_kb();
+}
+
+__attribute__ ((weak))
+void matrix_scan_quantum(void) {
+ matrix_scan_kb();
+}
+
+__attribute__ ((weak))
+void matrix_init_kb(void) {
+ matrix_init_user();
+}
+
+__attribute__ ((weak))
+void matrix_scan_kb(void) {
+ matrix_scan_user();
+}
+
+__attribute__ ((weak))
+void matrix_init_user(void) {
+}
+
+__attribute__ ((weak))
+void matrix_scan_user(void) {
+}
+
+inline
+uint8_t matrix_rows(void)
+{
+ return MATRIX_ROWS;
+}
+
+inline
+uint8_t matrix_cols(void)
+{
+ return MATRIX_COLS;
+}
+
+void matrix_init(void)
+{
+ debug_enable = true;
+ debug_matrix = true;
+ debug_mouse = true;
+ // initialize row and col
+ unselect_rows();
+ init_cols();
+
+ TX_RX_LED_INIT;
+
+ // initialize matrix state: all keys off
+ for (uint8_t i=0; i < MATRIX_ROWS; i++) {
+ matrix[i] = 0;
+ matrix_debouncing[i] = 0;
+ }
+
+ matrix_init_quantum();
+}
+
+uint8_t _matrix_scan(void)
+{
+ // Right hand is stored after the left in the matirx so, we need to offset it
+ int offset = isLeftHand ? 0 : (ROWS_PER_HAND);
+
+ for (uint8_t i = 0; i < ROWS_PER_HAND; i++) {
+ select_row(i);
+ _delay_us(30); // without this wait read unstable value.
+ matrix_row_t cols = read_cols();
+ if (matrix_debouncing[i+offset] != cols) {
+ matrix_debouncing[i+offset] = cols;
+ debouncing = DEBOUNCE;
+ }
+ unselect_rows();
+ }
+
+ if (debouncing) {
+ if (--debouncing) {
+ _delay_ms(1);
+ } else {
+ for (uint8_t i = 0; i < ROWS_PER_HAND; i++) {
+ matrix[i+offset] = matrix_debouncing[i+offset];
+ }
+ }
+ }
+
+ return 1;
+}
+
+// Get rows from other half over i2c
+int i2c_transaction(void) {
+ int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0;
+
+ int err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE);
+ if (err) goto i2c_error;
+
+ // start of matrix stored at 0x00
+ err = i2c_master_write(0x00);
+ if (err) goto i2c_error;
+
+ // Start read
+ err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ);
+ if (err) goto i2c_error;
+
+ if (!err) {
+ int i;
+ for (i = 0; i < ROWS_PER_HAND-1; ++i) {
+ matrix[slaveOffset+i] = i2c_master_read(I2C_ACK);
+ }
+ matrix[slaveOffset+i] = i2c_master_read(I2C_NACK);
+ i2c_master_stop();
+ } else {
+i2c_error: // the cable is disconnceted, or something else went wrong
+ i2c_reset_state();
+ return err;
+ }
+
+ return 0;
+}
+
+#ifndef USE_I2C
+int serial_transaction(void) {
+ int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0;
+
+ if (serial_update_buffers()) {
+ return 1;
+ }
+
+ for (int i = 0; i < ROWS_PER_HAND; ++i) {
+ matrix[slaveOffset+i] = serial_slave_buffer[i];
+ }
+ return 0;
+}
+#endif
+
+uint8_t matrix_scan(void)
+{
+ int ret = _matrix_scan();
+
+
+
+#ifdef USE_I2C
+ if( i2c_transaction() ) {
+#else
+ if( serial_transaction() ) {
+#endif
+ // turn on the indicator led when halves are disconnected
+ TXLED1;
+
+ error_count++;
+
+ if (error_count > ERROR_DISCONNECT_COUNT) {
+ // reset other half if disconnected
+ int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0;
+ for (int i = 0; i < ROWS_PER_HAND; ++i) {
+ matrix[slaveOffset+i] = 0;
+ }
+ }
+ } else {
+ // turn off the indicator led on no error
+ TXLED0;
+ error_count = 0;
+ }
+
+ matrix_scan_quantum();
+
+ return ret;
+}
+
+void matrix_slave_scan(void) {
+ _matrix_scan();
+
+ int offset = (isLeftHand) ? 0 : (MATRIX_ROWS / 2);
+
+#ifdef USE_I2C
+ for (int i = 0; i < ROWS_PER_HAND; ++i) {
+ /* i2c_slave_buffer[i] = matrix[offset+i]; */
+ i2c_slave_buffer[i] = matrix[offset+i];
+ }
+#else
+ for (int i = 0; i < ROWS_PER_HAND; ++i) {
+ serial_slave_buffer[i] = matrix[offset+i];
+ }
+#endif
+}
+
+bool matrix_is_modified(void)
+{
+ if (debouncing) return false;
+ return true;
+}
+
+inline
+bool matrix_is_on(uint8_t row, uint8_t col)
+{
+ return (matrix[row] & ((matrix_row_t)1<<col));
+}
+
+inline
+matrix_row_t matrix_get_row(uint8_t row)
+{
+ return matrix[row];
+}
+
+void matrix_print(void)
+{
+ print("\nr/c 0123456789ABCDEF\n");
+ for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
+ phex(row); print(": ");
+ pbin_reverse16(matrix_get_row(row));
+ print("\n");
+ }
+}
+
+uint8_t matrix_key_count(void)
+{
+ uint8_t count = 0;
+ for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
+ count += bitpop16(matrix[i]);
+ }
+ return count;
+}
+
+static void init_cols(void)
+{
+ for(int x = 0; x < MATRIX_COLS; x++) {
+ _SFR_IO8((col_pins[x] >> 4) + 1) &= ~_BV(col_pins[x] & 0xF);
+ _SFR_IO8((col_pins[x] >> 4) + 2) |= _BV(col_pins[x] & 0xF);
+ }
+}
+
+static matrix_row_t read_cols(void)
+{
+ matrix_row_t result = 0;
+ for(int x = 0; x < MATRIX_COLS; x++) {
+ result |= (_SFR_IO8(col_pins[x] >> 4) & _BV(col_pins[x] & 0xF)) ? 0 : (1 << x);
+ }
+ return result;
+}
+
+static void unselect_rows(void)
+{
+ for(int x = 0; x < ROWS_PER_HAND; x++) {
+ _SFR_IO8((row_pins[x] >> 4) + 1) &= ~_BV(row_pins[x] & 0xF);
+ _SFR_IO8((row_pins[x] >> 4) + 2) |= _BV(row_pins[x] & 0xF);
+ }
+}
+
+static void select_row(uint8_t row)
+{
+ _SFR_IO8((row_pins[row] >> 4) + 1) |= _BV(row_pins[row] & 0xF);
+ _SFR_IO8((row_pins[row] >> 4) + 2) &= ~_BV(row_pins[row] & 0xF);
+}
diff --git a/keyboards/lets_split/pro_micro.h b/keyboards/lets_split/pro_micro.h
new file mode 100644
index 0000000000..09e219b7b1
--- /dev/null
+++ b/keyboards/lets_split/pro_micro.h
@@ -0,0 +1,362 @@
+/*
+ pins_arduino.h - Pin definition functions for Arduino
+ Part of Arduino - http://www.arduino.cc/
+
+ Copyright (c) 2007 David A. Mellis
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General
+ Public License along with this library; if not, write to the
+ Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ Boston, MA 02111-1307 USA
+
+ $Id: wiring.h 249 2007-02-03 16:52:51Z mellis $
+*/
+
+#ifndef Pins_Arduino_h
+#define Pins_Arduino_h
+
+#include <avr/pgmspace.h>
+
+// Workaround for wrong definitions in "iom32u4.h".
+// This should be fixed in the AVR toolchain.
+#undef UHCON
+#undef UHINT
+#undef UHIEN
+#undef UHADDR
+#undef UHFNUM
+#undef UHFNUML
+#undef UHFNUMH
+#undef UHFLEN
+#undef UPINRQX
+#undef UPINTX
+#undef UPNUM
+#undef UPRST
+#undef UPCONX
+#undef UPCFG0X
+#undef UPCFG1X
+#undef UPSTAX
+#undef UPCFG2X
+#undef UPIENX
+#undef UPDATX
+#undef TCCR2A
+#undef WGM20
+#undef WGM21
+#undef COM2B0
+#undef COM2B1
+#undef COM2A0
+#undef COM2A1
+#undef TCCR2B
+#undef CS20
+#undef CS21
+#undef CS22
+#undef WGM22
+#undef FOC2B
+#undef FOC2A
+#undef TCNT2
+#undef TCNT2_0
+#undef TCNT2_1
+#undef TCNT2_2
+#undef TCNT2_3
+#undef TCNT2_4
+#undef TCNT2_5
+#undef TCNT2_6
+#undef TCNT2_7
+#undef OCR2A
+#undef OCR2_0
+#undef OCR2_1
+#undef OCR2_2
+#undef OCR2_3
+#undef OCR2_4
+#undef OCR2_5
+#undef OCR2_6
+#undef OCR2_7
+#undef OCR2B
+#undef OCR2_0
+#undef OCR2_1
+#undef OCR2_2
+#undef OCR2_3
+#undef OCR2_4
+#undef OCR2_5
+#undef OCR2_6
+#undef OCR2_7
+
+#define NUM_DIGITAL_PINS 30
+#define NUM_ANALOG_INPUTS 12
+
+#define TX_RX_LED_INIT DDRD |= (1<<5), DDRB |= (1<<0)
+#define TXLED0 PORTD |= (1<<5)
+#define TXLED1 PORTD &= ~(1<<5)
+#define RXLED0 PORTB |= (1<<0)
+#define RXLED1 PORTB &= ~(1<<0)
+
+static const uint8_t SDA = 2;
+static const uint8_t SCL = 3;
+#define LED_BUILTIN 13
+
+// Map SPI port to 'new' pins D14..D17
+static const uint8_t SS = 17;
+static const uint8_t MOSI = 16;
+static const uint8_t MISO = 14;
+static const uint8_t SCK = 15;
+
+// Mapping of analog pins as digital I/O
+// A6-A11 share with digital pins
+static const uint8_t A0 = 18;
+static const uint8_t A1 = 19;
+static const uint8_t A2 = 20;
+static const uint8_t A3 = 21;
+static const uint8_t A4 = 22;
+static const uint8_t A5 = 23;
+static const uint8_t A6 = 24; // D4
+static const uint8_t A7 = 25; // D6
+static const uint8_t A8 = 26; // D8
+static const uint8_t A9 = 27; // D9
+static const uint8_t A10 = 28; // D10
+static const uint8_t A11 = 29; // D12
+
+#define digitalPinToPCICR(p) ((((p) >= 8 && (p) <= 11) || ((p) >= 14 && (p) <= 17) || ((p) >= A8 && (p) <= A10)) ? (&PCICR) : ((uint8_t *)0))
+#define digitalPinToPCICRbit(p) 0
+#define digitalPinToPCMSK(p) ((((p) >= 8 && (p) <= 11) || ((p) >= 14 && (p) <= 17) || ((p) >= A8 && (p) <= A10)) ? (&PCMSK0) : ((uint8_t *)0))
+#define digitalPinToPCMSKbit(p) ( ((p) >= 8 && (p) <= 11) ? (p) - 4 : ((p) == 14 ? 3 : ((p) == 15 ? 1 : ((p) == 16 ? 2 : ((p) == 17 ? 0 : (p - A8 + 4))))))
+
+// __AVR_ATmega32U4__ has an unusual mapping of pins to channels
+extern const uint8_t PROGMEM analog_pin_to_channel_PGM[];
+#define analogPinToChannel(P) ( pgm_read_byte( analog_pin_to_channel_PGM + (P) ) )
+
+#define digitalPinToInterrupt(p) ((p) == 0 ? 2 : ((p) == 1 ? 3 : ((p) == 2 ? 1 : ((p) == 3 ? 0 : ((p) == 7 ? 4 : NOT_AN_INTERRUPT)))))
+
+#ifdef ARDUINO_MAIN
+
+// On the Arduino board, digital pins are also used
+// for the analog output (software PWM). Analog input
+// pins are a separate set.
+
+// ATMEL ATMEGA32U4 / ARDUINO LEONARDO
+//
+// D0 PD2 RXD1/INT2
+// D1 PD3 TXD1/INT3
+// D2 PD1 SDA SDA/INT1
+// D3# PD0 PWM8/SCL OC0B/SCL/INT0
+// D4 A6 PD4 ADC8
+// D5# PC6 ??? OC3A/#OC4A
+// D6# A7 PD7 FastPWM #OC4D/ADC10
+// D7 PE6 INT6/AIN0
+//
+// D8 A8 PB4 ADC11/PCINT4
+// D9# A9 PB5 PWM16 OC1A/#OC4B/ADC12/PCINT5
+// D10# A10 PB6 PWM16 OC1B/0c4B/ADC13/PCINT6
+// D11# PB7 PWM8/16 0C0A/OC1C/#RTS/PCINT7
+// D12 A11 PD6 T1/#OC4D/ADC9
+// D13# PC7 PWM10 CLK0/OC4A
+//
+// A0 D18 PF7 ADC7
+// A1 D19 PF6 ADC6
+// A2 D20 PF5 ADC5
+// A3 D21 PF4 ADC4
+// A4 D22 PF1 ADC1
+// A5 D23 PF0 ADC0
+//
+// New pins D14..D17 to map SPI port to digital pins
+//
+// MISO D14 PB3 MISO,PCINT3
+// SCK D15 PB1 SCK,PCINT1
+// MOSI D16 PB2 MOSI,PCINT2
+// SS D17 PB0 RXLED,SS/PCINT0
+//
+// Connected LEDs on board for TX and RX
+// TXLED D24 PD5 XCK1
+// RXLED D17 PB0
+// HWB PE2 HWB
+
+// these arrays map port names (e.g. port B) to the
+// appropriate addresses for various functions (e.g. reading
+// and writing)
+const uint16_t PROGMEM port_to_mode_PGM[] = {
+ NOT_A_PORT,
+ NOT_A_PORT,
+ (uint16_t) &DDRB,
+ (uint16_t) &DDRC,
+ (uint16_t) &DDRD,
+ (uint16_t) &DDRE,
+ (uint16_t) &DDRF,
+};
+
+const uint16_t PROGMEM port_to_output_PGM[] = {
+ NOT_A_PORT,
+ NOT_A_PORT,
+ (uint16_t) &PORTB,
+ (uint16_t) &PORTC,
+ (uint16_t) &PORTD,
+ (uint16_t) &PORTE,
+ (uint16_t) &PORTF,
+};
+
+const uint16_t PROGMEM port_to_input_PGM[] = {
+ NOT_A_PORT,
+ NOT_A_PORT,
+ (uint16_t) &PINB,
+ (uint16_t) &PINC,
+ (uint16_t) &PIND,
+ (uint16_t) &PINE,
+ (uint16_t) &PINF,
+};
+
+const uint8_t PROGMEM digital_pin_to_port_PGM[] = {
+ PD, // D0 - PD2
+ PD, // D1 - PD3
+ PD, // D2 - PD1
+ PD, // D3 - PD0
+ PD, // D4 - PD4
+ PC, // D5 - PC6
+ PD, // D6 - PD7
+ PE, // D7 - PE6
+
+ PB, // D8 - PB4
+ PB, // D9 - PB5
+ PB, // D10 - PB6
+ PB, // D11 - PB7
+ PD, // D12 - PD6
+ PC, // D13 - PC7
+
+ PB, // D14 - MISO - PB3
+ PB, // D15 - SCK - PB1
+ PB, // D16 - MOSI - PB2
+ PB, // D17 - SS - PB0
+
+ PF, // D18 - A0 - PF7
+ PF, // D19 - A1 - PF6
+ PF, // D20 - A2 - PF5
+ PF, // D21 - A3 - PF4
+ PF, // D22 - A4 - PF1
+ PF, // D23 - A5 - PF0
+
+ PD, // D24 - PD5
+ PD, // D25 / D6 - A7 - PD7
+ PB, // D26 / D8 - A8 - PB4
+ PB, // D27 / D9 - A9 - PB5
+ PB, // D28 / D10 - A10 - PB6
+ PD, // D29 / D12 - A11 - PD6
+};
+
+const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[] = {
+ _BV(2), // D0 - PD2
+ _BV(3), // D1 - PD3
+ _BV(1), // D2 - PD1
+ _BV(0), // D3 - PD0
+ _BV(4), // D4 - PD4
+ _BV(6), // D5 - PC6
+ _BV(7), // D6 - PD7
+ _BV(6), // D7 - PE6
+
+ _BV(4), // D8 - PB4
+ _BV(5), // D9 - PB5
+ _BV(6), // D10 - PB6
+ _BV(7), // D11 - PB7
+ _BV(6), // D12 - PD6
+ _BV(7), // D13 - PC7
+
+ _BV(3), // D14 - MISO - PB3
+ _BV(1), // D15 - SCK - PB1
+ _BV(2), // D16 - MOSI - PB2
+ _BV(0), // D17 - SS - PB0
+
+ _BV(7), // D18 - A0 - PF7
+ _BV(6), // D19 - A1 - PF6
+ _BV(5), // D20 - A2 - PF5
+ _BV(4), // D21 - A3 - PF4
+ _BV(1), // D22 - A4 - PF1
+ _BV(0), // D23 - A5 - PF0
+
+ _BV(5), // D24 - PD5
+ _BV(7), // D25 / D6 - A7 - PD7
+ _BV(4), // D26 / D8 - A8 - PB4
+ _BV(5), // D27 / D9 - A9 - PB5
+ _BV(6), // D28 / D10 - A10 - PB6
+ _BV(6), // D29 / D12 - A11 - PD6
+};
+
+const uint8_t PROGMEM digital_pin_to_timer_PGM[] = {
+ NOT_ON_TIMER,
+ NOT_ON_TIMER,
+ NOT_ON_TIMER,
+ TIMER0B, /* 3 */
+ NOT_ON_TIMER,
+ TIMER3A, /* 5 */
+ TIMER4D, /* 6 */
+ NOT_ON_TIMER,
+
+ NOT_ON_TIMER,
+ TIMER1A, /* 9 */
+ TIMER1B, /* 10 */
+ TIMER0A, /* 11 */
+
+ NOT_ON_TIMER,
+ TIMER4A, /* 13 */
+
+ NOT_ON_TIMER,
+ NOT_ON_TIMER,
+ NOT_ON_TIMER,
+ NOT_ON_TIMER,
+ NOT_ON_TIMER,
+ NOT_ON_TIMER,
+
+ NOT_ON_TIMER,
+ NOT_ON_TIMER,
+ NOT_ON_TIMER,
+ NOT_ON_TIMER,
+ NOT_ON_TIMER,
+ NOT_ON_TIMER,
+ NOT_ON_TIMER,
+ NOT_ON_TIMER,
+ NOT_ON_TIMER,
+ NOT_ON_TIMER,
+};
+
+const uint8_t PROGMEM analog_pin_to_channel_PGM[] = {
+ 7, // A0 PF7 ADC7
+ 6, // A1 PF6 ADC6
+ 5, // A2 PF5 ADC5
+ 4, // A3 PF4 ADC4
+ 1, // A4 PF1 ADC1
+ 0, // A5 PF0 ADC0
+ 8, // A6 D4 PD4 ADC8
+ 10, // A7 D6 PD7 ADC10
+ 11, // A8 D8 PB4 ADC11
+ 12, // A9 D9 PB5 ADC12
+ 13, // A10 D10 PB6 ADC13
+ 9 // A11 D12 PD6 ADC9
+};
+
+#endif /* ARDUINO_MAIN */
+
+// These serial port names are intended to allow libraries and architecture-neutral
+// sketches to automatically default to the correct port name for a particular type
+// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
+// the first hardware serial port whose RX/TX pins are not dedicated to another use.
+//
+// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor
+//
+// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
+//
+// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
+//
+// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins.
+//
+// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
+// pins are NOT connected to anything by default.
+#define SERIAL_PORT_MONITOR Serial
+#define SERIAL_PORT_USBVIRTUAL Serial
+#define SERIAL_PORT_HARDWARE Serial1
+#define SERIAL_PORT_HARDWARE_OPEN Serial1
+
+#endif /* Pins_Arduino_h */
diff --git a/keyboards/lets_split/readme.md b/keyboards/lets_split/readme.md
new file mode 100644
index 0000000000..73fdb0f789
--- /dev/null
+++ b/keyboards/lets_split/readme.md
@@ -0,0 +1,102 @@
+Let's Split
+======
+
+This readme and most of the code are from https://github.com/ahtn/tmk_keyboard/
+
+Split keyboard firmware for Arduino Pro Micro or other ATmega32u4
+based boards.
+
+Features
+--------
+
+Some features supported by the firmware:
+
+* Either half can connect to the computer via USB, or both halves can be used
+ independently.
+* You only need 3 wires to connect the two halves. Two for VCC and GND and one
+ for serial communication.
+* Optional support for I2C connection between the two halves if for some
+ reason you require a faster connection between the two halves. Note this
+ requires an extra wire between halves and pull-up resistors on the data lines.
+
+Required Hardware
+-----------------
+
+Apart from diodes and key switches for the keyboard matrix in each half, you
+will need:
+
+* 2 Arduino Pro Micro's. You can find theses on aliexpress for ≈3.50USD each.
+* 2 TRS sockets
+* 1 TRS cable.
+
+Alternatively, you can use any sort of cable and socket that has at least 3
+wires. If you want to use I2C to communicate between halves, you will need a
+cable with at least 4 wires and 2x 4.7kΩ pull-up resistors
+
+Optional Hardware
+-----------------
+
+A speaker can be hooked-up to either side to the `5` (`C6`) pin and `GND`, and turned on via `AUDIO_ENABLE`.
+
+Wiring
+------
+
+The 3 wires of the TRS cable need to connect GND, VCC, and digital pin 3 (i.e.
+PD0 on the ATmega32u4) between the two Pro Micros.
+
+Then wire your key matrix to any of the remaining 17 IO pins of the pro micro
+and modify the `matrix.c` accordingly.
+
+The wiring for serial:
+
+![serial wiring](imgs/split-keyboard-serial-schematic.png)
+
+The wiring for i2c:
+
+![i2c wiring](imgs/split-keyboard-i2c-schematic.png)
+
+The pull-up resistors may be placed on either half. It is also possible
+to use 4 resistors and have the pull-ups in both halves, but this is
+unnecessary in simple use cases.
+
+Notes on Software Configuration
+-------------------------------
+
+Configuring the firmware is similar to any other TMK project. One thing
+to note is that `MATIX_ROWS` in `config.h` is the total number of rows between
+the two halves, i.e. if your split keyboard has 4 rows in each half, then
+`MATRIX_ROWS=8`.
+
+Also the current implementation assumes a maximum of 8 columns, but it would
+not be very difficult to adapt it to support more if required.
+
+
+Flashing
+--------
+
+If you define `EE_HANDS` in your `config.h`, you will need to set the
+EEPROM for the left and right halves. The EEPROM is used to store whether the
+half is left handed or right handed. This makes it so that the same firmware
+file will run on both hands instead of having to flash left and right handed
+versions of the firmware to each half. To flash the EEPROM file for the left
+half run:
+```
+make eeprom-left
+```
+and similarly for right half
+```
+make eeprom-right
+```
+
+After you have flashed the EEPROM for the first time, you then need to program
+the flash memory:
+```
+make program
+```
+Note that you need to program both halves, but you have the option of using
+different keymaps for each half. You could program the left half with a QWERTY
+layout and the right half with a Colemak layout. Then if you connect the left
+half to a computer by USB the keyboard will use QWERTY and Colemak when the
+right half is connected.
+
+
diff --git a/keyboards/lets_split/serial.c b/keyboards/lets_split/serial.c
new file mode 100644
index 0000000000..f439c2f20b
--- /dev/null
+++ b/keyboards/lets_split/serial.c
@@ -0,0 +1,225 @@
+/*
+ * WARNING: be careful changing this code, it is very timing dependent
+ */
+
+#ifndef F_CPU
+#define F_CPU 16000000
+#endif
+
+#include <avr/io.h>
+#include <avr/interrupt.h>
+#include <util/delay.h>
+#include <stdbool.h>
+
+#include "serial.h"
+
+// Serial pulse period in microseconds. Its probably a bad idea to lower this
+// value.
+#define SERIAL_DELAY 24
+
+uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0};
+uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0};
+
+#define SLAVE_DATA_CORRUPT (1<<0)
+volatile uint8_t status = 0;
+
+inline static
+void serial_delay(void) {
+ _delay_us(SERIAL_DELAY);
+}
+
+inline static
+void serial_output(void) {
+ SERIAL_PIN_DDR |= SERIAL_PIN_MASK;
+}
+
+// make the serial pin an input with pull-up resistor
+inline static
+void serial_input(void) {
+ SERIAL_PIN_DDR &= ~SERIAL_PIN_MASK;
+ SERIAL_PIN_PORT |= SERIAL_PIN_MASK;
+}
+
+inline static
+uint8_t serial_read_pin(void) {
+ return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK);
+}
+
+inline static
+void serial_low(void) {
+ SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK;
+}
+
+inline static
+void serial_high(void) {
+ SERIAL_PIN_PORT |= SERIAL_PIN_MASK;
+}
+
+void serial_master_init(void) {
+ serial_output();
+ serial_high();
+}
+
+void serial_slave_init(void) {
+ serial_input();
+
+ // Enable INT0
+ EIMSK |= _BV(INT0);
+ // Trigger on falling edge of INT0
+ EICRA &= ~(_BV(ISC00) | _BV(ISC01));
+}
+
+// Used by the master to synchronize timing with the slave.
+static
+void sync_recv(void) {
+ serial_input();
+ // This shouldn't hang if the slave disconnects because the
+ // serial line will float to high if the slave does disconnect.
+ while (!serial_read_pin());
+ serial_delay();
+}
+
+// Used by the slave to send a synchronization signal to the master.
+static
+void sync_send(void) {
+ serial_output();
+
+ serial_low();
+ serial_delay();
+
+ serial_high();
+}
+
+// Reads a byte from the serial line
+static
+uint8_t serial_read_byte(void) {
+ uint8_t byte = 0;
+ serial_input();
+ for ( uint8_t i = 0; i < 8; ++i) {
+ byte = (byte << 1) | serial_read_pin();
+ serial_delay();
+ _delay_us(1);
+ }
+
+ return byte;
+}
+
+// Sends a byte with MSB ordering
+static
+void serial_write_byte(uint8_t data) {
+ uint8_t b = 8;
+ serial_output();
+ while( b-- ) {
+ if(data & (1 << b)) {
+ serial_high();
+ } else {
+ serial_low();
+ }
+ serial_delay();
+ }
+}
+
+// interrupt handle to be used by the slave device
+ISR(SERIAL_PIN_INTERRUPT) {
+ sync_send();
+
+ uint8_t checksum = 0;
+ for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) {
+ serial_write_byte(serial_slave_buffer[i]);
+ sync_send();
+ checksum += serial_slave_buffer[i];
+ }
+ serial_write_byte(checksum);
+ sync_send();
+
+ // wait for the sync to finish sending
+ serial_delay();
+
+ // read the middle of pulses
+ _delay_us(SERIAL_DELAY/2);
+
+ uint8_t checksum_computed = 0;
+ for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) {
+ serial_master_buffer[i] = serial_read_byte();
+ sync_send();
+ checksum_computed += serial_master_buffer[i];
+ }
+ uint8_t checksum_received = serial_read_byte();
+ sync_send();
+
+ serial_input(); // end transaction
+
+ if ( checksum_computed != checksum_received ) {
+ status |= SLAVE_DATA_CORRUPT;
+ } else {
+ status &= ~SLAVE_DATA_CORRUPT;
+ }
+}
+
+inline
+bool serial_slave_DATA_CORRUPT(void) {
+ return status & SLAVE_DATA_CORRUPT;
+}
+
+// Copies the serial_slave_buffer to the master and sends the
+// serial_master_buffer to the slave.
+//
+// Returns:
+// 0 => no error
+// 1 => slave did not respond
+int serial_update_buffers(void) {
+ // this code is very time dependent, so we need to disable interrupts
+ cli();
+
+ // signal to the slave that we want to start a transaction
+ serial_output();
+ serial_low();
+ _delay_us(1);
+
+ // wait for the slaves response
+ serial_input();
+ serial_high();
+ _delay_us(SERIAL_DELAY);
+
+ // check if the slave is present
+ if (serial_read_pin()) {
+ // slave failed to pull the line low, assume not present
+ sei();
+ return 1;
+ }
+
+ // if the slave is present syncronize with it
+ sync_recv();
+
+ uint8_t checksum_computed = 0;
+ // receive data from the slave
+ for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) {
+ serial_slave_buffer[i] = serial_read_byte();
+ sync_recv();
+ checksum_computed += serial_slave_buffer[i];
+ }
+ uint8_t checksum_received = serial_read_byte();
+ sync_recv();
+
+ if (checksum_computed != checksum_received) {
+ sei();
+ return 1;
+ }
+
+ uint8_t checksum = 0;
+ // send data to the slave
+ for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) {
+ serial_write_byte(serial_master_buffer[i]);
+ sync_recv();
+ checksum += serial_master_buffer[i];
+ }
+ serial_write_byte(checksum);
+ sync_recv();
+
+ // always, release the line when not in use
+ serial_output();
+ serial_high();
+
+ sei();
+ return 0;
+}
diff --git a/keyboards/lets_split/serial.h b/keyboards/lets_split/serial.h
new file mode 100644
index 0000000000..15fe4db7b4
--- /dev/null
+++ b/keyboards/lets_split/serial.h
@@ -0,0 +1,26 @@
+#ifndef MY_SERIAL_H
+#define MY_SERIAL_H
+
+#include "config.h"
+#include <stdbool.h>
+
+/* TODO: some defines for interrupt setup */
+#define SERIAL_PIN_DDR DDRD
+#define SERIAL_PIN_PORT PORTD
+#define SERIAL_PIN_INPUT PIND
+#define SERIAL_PIN_MASK _BV(PD0)
+#define SERIAL_PIN_INTERRUPT INT0_vect
+
+#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2
+#define SERIAL_MASTER_BUFFER_LENGTH 1
+
+// Buffers for master - slave communication
+extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH];
+extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH];
+
+void serial_master_init(void);
+void serial_slave_init(void);
+int serial_update_buffers(void);
+bool serial_slave_data_corrupt(void);
+
+#endif
diff --git a/keyboards/lets_split/split_util.c b/keyboards/lets_split/split_util.c
new file mode 100644
index 0000000000..65003a71a4
--- /dev/null
+++ b/keyboards/lets_split/split_util.c
@@ -0,0 +1,76 @@
+#include <avr/io.h>
+#include <avr/wdt.h>
+#include <avr/power.h>
+#include <avr/interrupt.h>
+#include <util/delay.h>
+#include <avr/eeprom.h>
+#include "split_util.h"
+#include "matrix.h"
+#include "i2c.h"
+#include "serial.h"
+#include "keyboard.h"
+#include "config.h"
+
+volatile bool isLeftHand = true;
+
+static void setup_handedness(void) {
+ #ifdef EE_HANDS
+ isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS);
+ #else
+ #ifdef I2C_MASTER_RIGHT
+ isLeftHand = !has_usb();
+ #else
+ isLeftHand = has_usb();
+ #endif
+ #endif
+}
+
+static void keyboard_master_setup(void) {
+#ifdef USE_I2C
+ i2c_master_init();
+#else
+ serial_master_init();
+#endif
+}
+
+static void keyboard_slave_setup(void) {
+#ifdef USE_I2C
+ i2c_slave_init(SLAVE_I2C_ADDRESS);
+#else
+ serial_slave_init();
+#endif
+}
+
+bool has_usb(void) {
+ USBCON |= (1 << OTGPADE); //enables VBUS pad
+ _delay_us(5);
+ return (USBSTA & (1<<VBUS)); //checks state of VBUS
+}
+
+void split_keyboard_setup(void) {
+ setup_handedness();
+
+ if (has_usb()) {
+ keyboard_master_setup();
+ } else {
+ keyboard_slave_setup();
+ }
+ sei();
+}
+
+void keyboard_slave_loop(void) {
+ matrix_init();
+
+ while (1) {
+ matrix_slave_scan();
+ }
+}
+
+// this code runs before the usb and keyboard is initialized
+void matrix_setup(void) {
+ split_keyboard_setup();
+
+ if (!has_usb()) {
+ keyboard_slave_loop();
+ }
+}
diff --git a/keyboards/lets_split/split_util.h b/keyboards/lets_split/split_util.h
new file mode 100644
index 0000000000..6b896679ca
--- /dev/null
+++ b/keyboards/lets_split/split_util.h
@@ -0,0 +1,22 @@
+#ifndef SPLIT_KEYBOARD_UTIL_H
+#define SPLIT_KEYBOARD_UTIL_H
+
+#include <stdbool.h>
+
+#ifdef EE_HANDS
+ #define EECONFIG_BOOTMAGIC_END (uint8_t *)10
+ #define EECONFIG_HANDEDNESS EECONFIG_BOOTMAGIC_END
+#endif
+
+#define SLAVE_I2C_ADDRESS 0x32
+
+extern volatile bool isLeftHand;
+
+// slave version of matix scan, defined in matrix.c
+void matrix_slave_scan(void);
+
+void split_keyboard_setup(void);
+bool has_usb(void);
+void keyboard_slave_loop(void);
+
+#endif
diff --git a/keyboards/stm32_f103_onekey/keymaps/default/keymap.c b/keyboards/stm32_f103_onekey/keymaps/default/keymap.c
deleted file mode 100644
index c3b0f08403..0000000000
--- a/keyboards/stm32_f103_onekey/keymaps/default/keymap.c
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
-Copyright 2012,2013 Jun Wako <wakojun@gmail.com>
-
-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 "stm32_f103_onekey.h"
-
-const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
- {{KC_CAPS}}, // test with KC_CAPS, KC_A, KC_BTLD
-};
-
-const uint16_t fn_actions[] = {
-};
diff --git a/keyboards/teensy_lc_onekey/keymaps/default/keymap.c b/keyboards/teensy_lc_onekey/keymaps/default/keymap.c
deleted file mode 100644
index a109b49600..0000000000
--- a/keyboards/teensy_lc_onekey/keymaps/default/keymap.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
-Copyright 2012,2013 Jun Wako <wakojun@gmail.com>
-
-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 "keycode.h"
-#include "action.h"
-#include "action_macro.h"
-#include "report.h"
-#include "host.h"
-#include "print.h"
-#include "debug.h"
-#include "keymap.h"
-
-const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
- {{KC_A}},
-}; // to test: KC_CAPS, KT_BTLD, KC_A
-
-const uint16_t fn_actions[] = {
-};