Add printedpad keyboard (#21202)
Co-authored-by: jack <0x6a73@protonmail.com> Co-authored-by: Drashna Jaelre <drashna@live.com>
This commit is contained in:
parent
2a8b3a809d
commit
92873cc14f
15
keyboards/printedpad/config.h
Normal file
15
keyboards/printedpad/config.h
Normal file
@ -0,0 +1,15 @@
|
||||
// Copyright 2023 Noah Beidelman (@noahbei)
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#define I2C_DRIVER I2CD1
|
||||
#define I2C1_SCL_PAL_MODE 1
|
||||
#define I2C1_SDA_PAL_MODE 1
|
||||
#define I2C1_TIMINGR_PRESC 0x00U
|
||||
#define I2C1_TIMINGR_SCLDEL 0x03U
|
||||
#define I2C1_TIMINGR_SDADEL 0x01U
|
||||
#define I2C1_TIMINGR_SCLH 0x03U
|
||||
#define I2C1_TIMINGR_SCLL 0x09U
|
||||
|
||||
#define OLED_TIMEOUT 300000
|
8
keyboards/printedpad/halconf.h
Normal file
8
keyboards/printedpad/halconf.h
Normal file
@ -0,0 +1,8 @@
|
||||
// Copyright 2023 Noah Beidelman (@noahbei)
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#define HAL_USE_I2C TRUE
|
||||
|
||||
#include_next <halconf.h>
|
46
keyboards/printedpad/info.json
Normal file
46
keyboards/printedpad/info.json
Normal file
@ -0,0 +1,46 @@
|
||||
{
|
||||
"manufacturer": "Prota Designs",
|
||||
"keyboard_name": "Printed Pad",
|
||||
"maintainer": "noahbei",
|
||||
"bootloader": "stm32-dfu",
|
||||
"diode_direction": "COL2ROW",
|
||||
"features": {
|
||||
"bootmagic": true,
|
||||
"command": false,
|
||||
"console": false,
|
||||
"extrakey": true,
|
||||
"mousekey": true,
|
||||
"nkro": true,
|
||||
"oled": true
|
||||
},
|
||||
"matrix_pins": {
|
||||
"cols": ["B2", "B1", "B0"],
|
||||
"rows": ["A10", "C9", "A8", "A9"]
|
||||
},
|
||||
"processor": "STM32F072",
|
||||
"url": "",
|
||||
"usb": {
|
||||
"device_version": "1.0.0",
|
||||
"pid": "0x0001",
|
||||
"vid": "0x5044"
|
||||
},
|
||||
"layouts": {
|
||||
"LAYOUT": {
|
||||
"layout": [
|
||||
{ "matrix": [0, 0], "x": 0, "y": 0 },
|
||||
|
||||
{ "matrix": [1, 0], "x": 0, "y": 1 },
|
||||
{ "matrix": [1, 1], "x": 1, "y": 1 },
|
||||
{ "matrix": [1, 2], "x": 2, "y": 1 },
|
||||
|
||||
{ "matrix": [2, 0], "x": 0, "y": 2 },
|
||||
{ "matrix": [2, 1], "x": 1, "y": 2 },
|
||||
{ "matrix": [2, 2], "x": 2, "y": 2 },
|
||||
|
||||
{ "matrix": [3, 0], "x": 0, "y": 3 },
|
||||
{ "matrix": [3, 1], "x": 1, "y": 3 },
|
||||
{ "matrix": [3, 2], "x": 2, "y": 3 }
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
45
keyboards/printedpad/keymaps/default/keymap.c
Normal file
45
keyboards/printedpad/keymaps/default/keymap.c
Normal file
@ -0,0 +1,45 @@
|
||||
// Copyright 2023 Noah Beidelman (@noahbei)
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/*
|
||||
* ┌───┐
|
||||
* │Tog│
|
||||
* ├───┼───┬───┐
|
||||
* │ 7 │ 8 │ 9 │
|
||||
* ├───┼───┼───┤
|
||||
* │ 4 │ 5 │ 6 │
|
||||
* ├───┼───┼───┤
|
||||
* │ 1 │ 2 │ 3 │
|
||||
* └───┴───┴───┘
|
||||
*/
|
||||
[0] = LAYOUT(
|
||||
LT(0, KC_NO),
|
||||
KC_7, KC_8, KC_9,
|
||||
KC_4, KC_5, KC_6,
|
||||
KC_1, KC_2, KC_3
|
||||
),
|
||||
|
||||
[1] = LAYOUT(
|
||||
LT(0, KC_NO),
|
||||
KC_A, KC_B, KC_C,
|
||||
KC_D, KC_E, KC_F,
|
||||
KC_G, KC_H, KC_I
|
||||
),
|
||||
|
||||
[2] = LAYOUT(
|
||||
LT(0, KC_NO),
|
||||
KC_J, KC_K, KC_L,
|
||||
KC_M, KC_N, KC_O,
|
||||
KC_P, KC_Q, KC_R
|
||||
),
|
||||
|
||||
[3] = LAYOUT(
|
||||
LT(0, KC_NO),
|
||||
KC_S, KC_T, KC_U,
|
||||
KC_V, KC_W, KC_X,
|
||||
KC_Y, KC_Z, KC_ENT
|
||||
)
|
||||
};
|
45
keyboards/printedpad/keymaps/via/keymap.c
Normal file
45
keyboards/printedpad/keymaps/via/keymap.c
Normal file
@ -0,0 +1,45 @@
|
||||
// Copyright 2023 Noah Beidelman (@noahbei)
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/*
|
||||
* ┌───┐
|
||||
* │Tog│
|
||||
* ├───┼───┬───┐
|
||||
* │ 7 │ 8 │ 9 │
|
||||
* ├───┼───┼───┤
|
||||
* │ 4 │ 5 │ 6 │
|
||||
* ├───┼───┼───┤
|
||||
* │ 1 │ 2 │ 3 │
|
||||
* └───┴───┴───┘
|
||||
*/
|
||||
[0] = LAYOUT(
|
||||
LT(0, KC_NO),
|
||||
KC_7, KC_8, KC_9,
|
||||
KC_4, KC_5, KC_6,
|
||||
KC_1, KC_2, KC_3
|
||||
),
|
||||
|
||||
[1] = LAYOUT(
|
||||
LT(0, KC_NO),
|
||||
KC_A, KC_B, KC_C,
|
||||
KC_D, KC_E, KC_F,
|
||||
KC_G, KC_H, KC_I
|
||||
),
|
||||
|
||||
[2] = LAYOUT(
|
||||
LT(0, KC_NO),
|
||||
KC_J, KC_K, KC_L,
|
||||
KC_M, KC_N, KC_O,
|
||||
KC_P, KC_Q, KC_R
|
||||
),
|
||||
|
||||
[3] = LAYOUT(
|
||||
LT(0, KC_NO),
|
||||
KC_S, KC_T, KC_U,
|
||||
KC_V, KC_W, KC_X,
|
||||
KC_Y, KC_Z, KC_ENT
|
||||
)
|
||||
};
|
1
keyboards/printedpad/keymaps/via/rules.mk
Normal file
1
keyboards/printedpad/keymaps/via/rules.mk
Normal file
@ -0,0 +1 @@
|
||||
VIA_ENABLE = yes
|
9
keyboards/printedpad/mcuconf.h
Normal file
9
keyboards/printedpad/mcuconf.h
Normal file
@ -0,0 +1,9 @@
|
||||
// Copyright 2023 Noah Beidelman (@noahbei)
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include_next <mcuconf.h>
|
||||
|
||||
#undef STM32_I2C_USE_I2C1
|
||||
#define STM32_I2C_USE_I2C1 TRUE
|
1420
keyboards/printedpad/oled.c
Normal file
1420
keyboards/printedpad/oled.c
Normal file
File diff suppressed because it is too large
Load Diff
57
keyboards/printedpad/printedpad.c
Normal file
57
keyboards/printedpad/printedpad.c
Normal file
@ -0,0 +1,57 @@
|
||||
// Copyright 2023 Noah Beidelman (@noahbei)
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include QMK_KEYBOARD_H
|
||||
#include "printedpad.h"
|
||||
|
||||
void board_init(void) {
|
||||
SYSCFG->CFGR1 |= SYSCFG_CFGR1_I2C1_DMA_RMP;
|
||||
}
|
||||
|
||||
const uint8_t max_layer = 3;
|
||||
uint8_t current_display_mode = 0;
|
||||
|
||||
bool key_pressed = false;
|
||||
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
if (!process_record_user(keycode, record)) {
|
||||
return false;
|
||||
}
|
||||
#ifdef OLED_ENABLE
|
||||
key_pressed = record->event.pressed;
|
||||
#endif
|
||||
switch(keycode) {
|
||||
case LT(0, KC_NO):
|
||||
if (record->event.pressed) {
|
||||
// on tap
|
||||
if (record->tap.count) {
|
||||
if (get_highest_layer(layer_state) >= max_layer) {
|
||||
layer_clear();
|
||||
} else {
|
||||
layer_move(get_highest_layer(layer_state) + 1);
|
||||
}
|
||||
}
|
||||
#ifdef OLED_ENABLE
|
||||
// on hold
|
||||
else {
|
||||
current_display_mode = (current_display_mode + 1) % 3;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifdef OLED_ENABLE
|
||||
uint32_t flash_timer = 0;
|
||||
bool layer_changed = false;
|
||||
|
||||
// when the layer is changed, flash the layer number on the screen
|
||||
layer_state_t layer_state_set_kb(layer_state_t state) {
|
||||
flash_timer = timer_read();
|
||||
layer_changed = true;
|
||||
|
||||
return layer_state_set_user(state);
|
||||
}
|
||||
#endif
|
16
keyboards/printedpad/printedpad.h
Normal file
16
keyboards/printedpad/printedpad.h
Normal file
@ -0,0 +1,16 @@
|
||||
// Copyright 2023 Noah Beidelman (@noahbei)
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "quantum.h"
|
||||
|
||||
//for oled key press
|
||||
extern bool key_pressed;
|
||||
|
||||
// for changing oled display mode
|
||||
extern uint8_t current_display_mode;
|
||||
|
||||
//for determining when the layer is changed and having a timer for how long we flash the layer
|
||||
extern uint32_t flash_timer;
|
||||
extern bool layer_changed;
|
25
keyboards/printedpad/readme.md
Normal file
25
keyboards/printedpad/readme.md
Normal file
@ -0,0 +1,25 @@
|
||||
# Printed Pad
|
||||
|
||||
![magtray4x3](https://i.imgur.com/TBpZzIoh.jpeg)
|
||||
|
||||
* Keyboard Maintainer: [noahbei](https://github.com/noahbei)
|
||||
* Hardware Supported: STM32F072RBT6
|
||||
* Hardware Availability: https://protadesigns.com/products/printed-pad
|
||||
|
||||
Make example for this keyboard (after setting up your build environment):
|
||||
|
||||
make printedpad:default
|
||||
|
||||
Flashing example for this keyboard:
|
||||
|
||||
make printedpad:default:flash
|
||||
|
||||
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).
|
||||
|
||||
## Bootloader
|
||||
|
||||
Enter the bootloader in 3 ways:
|
||||
|
||||
* **Bootmagic reset**: Hold down the key at (0,0) in the matrix (usually the top left key or Escape) and plug in the keyboard
|
||||
* **Physical reset button**: Briefly press the button on the back of the PCB - some may have pads you must short instead
|
||||
* **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available
|
1
keyboards/printedpad/rules.mk
Normal file
1
keyboards/printedpad/rules.mk
Normal file
@ -0,0 +1 @@
|
||||
SRC += oled.c
|
Loading…
Reference in New Issue
Block a user