summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Epler <jepler@gmail.com>2022-08-05 21:38:10 -0500
committerGitHub <noreply@github.com>2022-08-05 19:38:10 -0700
commit7bbc1b21dd97d0d1577b5ed288adc48475512497 (patch)
tree5c850857dfbb5052ff2779dd2c1d27e24fa91d85
parentad4ef47d2b92c158d49feabf28cc3b5eb367a1c4 (diff)
Add kb2040 onkey keyboard that works with the oled keymap (#17786)
-rw-r--r--keyboards/handwired/onekey/kb2040/config.h29
-rw-r--r--keyboards/handwired/onekey/kb2040/mcuconf.h24
-rw-r--r--keyboards/handwired/onekey/kb2040/readme.md10
-rw-r--r--keyboards/handwired/onekey/kb2040/rules.mk9
4 files changed, 72 insertions, 0 deletions
diff --git a/keyboards/handwired/onekey/kb2040/config.h b/keyboards/handwired/onekey/kb2040/config.h
new file mode 100644
index 0000000000..24a7d3a3eb
--- /dev/null
+++ b/keyboards/handwired/onekey/kb2040/config.h
@@ -0,0 +1,29 @@
+// Copyright 2022 Stefan Kerkmann
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#pragma once
+
+#include "config_common.h"
+
+#define PRODUCT Onekey Raspberry Pi RP2040
+#define MATRIX_COL_PINS \
+ { GP4 }
+#define MATRIX_ROW_PINS \
+ { GP5 }
+#define DEBUG_MATRIX_SCAN_RATE
+
+#define QMK_WAITING_TEST_BUSY_PIN GP8
+#define QMK_WAITING_TEST_YIELD_PIN GP9
+
+#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET
+#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_LED GP25
+#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_TIMEOUT 500U
+
+#define RGB_DI_PIN A1
+
+// settings for the oled keyboard demo with Adafruit 0.91" OLED display on the Stemma QT port
+#define OLED_DISPLAY_128X32
+#define I2C_DRIVER I2CD1
+#define I2C1_SDA_PIN GP12
+#define I2C1_SCL_PIN GP13
+
diff --git a/keyboards/handwired/onekey/kb2040/mcuconf.h b/keyboards/handwired/onekey/kb2040/mcuconf.h
new file mode 100644
index 0000000000..57e58e14d7
--- /dev/null
+++ b/keyboards/handwired/onekey/kb2040/mcuconf.h
@@ -0,0 +1,24 @@
+/* Copyright 2020 QMK
+ *
+ * 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_next <mcuconf.h>
+
+#undef RP_I2C_USE_I2C0
+#define RP_I2C_USE_I2C0 TRUE
+
+#undef RP_I2C_USE_I2C1
+#define RP_I2C_USE_I2C1 TRUE
diff --git a/keyboards/handwired/onekey/kb2040/readme.md b/keyboards/handwired/onekey/kb2040/readme.md
new file mode 100644
index 0000000000..54ea25a6a5
--- /dev/null
+++ b/keyboards/handwired/onekey/kb2040/readme.md
@@ -0,0 +1,10 @@
+# Adafruit KB2040 onekey with OLED
+
+To trigger keypress, short together pins *GP4* and *GP5*.
+
+Double-tap reset to enter bootloader mode. Copy the built uf2 file to the device by dragging the file to the new USB disk.
+
+## Supported Hardware
+
+* [Adafruit KB2040 - RP2040 Kee Boar](https://www.adafruit.com/product/5302)
+* Optional [128x32 OLED display on the Stemma QT port](https://www.adafruit.com/product/4440)
diff --git a/keyboards/handwired/onekey/kb2040/rules.mk b/keyboards/handwired/onekey/kb2040/rules.mk
new file mode 100644
index 0000000000..624b331bf8
--- /dev/null
+++ b/keyboards/handwired/onekey/kb2040/rules.mk
@@ -0,0 +1,9 @@
+# MCU name
+MCU = RP2040
+BOOTLOADER = rp2040
+
+OLED_ENABLE = yes
+OLED_DRIVER = SSD1306
+
+OPT_DEFS += -DHAL_USE_I2C=TRUE
+