Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Quokka keyboard #20979

Merged
merged 16 commits into from
Sep 21, 2023
Merged
44 changes: 44 additions & 0 deletions keyboards/quokka/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
Copyright 2023 @dlford
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

#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET
#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_TIMEOUT 150U

// wiring of each half
#define MATRIX_COL_PINS \
{ B4, E6, D7, C6, D4 }
#define MATRIX_ROW_PINS \
{ B6, B2, B3, B1 }

#define DIODE_DIRECTION ROW2COL

#define RGB_DI_PIN F4
#define RGB_MATRIX_LED_COUNT 36
#define RGB_MATRIX_SPLIT \
{ 18, 18 }
#define RGB_MATRIX_CENTER \
{ 133, 54 }

#define OLED_DISPLAY_128X64

#define AUDIO_PIN B5
#define AUDIO_PWM_DRIVER PWMD4
#define AUDIO_PWM_CHANNEL RP2040_PWM_CHANNEL_B

#define SERIAL_USART_FULL_DUPLEX
#define SERIAL_PIO_USE_PIO0
#define SOFT_SERIAL_PIN D3
#define SERIAL_USART_RX_PIN D2
20 changes: 20 additions & 0 deletions keyboards/quokka/halconf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
Copyright 2023 @dlford

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/>.
*/

dlford marked this conversation as resolved.
Show resolved Hide resolved
#define HAL_USE_PWM TRUE
#define HAL_USE_PAL TRUE
dlford marked this conversation as resolved.
Show resolved Hide resolved
#include_next <halconf.h>
69 changes: 69 additions & 0 deletions keyboards/quokka/info.json
dlford marked this conversation as resolved.
Show resolved Hide resolved
dlford marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"keyboard_name": "Quokka",
"manufacturer": "dlford",
"url": "https://github.com/dlford/quokka",
"maintainer": "dlford",
"usb": {
"vid": "0x444D",
"pid": "0x3537",
"device_version": "1.0.0"
},
"split": {
"soft_serial_pin": "D3"
},
"diode_direction": "ROW2COL",
"matrix_pins": {
"cols": ["B4", "E6", "D7", "C6", "D4"],
"rows": ["B6", "B2", "B3", "B1"]
},
"layouts": {
"LAYOUT_split_3x5_3": {
"layout": [
{"x": 0, "y": 0},
{"x": 1, "y": 0},
{"x": 2, "y": 0},
{"x": 3, "y": 0},
{"x": 4, "y": 0},

{"x": 10, "y": 0},
{"x": 11, "y": 0},
{"x": 12, "y": 0},
{"x": 13, "y": 0},
{"x": 14, "y": 0},

{"x": 0, "y": 1},
{"x": 1, "y": 1},
{"x": 2, "y": 1},
{"x": 3, "y": 1},
{"x": 4, "y": 1},

{"x": 10, "y": 1},
{"x": 11, "y": 1},
{"x": 12, "y": 1},
{"x": 13, "y": 1},
{"x": 14, "y": 1},

{"x": 0, "y": 2},
{"x": 1, "y": 2},
{"x": 2, "y": 2},
{"x": 3, "y": 2},
{"x": 4, "y": 2},

{"x": 10, "y": 2},
{"x": 11, "y": 2},
{"x": 12, "y": 2},
{"x": 13, "y": 2},
{"x": 14, "y": 2},

{"x": 2, "y": 3},
{"x": 3, "y": 3},
{"x": 4, "y": 3},

{"x": 10, "y": 3},
{"x": 11, "y": 3},
{"x": 12, "y": 3}
]
}
}
}

36 changes: 36 additions & 0 deletions keyboards/quokka/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
Copyright 2023 @dlford

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

// clang-format off

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT_split_3x5_3(
// |--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------|
KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P,
// |--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------|
KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,
// |--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------|
KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH,
// |--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------|
KC_ESC, KC_SPC, KC_BSPC, KC_DEL, KC_TAB, KC_ENT
// |--------+--------+--------| |--------+--------+--------|
),
};

// clang-format on
20 changes: 20 additions & 0 deletions keyboards/quokka/mcuconf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
Copyright 2023 @dlford

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/>.
*/

