From 505e5c7033f841e277e227718ed328cf64c8a2fc Mon Sep 17 00:00:00 2001
From: ploopyco <54917504+ploopyco@users.noreply.github.com>
Date: Mon, 8 Dec 2025 17:24:42 -0500
Subject: [PATCH] Add new mouse "Ploopy Nano 2 Trackball" (#25762)
---
keyboards/ploopyco/nano_2/config.h | 33 ++++++++++++++++
keyboards/ploopyco/nano_2/info.json | 27 +++++++++++++
.../ploopyco/nano_2/keymaps/default/keymap.c | 23 +++++++++++
keyboards/ploopyco/nano_2/readme.md | 38 +++++++++++++++++++
.../ploopyco/nano_2/rev2_003/keyboard.json | 7 ++++
keyboards/ploopyco/nano_2/rev2_003/readme.md | 1 +
keyboards/ploopyco/nano_2/rules.mk | 1 +
7 files changed, 130 insertions(+)
create mode 100644 keyboards/ploopyco/nano_2/config.h
create mode 100644 keyboards/ploopyco/nano_2/info.json
create mode 100644 keyboards/ploopyco/nano_2/keymaps/default/keymap.c
create mode 100644 keyboards/ploopyco/nano_2/readme.md
create mode 100644 keyboards/ploopyco/nano_2/rev2_003/keyboard.json
create mode 100644 keyboards/ploopyco/nano_2/rev2_003/readme.md
create mode 100644 keyboards/ploopyco/nano_2/rules.mk
diff --git a/keyboards/ploopyco/nano_2/config.h b/keyboards/ploopyco/nano_2/config.h
new file mode 100644
index 0000000000..7d2b96fd8e
--- /dev/null
+++ b/keyboards/ploopyco/nano_2/config.h
@@ -0,0 +1,33 @@
+/* Copyright 2024 Colin Lam (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 .
+ */
+
+#pragma once
+
+#define UNUSABLE_PINS \
+ { GP1, GP3, GP4, GP6, GP8, GP10, GP14, GP16, GP18, GP20, GP22, GP24, GP25, GP26, GP27, GP28, GP29 }
+
+#define MOUSE_EXTENDED_REPORT
+
+#define PLOOPY_DRAGSCROLL_MOMENTARY
+#define PLOOPY_DRAGSCROLL_DIVISOR_H 64.0
+#define PLOOPY_DRAGSCROLL_DIVISOR_V 64.0
+
+#define PAW3222_CS_PIN GP5
+#define PAW3222_MOTION_PIN GP9
+#define PAW3222_SPI_DIVISOR 64
+#define SPI_SCK_PIN GP2
+#define SPI_MISO_PIN GP0
+#define SPI_MOSI_PIN GP7
diff --git a/keyboards/ploopyco/nano_2/info.json b/keyboards/ploopyco/nano_2/info.json
new file mode 100644
index 0000000000..ad69a0c04e
--- /dev/null
+++ b/keyboards/ploopyco/nano_2/info.json
@@ -0,0 +1,27 @@
+{
+ "keyboard_name": "Ploopy Nano 2 Trackball",
+ "manufacturer": "Ploopy Corporation",
+ "url": "www.ploopy.co",
+ "maintainer": "ploopyco",
+ "usb": {
+ "vid": "0x5043",
+ "pid": "0x4CE5",
+ "device_version": "0.0.1",
+ "max_power": 100
+ },
+ "features": {
+ "bootmagic": true,
+ "extrakey": true,
+ "nkro": true,
+ "pointing_device": true
+ },
+ "processor": "RP2040",
+ "bootloader": "rp2040",
+ "layouts": {
+ "LAYOUT": {
+ "layout": [
+ {"x": 0, "y": 0, "matrix": [0, 0]}
+ ]
+ }
+ }
+}
diff --git a/keyboards/ploopyco/nano_2/keymaps/default/keymap.c b/keyboards/ploopyco/nano_2/keymaps/default/keymap.c
new file mode 100644
index 0000000000..9fa7252a66
--- /dev/null
+++ b/keyboards/ploopyco/nano_2/keymaps/default/keymap.c
@@ -0,0 +1,23 @@
+/* Copyright 2021 Colin Lam (Ploopy Corporation)
+ * Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna)
+ * Copyright 2019 Sunjun Kim
+ * Copyright 2019 Hiroyuki Okada
+ *
+ * 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 .
+ */
+#include QMK_KEYBOARD_H
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+ [0] = LAYOUT( DRAG_SCROLL )
+};
diff --git a/keyboards/ploopyco/nano_2/readme.md b/keyboards/ploopyco/nano_2/readme.md
new file mode 100644
index 0000000000..509a62f9fa
--- /dev/null
+++ b/keyboards/ploopyco/nano_2/readme.md
@@ -0,0 +1,38 @@
+# Ploopy Nano 2 Trackball
+
+
+
+It's a DIY, QMK Powered Trackball...Nano!
+
+* Maintainer: [PloopyCo](https://github.com/ploopyco)
+* Key contributors: [Drashna Jael're](https://github.com/drashna/), [Germ](https://github.com/germ/)
+* Hardware Supported: RP2040
+* Hardware Availability: [Store](https://ploopy.co/nano-2), [GitHub](https://github.com/ploopyco)
+
+Make example for this keyboard (after setting up your build environment):
+
+ make ploopyco/nano_2/rev2_003:default
+
+Flashing example for this keyboard:
+
+ make ploopyco/nano_2/rev2_003:default:flash
+
+# Building Firmware
+
+See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
+
+# Triggering the Bootloader
+
+[Do you see those two golden holes in the board](https://ploopy.co/wp-content/uploads/2023/11/boot.jpg)? Those are called **vias**. They act exactly like a switch does. Right now, that switch is OFF. However, if you take a paperclip or a pair of metal tweezers and touch those two vias, the two vias will form an electrical connection. Effectively, that switch turns ON.
+
+Go ahead and connect the two vias, and then (while the vias are connected) plug in the Nano 2 board into your computer.
+
+The computer should recognise that a mass storage device was just plugged in. Once this is done, you should be able to drag and drop files onto the Nano 2 board, as if the board was a USB drive. Feel free to remove the tweezers or paperclip at this point.
+
+If you want to upload a new firmware file (a ".uf2" file, like "nano-2-awesome-version.uf2" or something), just drag it into the folder, and it'll automatically install on the Nano 2 board and restart itself, in normal operating mode. You're done!
+
+**TIP**: If your firmware is in some kind of strange state and uploading new firmware isn't fixing it, try uploading [a flash nuke](https://learn.adafruit.com/getting-started-with-raspberry-pi-pico-circuitpython/circuitpython#flash-resetting-uf2-3083182) to the Nano 2 board before flashing the new firmware. It wipes the memory of the Nano 2 board completely clean, which can help clear a few types of errors.
+
+# Customizing your Ploopy Nano 2
+
+You can find customziation options [here](../readme.md).
\ No newline at end of file
diff --git a/keyboards/ploopyco/nano_2/rev2_003/keyboard.json b/keyboards/ploopyco/nano_2/rev2_003/keyboard.json
new file mode 100644
index 0000000000..767a6ba154
--- /dev/null
+++ b/keyboards/ploopyco/nano_2/rev2_003/keyboard.json
@@ -0,0 +1,7 @@
+{
+ "matrix_pins": {
+ "direct": [
+ ["GP17"]
+ ]
+ }
+}
diff --git a/keyboards/ploopyco/nano_2/rev2_003/readme.md b/keyboards/ploopyco/nano_2/rev2_003/readme.md
new file mode 100644
index 0000000000..052a17f396
--- /dev/null
+++ b/keyboards/ploopyco/nano_2/rev2_003/readme.md
@@ -0,0 +1 @@
+See the main readme for more details. This is just here for when future revisions of the board are released.
diff --git a/keyboards/ploopyco/nano_2/rules.mk b/keyboards/ploopyco/nano_2/rules.mk
new file mode 100644
index 0000000000..e468209eba
--- /dev/null
+++ b/keyboards/ploopyco/nano_2/rules.mk
@@ -0,0 +1 @@
+POINTING_DEVICE_DRIVER = paw3222