summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bootloader.mk12
-rw-r--r--docs/faq_build.md135
-rw-r--r--docs/faq_debug.md14
-rw-r--r--keyboards/ploopyco/mouse/config.h73
-rw-r--r--keyboards/ploopyco/mouse/info.json21
-rw-r--r--keyboards/ploopyco/mouse/keymaps/default/keymap.c23
-rw-r--r--keyboards/ploopyco/mouse/keymaps/default/readme.md1
-rw-r--r--keyboards/ploopyco/mouse/keymaps/via/keymap.c26
-rw-r--r--keyboards/ploopyco/mouse/keymaps/via/rules.mk1
-rw-r--r--keyboards/ploopyco/mouse/mouse.c237
-rw-r--r--keyboards/ploopyco/mouse/mouse.h40
-rw-r--r--keyboards/ploopyco/mouse/readme.md68
-rw-r--r--keyboards/ploopyco/mouse/rules.mk30
-rw-r--r--keyboards/ploopyco/opt_encoder.c211
-rw-r--r--keyboards/ploopyco/opt_encoder.h66
-rw-r--r--keyboards/ploopyco/pmw3600.c222
-rw-r--r--keyboards/ploopyco/pmw3600.h103
-rw-r--r--keyboards/ploopyco/pmw3600_firmware.h300
-rw-r--r--keyboards/ploopyco/trackball/config.h69
-rw-r--r--keyboards/ploopyco/trackball/info.json18
-rw-r--r--keyboards/ploopyco/trackball/keymaps/default/keymap.c26
-rw-r--r--keyboards/ploopyco/trackball/keymaps/default/readme.md1
-rw-r--r--keyboards/ploopyco/trackball/keymaps/via/keymap.c26
-rw-r--r--keyboards/ploopyco/trackball/keymaps/via/rules.mk1
-rw-r--r--keyboards/ploopyco/trackball/readme.md68
-rw-r--r--keyboards/ploopyco/trackball/rules.mk30
-rw-r--r--keyboards/ploopyco/trackball/trackball.c237
-rw-r--r--keyboards/ploopyco/trackball/trackball.h40
-rw-r--r--keyboards/sp111/config.h83
-rw-r--r--keyboards/sp111/info.json19
-rw-r--r--keyboards/sp111/keymaps/default/keymap.c57
-rw-r--r--keyboards/sp111/keymaps/via/config.h18
-rw-r--r--keyboards/sp111/keymaps/via/keymap.c42
-rw-r--r--keyboards/sp111/keymaps/via/rules.mk1
-rw-r--r--keyboards/sp111/matrix.c178
-rw-r--r--keyboards/sp111/mcp23018.c120
-rw-r--r--keyboards/sp111/mcp23018.h34
-rw-r--r--keyboards/sp111/readme.md21
-rw-r--r--keyboards/sp111/rules.mk30
-rw-r--r--keyboards/sp111/sp111.c42
-rw-r--r--keyboards/sp111/sp111.h41
-rw-r--r--keyboards/wsk/sl40/config.h16
-rw-r--r--keyboards/wsk/sl40/info.json4
-rw-r--r--keyboards/wsk/sl40/keymaps/default/keymap.c45
-rw-r--r--keyboards/wsk/sl40/keymaps/prototype/keymap.c35
-rw-r--r--keyboards/wsk/sl40/readme.md4
-rw-r--r--keyboards/wsk/sl40/sl40.c16
-rw-r--r--keyboards/wsk/sl40/sl40.h45
-rwxr-xr-xlib/python/qmk/cli/doctor.py57
-rw-r--r--lib/python/qmk/constants.py2
-rw-r--r--quantum/config_common.h4
-rw-r--r--quantum/keymap.h4
-rw-r--r--quantum/mcu_selection.mk2
53 files changed, 2882 insertions, 137 deletions
diff --git a/bootloader.mk b/bootloader.mk
index d5f803f896..a7e596e476 100644
--- a/bootloader.mk
+++ b/bootloader.mk
@@ -35,30 +35,30 @@
ifeq ($(strip $(BOOTLOADER)), atmel-dfu)
OPT_DEFS += -DBOOTLOADER_ATMEL_DFU
OPT_DEFS += -DBOOTLOADER_DFU
- ifneq (,$(filter $(MCU), at90usb646 atmega16u2 atmega16u4 atmega32u2 atmega32u4))
+ ifneq (,$(filter $(MCU), atmega16u2 atmega32u2 atmega16u4 atmega32u4 at90usb646 at90usb647))
BOOTLOADER_SIZE = 4096
endif
- ifeq ($(strip $(MCU)), at90usb1286)
+ ifneq (,$(filter $(MCU), at90usb1286 at90usb1287))
BOOTLOADER_SIZE = 8192
endif
endif
ifeq ($(strip $(BOOTLOADER)), lufa-dfu)
OPT_DEFS += -DBOOTLOADER_LUFA_DFU
OPT_DEFS += -DBOOTLOADER_DFU
- ifneq (,$(filter $(MCU), at90usb646 atmega16u2 atmega16u4 atmega32u2 atmega32u4))
+ ifneq (,$(filter $(MCU), atmega16u2 atmega32u2 atmega16u4 atmega32u4 at90usb646 at90usb647))
BOOTLOADER_SIZE = 4096
endif
- ifeq ($(strip $(MCU)), at90usb1286)
+ ifneq (,$(filter $(MCU), at90usb1286 at90usb1287))
BOOTLOADER_SIZE = 8192
endif
endif
ifeq ($(strip $(BOOTLOADER)), qmk-dfu)
OPT_DEFS += -DBOOTLOADER_QMK_DFU
OPT_DEFS += -DBOOTLOADER_DFU
- ifneq (,$(filter $(MCU), at90usb646 atmega16u2 atmega16u4 atmega32u2 atmega32u4))
+ ifneq (,$(filter $(MCU), atmega16u2 atmega32u2 atmega16u4 atmega32u4 at90usb646 at90usb647))
BOOTLOADER_SIZE = 4096
endif
- ifeq ($(strip $(MCU)), at90usb1286)
+ ifneq (,$(filter $(MCU), at90usb1286 at90usb1287))
BOOTLOADER_SIZE = 8192
endif
endif
diff --git a/docs/faq_build.md b/docs/faq_build.md
index e2d0f9b27a..131844a2b7 100644
--- a/docs/faq_build.md
+++ b/docs/faq_build.md
@@ -13,63 +13,74 @@ An example of using `sudo`, when your controller is ATMega32u4:
or just:
- $ sudo make <keyboard>:<keymap>:dfu
+ $ sudo make <keyboard>:<keymap>:flash
Note that running `make` with `sudo` is generally ***not*** a good idea, and you should use one of the former methods, if possible.
### Linux `udev` Rules
-On Linux, you'll need proper privileges to access the MCU. You can either use
-`sudo` when flashing firmware, or place these files in `/etc/udev/rules.d/`. Once added run the following:
-```console
-sudo udevadm control --reload-rules
-sudo udevadm trigger
-```
-**/etc/udev/rules.d/50-atmel-dfu.rules:**
-```
-# Atmel ATMega32U4
-SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2ff4", TAG+="uaccess", RUN{builtin}+="uaccess"
-# Atmel USBKEY AT90USB1287
-SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2ffb", TAG+="uaccess", RUN{builtin}+="uaccess"
-# Atmel ATMega32U2
-SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2ff0", TAG+="uaccess", RUN{builtin}+="uaccess"
+On Linux, you'll need proper privileges to communicate with the bootloader device. You can either use `sudo` when flashing firmware, or place this file in `/etc/udev/rules.d/`:
+
+**/etc/udev/rules.d/50-qmk.rules:**
```
+# Atmel DFU
+SUBSYSTEMS=="usb", ATTRS{idVendor}=="03EB", ATTRS{idProduct}=="2FEF", TAG+="uaccess", RUN{builtin}+="uaccess" # ATmega16U2
+SUBSYSTEMS=="usb", ATTRS{idVendor}=="03EB", ATTRS{idProduct}=="2FF0", TAG+="uaccess", RUN{builtin}+="uaccess" # ATmega32U2
+SUBSYSTEMS=="usb", ATTRS{idVendor}=="03EB", ATTRS{idProduct}=="2FF3", TAG+="uaccess", RUN{builtin}+="uaccess" # ATmega16U4
+SUBSYSTEMS=="usb", ATTRS{idVendor}=="03EB", ATTRS{idProduct}=="2FF4", TAG+="uaccess", RUN{builtin}+="uaccess" # ATmega32U4
+SUBSYSTEMS=="usb", ATTRS{idVendor}=="03EB", ATTRS{idProduct}=="2FF9", TAG+="uaccess", RUN{builtin}+="uaccess" # AT90USB64
+SUBSYSTEMS=="usb", ATTRS{idVendor}=="03EB", ATTRS{idProduct}=="2FFB", TAG+="uaccess", RUN{builtin}+="uaccess" # AT90USB128
-**/etc/udev/rules.d/54-input-club-keyboard.rules:**
+# Input Club
+SUBSYSTEMS=="usb", ATTRS{idVendor}=="1C11", ATTRS{idProduct}=="B007", TAG+="uaccess", RUN{builtin}+="uaccess"
-```
-# Input Club keyboard bootloader
-SUBSYSTEMS=="usb", ATTRS{idVendor}=="1c11", ATTRS{idProduct}=="b007", TAG+="uaccess", RUN{builtin}+="uaccess"
-```
+# STM32duino
+SUBSYSTEMS=="usb", ATTRS{idVendor}=="1EAF", ATTRS{idProduct}=="0003", TAG+="uaccess", RUN{builtin}+="uaccess"
+# STM32 DFU
+SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="DF11", TAG+="uaccess", RUN{builtin}+="uaccess"
-**/etc/udev/rules.d/55-caterina.rules:**
-```
-# ModemManager should ignore the following devices
-SUBSYSTEMS=="usb", ATTRS{idVendor}=="2a03", ATTRS{idProduct}=="0036", TAG+="uaccess", RUN{builtin}+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1"
-SUBSYSTEMS=="usb", ATTRS{idVendor}=="2341", ATTRS{idProduct}=="0036", TAG+="uaccess", RUN{builtin}+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1"
-SUBSYSTEMS=="usb", ATTRS{idVendor}=="1b4f", ATTRS{idProduct}=="9205", TAG+="uaccess", RUN{builtin}+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1"
-SUBSYSTEMS=="usb", ATTRS{idVendor}=="1b4f", ATTRS{idProduct}=="9203", TAG+="uaccess", RUN{builtin}+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1"
-```
+# BootloadHID
+SUBSYSTEMS=="usb", ATTRS{idVendor}=="16C0", ATTRS{idProduct}=="05DF", TAG+="uaccess", RUN{builtin}+="uaccess"
-**Note:** With older (before 1.12) ModemManager, filtering only works when not in strict mode, the following commands can update that settings:
-```console
-printf '[Service]\nExecStart=\nExecStart=/usr/sbin/ModemManager --filter-policy=default' | sudo tee /etc/systemd/system/ModemManager.service.d/policy.conf
-sudo systemctl daemon-reload
-sudo systemctl restart ModemManager
-```
+# USBAspLoader
+SUBSYSTEMS=="usb", ATTRS{idVendor}=="16C0", ATTRS{idProduct}=="05DC", TAG+="uaccess", RUN{builtin}+="uaccess"
+
+# ModemManager should ignore the following devices
+# Atmel SAM-BA (Massdrop)
+SUBSYSTEMS=="usb", ATTRS{idVendor}=="03EB", ATTRS{idProduct}=="6124", TAG+="uaccess", RUN{builtin}+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1"
+
+# Caterina (Pro Micro)
+# Spark Fun Electronics
+SUBSYSTEMS=="usb", ATTRS{idVendor}=="1B4F", ATTRS{idProduct}=="9203", TAG+="uaccess", RUN{builtin}+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" # Pro Micro 3V3/8MHz
+SUBSYSTEMS=="usb", ATTRS{idVendor}=="1B4F", ATTRS{idProduct}=="9205", TAG+="uaccess", RUN{builtin}+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" # Pro Micro 5V/16MHz
+SUBSYSTEMS=="usb", ATTRS{idVendor}=="1B4F", ATTRS{idProduct}=="9207", TAG+="uaccess", RUN{builtin}+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" # LilyPad 3V3/8MHz (and some Pro Micro clones)
+# Pololu Electronics
+SUBSYSTEMS=="usb", ATTRS{idVendor}=="1FFB", ATTRS{idProduct}=="0101", TAG+="uaccess", RUN{builtin}+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" # A-Star 32U4
+# Arduino SA
+SUBSYSTEMS=="usb", ATTRS{idVendor}=="2341", ATTRS{idProduct}=="0036", TAG+="uaccess", RUN{builtin}+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" # Leonardo
+SUBSYSTEMS=="usb", ATTRS{idVendor}=="2341", ATTRS{idProduct}=="0037", TAG+="uaccess", RUN{builtin}+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" # Micro
+# Adafruit Industries LLC
+SUBSYSTEMS=="usb", ATTRS{idVendor}=="239A", ATTRS{idProduct}=="000C", TAG+="uaccess", RUN{builtin}+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" # Feather 32U4
+SUBSYSTEMS=="usb", ATTRS{idVendor}=="239A", ATTRS{idProduct}=="000D", TAG+="uaccess", RUN{builtin}+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" # ItsyBitsy 32U4 3V3/8MHz
+SUBSYSTEMS=="usb", ATTRS{idVendor}=="239A", ATTRS{idProduct}=="000E", TAG+="uaccess", RUN{builtin}+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" # ItsyBitsy 32U4 5V/16MHz
+# dog hunter AG
+SUBSYSTEMS=="usb", ATTRS{idVendor}=="2A03", ATTRS{idProduct}=="0036", TAG+="uaccess", RUN{builtin}+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" # Leonardo
+SUBSYSTEMS=="usb", ATTRS{idVendor}=="2A03", ATTRS{idProduct}=="0037", TAG+="uaccess", RUN{builtin}+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1" # Micro
+```
+
+Once added, run the following:
-**/etc/udev/rules.d/56-dfu-util.rules:**
```
-# stm32duino
-SUBSYSTEMS=="usb", ATTRS{idVendor}=="1eaf", ATTRS{idProduct}=="0003", TAG+="uaccess", RUN{builtin}+="uaccess"
-# Generic stm32
-SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", TAG+="uaccess", RUN{builtin}+="uaccess"
+sudo udevadm control --reload-rules
+sudo udevadm trigger
```
-**/etc/udev/rules.d/57-bootloadhid.rules:**
+**Note:** With older versions of ModemManager (< 1.12), filtering only works when not in strict mode. The following commands can update that setting:
+
```
-# bootloadHID
-SUBSYSTEMS=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="05df", TAG+="uaccess", RUN{builtin}+="uaccess"
+printf '[Service]\nExecStart=\nExecStart=/usr/sbin/ModemManager --filter-policy=default' | sudo tee /etc/systemd/system/ModemManager.service.d/policy.conf
+sudo systemctl daemon-reload
+sudo systemctl restart ModemManager
```
### Serial device is not detected in bootloader mode on Linux
@@ -96,46 +107,6 @@ You can buy a really unique VID:PID here. I don't think you need this for person
- http://www.obdev.at/products/vusb/license.html
- http://www.mcselec.com/index.php?page=shop.product_details&flypage=shop.flypage&product_id=92&option=com_phpshop&Itemid=1
-## BOOTLOADER_SIZE for AVR
-Note that Teensy2.0++ bootloader size is 2048byte. Some Makefiles may have wrong comment.
-
-```
-# Boot Section Size in *bytes*
-# Teensy halfKay 512
-# Teensy++ halfKay 2048
-# Atmel DFU loader 4096 (TMK Alt Controller)
-# LUFA bootloader 4096
-# USBaspLoader 2048
-OPT_DEFS += -DBOOTLOADER_SIZE=2048
-```
-
-## `avr-gcc: internal compiler error: Abort trap: 6 (program cc1)` on MacOS
-
-This is an issue with updating on brew, causing symlinks that avr-gcc depend on getting mangled.
-
-The solution is to remove and reinstall all affected modules.
-
-```
-brew rm avr-gcc avr-gcc@8 dfu-programmer dfu-util gcc-arm-none-eabi arm-gcc-bin@8 avrdude qmk
-brew install qmk/qmk/qmk
-brew link --force avr-gcc@8
-brew link --force arm-gcc-bin@8
-```
-
-### `avr-gcc` and LUFA
-
-If you updated your `avr-gcc` and you see errors involving LUFA, for example:
-
-`lib/lufa/LUFA/Drivers/USB/Class/Device/AudioClassDevice.h:380:5: error: 'const' attribute on function returning 'void'`
-
-For now, you need to rollback `avr-gcc` to 8 in Homebrew.
-
-```
-brew uninstall --force avr-gcc
-brew install avr-gcc@8
-brew link --force avr-gcc@8
-```
-
### I just flashed my keyboard and it does nothing/keypresses don't register - it's also ARM (rev6 planck, clueboard 60, hs60v2, etc...) (Feb 2019)
Due to how EEPROM works on ARM based chips, saved settings may no longer be valid. This affects the default layers, and *may*, under certain circumstances we are still figuring out, make the keyboard unusable. Resetting the EEPROM will correct this.
diff --git a/docs/faq_debug.md b/docs/faq_debug.md
index 08c84fe4fd..7d5473678b 100644
--- a/docs/faq_debug.md
+++ b/docs/faq_debug.md
@@ -31,20 +31,6 @@ Check:
- try using 'print' function instead of debug print. See **common/print.h**.
- disconnect other devices with console function. See [Issue #97](https://github.com/tmk/tmk_keyboard/issues/97).
-## Linux or UNIX Like System Requires Super User Privilege
-Just use 'sudo' to execute *hid_listen* with privilege.
-```
-$ sudo hid_listen
-```
-
-Or add an *udev rule* for TMK devices with placing a file in rules directory. The directory may vary on each system.
-
-File: /etc/udev/rules.d/52-tmk-keyboard.rules(in case of Ubuntu)
-```
-# tmk keyboard products https://github.com/tmk/tmk_keyboard
-SUBSYSTEMS=="usb", ATTRS{idVendor}=="feed", MODE:="0666"
-```
-
***
# Miscellaneous
diff --git a/keyboards/ploopyco/mouse/config.h b/keyboards/ploopyco/mouse/config.h
new file mode 100644
index 0000000000..787eb9a85e
--- /dev/null
+++ b/keyboards/ploopyco/mouse/config.h
@@ -0,0 +1,73 @@
+/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
+ * Copyright 2019 Sunjun Kim
+ * Copyright 2020 Ploopy Corporation
+ *
+ * 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/>.
+ */
+
+#pragma once
+
+#include "config_common.h"
+
+/* USB Device descriptor parameter */
+#define VENDOR_ID 0x5043
+#define PRODUCT_ID 0x4D6F
+#define DEVICE_VER 0x0001
+#define MANUFACTURER Ploopyco
+#define PRODUCT Mouse
+
+/* key matrix size */
+#define MATRIX_ROWS 1
+#define MATRIX_COLS 8
+
+/*
+ * Keyboard Matrix Assignments
+ *
+ * Change this to how you wired your keyboard
+ * COLS: AVR pins used for columns, left to right
+ * ROWS: AVR pins used for rows, top to bottom
+ * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
+ * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
+ *
+ */
+#define DIRECT_PINS \
+ { \
+ { D4, D2, E6, B6, D7, C6, C7, B7 } \
+ }
+
+// These pins are not broken out, and cannot be used normally.
+// They are set as output and pulled high, by default
+#define UNUSED_PINS \
+ { B4, D6, F1, F5, F6, F7 }
+
+/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
+#define DEBOUNCE 5
+
+/* Much more so than a keyboard, speed matters for a mouse. So we'll go for as high
+ a polling rate as possible. */
+#define USB_POLLING_INTERVAL_MS 1
+
+/* define if matrix has ghost (lacks anti-ghosting diodes) */
+//#define MATRIX_HAS_GHOST
+
+/* disable action features */
+//#define NO_ACTION_LAYER
+//#define NO_ACTION_TAPPING
+//#define NO_ACTION_ONESHOT
+#define NO_ACTION_MACRO
+#define NO_ACTION_FUNCTION
+
+/* Bootmagic Lite key configuration */
+#define BOOTMAGIC_LITE_ROW 0
+#define BOOTMAGIC_LITE_COLUMN 3
diff --git a/keyboards/ploopyco/mouse/info.json b/keyboards/ploopyco/mouse/info.json
new file mode 100644
index 0000000000..6763838dcf
--- /dev/null
+++ b/keyboards/ploopyco/mouse/info.json
@@ -0,0 +1,21 @@
+{
+ "keyboard_name": "PloopyCo Mouse",
+ "url": "",
+ "maintainer": "drashna",
+ "width": 8,
+ "height": 3,
+ "layouts": {
+ "LAYOUT": {
+ "layout": [
+ {"x":1, "y":0, "h":2},
+ {"x":2, "y":0, "h":2},
+ {"x":3, "y":0.25, "h":1.25},
+ {"x":4, "y":0, "h":2},
+ {"x":5, "y":0, "h":2},
+ {"x":0, "y":0},
+ {"x":0, "y":1},
+ {"x":3, "y":1.5}
+ ]
+ }
+ }
+}
diff --git a/keyboards/ploopyco/mouse/keymaps/default/keymap.c b/keyboards/ploopyco/mouse/keymaps/default/keymap.c
new file mode 100644
index 0000000000..c02d23d2ab
--- /dev/null
+++ b/keyboards/ploopyco/mouse/keymaps/default/keymap.c
@@ -0,0 +1,23 @@
+/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
+ * Copyright 2019 Sunjun Kim
+ * Copyright 2020 Ploopy Corporation
+ *
+ * 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 QMK_KEYBOARD_H
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+ [0] = LAYOUT(/* Base */
+ C(KC_C), KC_BTN1, KC_BTN3, KC_BTN2, C(KC_C), KC_BTN4, KC_BTN5, C(KC_Z)),
+};
diff --git a/keyboards/ploopyco/mouse/keymaps/default/readme.md b/keyboards/ploopyco/mouse/keymaps/default/readme.md
new file mode 100644
index 0000000000..f965ef3c32
--- /dev/null
+++ b/keyboards/ploopyco/mouse/keymaps/default/readme.md
@@ -0,0 +1 @@
+# The default keymap for Ploopyco Trackball
diff --git a/keyboards/ploopyco/mouse/keymaps/via/keymap.c b/keyboards/ploopyco/mouse/keymaps/via/keymap.c
new file mode 100644
index 0000000000..27a0384381
--- /dev/null
+++ b/keyboards/ploopyco/mouse/keymaps/via/keymap.c
@@ -0,0 +1,26 @@
+/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
+ * Copyright 2019 Sunjun Kim
+ * Copyright 2020 Ploopy Corporation
+ *
+ * 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 QMK_KEYBOARD_H
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+ [0] = LAYOUT(/* Base */
+ C(KC_C), KC_BTN1, KC_BTN3, KC_BTN2, C(KC_C), KC_BTN4, KC_BTN5, C(KC_Z)),
+ [1] = LAYOUT(_______, _______, _______, _______, _______, _______, _______, _______),
+ [2] = LAYOUT(_______, _______, _______, _______, _______, _______, _______, _______),
+ [3] = LAYOUT(_______, _______, _______, _______, _______, _______, _______, _______),
+};
diff --git a/keyboards/ploopyco/mouse/keymaps/via/rules.mk b/keyboards/ploopyco/mouse/keymaps/via/rules.mk
new file mode 100644
index 0000000000..1e5b99807c
--- /dev/null
+++ b/keyboards/ploopyco/mouse/keymaps/via/rules.mk
@@ -0,0 +1 @@
+VIA_ENABLE = yes
diff --git a/keyboards/ploopyco/mouse/mouse.c b/keyboards/ploopyco/mouse/mouse.c
new file mode 100644
index 0000000000..6a9bffbffe
--- /dev/null
+++ b/keyboards/ploopyco/mouse/mouse.c
@@ -0,0 +1,237 @@
+/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
+ * Copyright 2019 Sunjun Kim
+ * Copyright 2020 Ploopy Corporation
+ *
+ * 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 QMK_KEYBOARD_H
+
+#ifndef OPT_DEBOUNCE
+# define OPT_DEBOUNCE 5 // (ms) Time between scroll events
+#endif
+#ifndef SCROLL_BUTT_DEBOUNCE
+# define SCROLL_BUTT_DEBOUNCE 100 // (ms) Time between scroll events
+#endif
+#ifndef OPT_THRES
+# define OPT_THRES 150 // (0-1024) Threshold for actication
+#endif
+#ifndef OPT_SCALE
+# define OPT_SCALE 1 // Multiplier for wheel
+#endif
+
+// TODO: Implement libinput profiles
+// https://wayland.freedesktop.org/libinput/doc/latest/pointer-acceleration.html
+// Compile time accel selection
+// Valid options are ACC_NONE, ACC_LINEAR, ACC_CUSTOM, ACC_QUADRATIC
+
+// Trackball State
+bool is_scroll_clicked = false;
+bool BurstState = false; // init burst state for Trackball module
+uint16_t MotionStart = 0; // Timer for accel, 0 is resting state
+uint16_t lastScroll = 0; // Previous confirmed wheel event
+uint16_t lastMidClick = 0; // Stops scrollwheel from being read if it was pressed
+uint8_t OptLowPin = OPT_ENC1;
+bool debug_encoder = false;
+
+__attribute__((weak)) void process_wheel_user(report_mouse_t* mouse_report, int16_t h, int16_t v) {
+ mouse_report->h = h;
+ mouse_report->v = v;
+}
+
+__attribute__((weak)) void process_wheel(report_mouse_t* mouse_report) {
+ // TODO: Replace this with interrupt driven code, polling is S L O W
+ // Lovingly ripped from the Ploopy Source
+
+ // If the mouse wheel was just released, do not scroll.
+ if (timer_elapsed(lastMidClick) < SCROLL_BUTT_DEBOUNCE) {
+ return;
+ }
+
+ // Limit the number of scrolls per unit time.
+ if (timer_elapsed(lastScroll) < OPT_DEBOUNCE) {
+ return;
+ }
+
+ // Don't scroll if the middle button is depressed.
+ if (is_scroll_clicked) {
+#ifndef IGNORE_SCROLL_CLICK
+ return;
+#endif
+ }
+
+ lastScroll = timer_read();
+ uint16_t p1 = adc_read(OPT_ENC1_MUX);
+ uint16_t p2 = adc_read(OPT_ENC2_MUX);
+ if (debug_encoder) dprintf("OPT1: %d, OPT2: %d\n", p1, p2);
+
+ uint8_t dir = opt_encoder_handler(p1, p2);
+
+ if (dir == 0) return;
+ process_wheel_user(mouse_report, mouse_report->h, (int)(mouse_report->v + (dir * OPT_SCALE)));
+}
+
+__attribute__((weak)) void process_mouse_user(report_mouse_t* mouse_report, int16_t x, int16_t y) {
+ mouse_report->x = x;
+ mouse_report->y = y;
+}
+
+__attribute__((weak)) void process_mouse(report_mouse_t* mouse_report) {
+ report_pmw_t data = pmw_read_burst();
+ if (data.isOnSurface && data.isMotion) {
+ // Reset timer if stopped moving
+ if (!data.isMotion) {
+ if (MotionStart != 0) MotionStart = 0;
+ return;
+ }
+
+ // Set timer if new motion
+ if ((MotionStart == 0) && data.isMotion) {
+ if (debug_mouse) dprintf("Starting motion.\n");
+ MotionStart = timer_read();
+ }
+
+ if (debug_mouse) {
+ dprintf("Delt] d: %d t: %u\n", abs(data.dx) + abs(da