dlford marked this conversation as resolved.
Show resolved Hide resolved
#include_next <mcuconf.h>
#undef RP_PWM_USE_PWM4
#define RP_PWM_USE_PWM4 TRUE
86 changes: 86 additions & 0 deletions keyboards/quokka/quokka.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
/*
Copyright 2023 @dlford

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 "quokka.h"

// clang-format off
dlford marked this conversation as resolved.
Show resolved Hide resolved

dlford marked this conversation as resolved.
Show resolved Hide resolved
#ifdef RGB_MATRIX_ENABLE

// LED Layout
// Columns
// 0 1 2 3 4 5 6 7 8 9 10 11
// Physical (Center: 133)
// 20 41 61 81 102 122 143 163 183 204 224 244
// Rows Physical (Center: 54)
// 17 12 11 06 05 23 24 29 30 35 0 21
// 16 13 10 07 04 22 25 28 31 34 1 43
// 15 14 09 08 03 21 26 27 32 33 2 64
// 02 01 00 18 19 20 3 85

led_config_t g_led_config = { {
dlford marked this conversation as resolved.
Show resolved Hide resolved
// Key matrix to LED index
// Left 1-18
{17, 12, 11, 6, 5},
{16, 13, 10, 7, 4},
{15, 14, 9, 8, 3},
{NO_LED, NO_LED, 2, 1, 0},
// Right 1-18
{23, 24, 29, 30, 35},
{22, 25, 28, 31, 34},
{21, 26, 27, 32, 33},
{18, 19, 20, NO_LED, NO_LED},
}, {
// LED index to physical position
// Left 1-18
{122,85},{102,85},{81,85},{102,64},{102,43},{102,21},
{81,21},{81,43},{81,64},{61,64},{61,43},{61,21},
{41,21},{41,43},{41,64},{20,64},{20,43},{20,21},
// Right 1-18
{143,85},{163,85},{183,85},{163,64},{163,43},{163,21},
{183,21},{183,43},{183,64},{204,64},{204,43},{204,21},
{224,21},{224,43},{224,64},{244,64},{244,43},{244,21}
}, {
// LED index to flag
// Left 1-18
4,4,4,4,4,4,
4,4,4,4,4,4,
4,4,4,4,4,4,
// Right 1-18
4,4,4,4,4,4,
4,4,4,4,4,4,
4,4,4,4,4,4
} };

#endif

#ifdef SWAP_HANDS_ENABLE
__attribute__ ((weak))
const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = {
// Left
{{0, 4}, {1, 4}, {2, 4}, {3, 4}, {4, 4}},
{{0, 5}, {1, 5}, {2, 5}, {3, 5}, {4, 5}},
{{0, 6}, {1, 6}, {2, 6}, {3, 6}, {4, 6}},
{{0, 7}, {1, 7}, {2, 7}, {3, 7}, {4, 7}},
// Right
{{0, 0}, {1, 0}, {2, 0}, {3, 0}, {4, 0}},
{{0, 1}, {1, 1}, {2, 1}, {3, 1}, {4, 1}},
{{0, 2}, {1, 2}, {2, 2}, {3, 2}, {4, 2}},
{{0, 3}, {1, 3}, {2, 3}, {3, 3}, {4, 3}}
};
#endif

// clang-format on
42 changes: 42 additions & 0 deletions keyboards/quokka/quokka.h
dlford marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
Copyright 2023 @dlford

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 "quantum.h"

#define XXX KC_NO

// clang-format off

#define LAYOUT_split_3x5_3( \
L00, L01, L02, L03, L04, R00, R01, R02, R03, R04, \
L10, L11, L12, L13, L14, R10, R11, R12, R13, R14, \
L20, L21, L22, L23, L24, R20, R21, R22, R23, R24, \
L32, L33, L34, R30, R31, R32 \
) { \
{ L00, L01, L02, L03, L04 }, \
{ L10, L11, L12, L13, L14 }, \
{ L20, L21, L22, L23, L24 }, \
{ XXX, XXX, L32, L33, L34 }, \
{ R04, R03, R02, R01, R00 }, \
{ R14, R13, R12, R11, R10 }, \
{ R24, R23, R22, R21, R20 }, \
{ XXX, XXX, R32, R31, R30 } \
}

// clang-format on
9 changes: 9 additions & 0 deletions keyboards/quokka/readme.md
dlford marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Quokka Keyboard

A split ortholinear keyboard designed for the small handed.

Keyboard Maintainer: [dlford](https://github.com/dlford/), [dlford.io](https://www.dlford.io)

Hardware Supported: Quokka PCB, Adafruit KB2040

Hardware Availability: [PCB, Case Data, and Build Guide](https://github.com/dlford/quokka)
14 changes: 14 additions & 0 deletions keyboards/quokka/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
BOARD = GENERIC_RP_RP2040
CONVERT_TO = kb2040
dlford marked this conversation as resolved.
Show resolved Hide resolved

EXTRAKEY_ENABLE = yes
LTO_ENABLE = yes
RGB_MATRIX_SUPPORTED = yes
RGB_MATRIX_ENABLE = yes
RGB_MATRIX_DRIVER = WS2812
AUDIO_ENABLE = yes
AUDIO_DRIVER = pwm_hardware
OLED_ENABLE = yes
OLED_DRIVER = SSD1306
dlford marked this conversation as resolved.
Show resolved Hide resolved
SPLIT_KEYBOARD = yes
SERIAL_DRIVER = vendor