Skip to content

Commit

Permalink
Add kb2040 onkey keyboard that works with the oled keymap (qmk#17786)
Browse files Browse the repository at this point in the history
  • Loading branch information
jepler committed Aug 6, 2022
1 parent ad4ef47 commit 7bbc1b2
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 0 deletions.
29 changes: 29 additions & 0 deletions keyboards/handwired/onekey/kb2040/config.h
Original file line number Diff line number Diff line change
@@ -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

24 changes: 24 additions & 0 deletions keyboards/handwired/onekey/kb2040/mcuconf.h
Original file line number Diff line number Diff line change
@@ -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 <https://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
10 changes: 10 additions & 0 deletions keyboards/handwired/onekey/kb2040/readme.md
Original file line number Diff line number Diff line change
@@ -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)
9 changes: 9 additions & 0 deletions keyboards/handwired/onekey/kb2040/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# MCU name
MCU = RP2040
BOOTLOADER = rp2040

OLED_ENABLE = yes
OLED_DRIVER = SSD1306

OPT_DEFS += -DHAL_USE_I2C=TRUE

0 comments on commit 7bbc1b2

Please sign in to comment.