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

New Keyboard: HexBoard #22493

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
HexBoard: start new keyboard
  • Loading branch information
earboxer committed Jun 18, 2024
commit d86dbd44efb4243521051d0fb55cfe83ab1962e0
5 changes: 5 additions & 0 deletions keyboards/hexboard/1_1/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Copyright 2023 Zach DeCook
// SPDX-License-Identifier: GPL-3.0-only
#pragma once

#define OLED_DISPLAY_128X128
earboxer marked this conversation as resolved.
Show resolved Hide resolved
446 changes: 446 additions & 0 deletions keyboards/hexboard/1_1/info.json
earboxer marked this conversation as resolved.
Show resolved Hide resolved

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions keyboards/hexboard/1_1/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
SRC += matrix.c
CUSTOM_MATRIX = lite

AUDIO_DRIVER = pwm_hardware
36 changes: 36 additions & 0 deletions keyboards/hexboard/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Copyright 2023 Zach DeCook
// SPDX-License-Identifier: GPL-3.0-only
#pragma once

#define RP2040_FLASH_GENERIC_03H
earboxer marked this conversation as resolved.
Show resolved Hide resolved

// WS2812_BYTE_ORDER defined by revision
#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 150
#define RGB_MATRIX_LED_COUNT 140
#define ENABLE_RGB_MATRIX_SOLID_COLOR
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE
#define ENABLE_RGB_MATRIX_PIXEL_FRACTAL
#define ENABLE_RGB_MATRIX_BREATHING
// #define ENABLE_RGB_MATRIX_MULTISPLASH
#define ENABLE_RGB_MATRIX_SOLID_SPLASH
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS
// #define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS

#define AUDIO_PIN GP23
// From the data sheet, pin 23 is PWM3 B
#define AUDIO_PWM_DRIVER PWMD3
#define AUDIO_PWM_CHANNEL RP2040_PWM_CHANNEL_B
#define AUDIO_INIT_DELAY
#define AUDIO_ENABLE_TONE_MULTIPLEXING
#define AUDIO_TONE_MULTIPLEXING_RATE_DEFAULT 50

// From the data sheet, pins 16/17 can use I2C0 DA/CL
#define I2C_DRIVER I2CD0
// (The name of these defines is confusing...)
#define I2C1_SDA_PIN GP16
#define I2C1_SCL_PIN GP17
#define OLED_BRIGHTNESS 55
#define OLED_IC OLED_IC_SH1106
// OLED_DISPLAY_ defined by revision

#define ENCODER_DEFAULT_POS 0x3
11 changes: 11 additions & 0 deletions keyboards/hexboard/dev/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Copyright 2023 Zach DeCook
// SPDX-License-Identifier: GPL-3.0-only
#pragma once

// The dev unit had a different pixel order
earboxer marked this conversation as resolved.
Show resolved Hide resolved
#define WS2812_BYTE_ORDER WS2812_BYTE_ORDER_RGB

// The dev unit used a smaller display
#define OLED_DISPLAY_128X64
// Needs to be shifted over
#define OLED_COLUMN_OFFSET 2
10 changes: 10 additions & 0 deletions keyboards/hexboard/dev/dev.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Copyright 2022-2023 Zach DeCook
// SPDX-License-Identifier: GPL-3.0-only

#include "quantum.h"

#ifdef OLED_ENABLE
oled_rotation_t oled_init_kb(oled_rotation_t rotation) {
return OLED_ROTATION_180;
}
#endif
446 changes: 446 additions & 0 deletions keyboards/hexboard/dev/info.json
earboxer marked this conversation as resolved.
Show resolved Hide resolved

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions keyboards/hexboard/dev/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
SRC += matrix.c
CUSTOM_MATRIX = lite

AUDIO_DRIVER = pwm_hardware
11 changes: 11 additions & 0 deletions keyboards/hexboard/halconf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Copyright 2022 Stefan Kerkmann
// SPDX-License-Identifier: GPL-3.0-only

#pragma once

#undef HAL_USE_I2C
#define HAL_USE_I2C TRUE
earboxer marked this conversation as resolved.
Show resolved Hide resolved
#undef HAL_USE_PWM
#define HAL_USE_PWM TRUE

#include_next <halconf.h>
32 changes: 32 additions & 0 deletions keyboards/hexboard/hexboard.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Copyright 2022-2023 Zach DeCook
// SPDX-License-Identifier: GPL-3.0-only

#include "quantum.h"

bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
#ifdef AUDIO_ENABLE
case QK_MIDI_NOTE_C_0 ... QK_MIDI_NOTE_B_5:
if (record->event.pressed)
process_audio_noteon(keycode - MI_C);
else
process_audio_noteoff(keycode - MI_C);
// Allow the normal handler to handle it as well.
return true;
#endif
}
return process_record_user(keycode, record);
}

#ifdef OLED_ENABLE
bool oled_task_kb(void) {
if (!oled_task_user()) {
return false;
}
oled_write_P(PSTR("HexBoard running QMK\n"), false);
oled_write_P(PSTR("\n"), false);
oled_write_P(PSTR("FW is GPLv3-licensed\n"), false);
oled_write_P(PSTR("https://qmk.fm/\n"), false);
return false;
}
#endif
40 changes: 40 additions & 0 deletions keyboards/hexboard/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"manufacturer": "Shaping The Silence",
"keyboard_name": "HexBoard",
"maintainer": "earboxer",
"audio": {
"pins": ["GP23"],
"voices": true
},
"board": "GENERIC_RP_RP2040",
"bootloader": "rp2040",
"diode_direction": "COL2ROW",
"encoder": {
"rotary": [
{"pin_a": "GP21", "pin_b": "GP20"}
]
},
"features": {
"audio": true,
"bootmagic": true,
"encoder": true,
"extrakey": true,
"midi": true,
"mousekey": true,
"oled": true,
"rgb_matrix": true
},
"matrix_size": {
"cols": 10,
"rows": 14
},
earboxer marked this conversation as resolved.
Show resolved Hide resolved
"processor": "RP2040",
"rgb_matrix": {
"driver": "ws2812"
},
"url": "https://shapingthesilence.com",
earboxer marked this conversation as resolved.
Show resolved Hide resolved
"ws2812": {
"driver": "vendor",
"pin": "GP22"
}
}
55 changes: 55 additions & 0 deletions keyboards/hexboard/keymaps/default/keymap.c
earboxer marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
// Copyright 2022-2023 Zach DeCook
// SPDX-License-Identifier: GPL-3.0-only

#include QMK_KEYBOARD_H

#if defined(ENCODER_MAP_ENABLE)
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
[0] = {ENCODER_CCW_CW(KC_VOLD, KC_VOLU),},
[1] = {ENCODER_CCW_CW(KC_BRID, KC_BRIU),},

};
#endif

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT_landscape(
_______,_______,RGB_HUI,
MO(1), _______,RGB_VAD,RGB_MOD,

_______,_______,_______,KC_EQL ,_______,_______,KC_PGUP,
_______,_______,KC_LBRC,KC_RBRC,_______,KC_HOME,KC_END ,
_______,_______,_______,KC_MINS,_______,_______,KC_PGDN,
_______,KC_F15 ,_______,_______,KC_F20 ,_______,_______,
_______,KC_F14 ,KC_F16 ,_______,KC_F19 ,KC_F21 ,_______,
KC_F13 ,KC_F3 ,KC_F17 ,KC_F18 ,KC_F8 ,KC_F22 ,_______,
_______,KC_F2 ,KC_F4 ,_______,KC_F7 ,KC_F9 ,KC_F23 ,
KC_F1 ,KC_3 ,KC_F5 ,KC_F6 ,KC_8 ,KC_F10 ,KC_F24 ,
_______,KC_2 ,KC_4 ,_______,KC_7 ,KC_9 ,KC_F11 ,
KC_1 ,KC_E ,KC_5 ,KC_6 ,KC_I ,KC_0 ,KC_F12 ,
KC_TAB ,KC_W ,KC_R ,_______,KC_U ,KC_O ,KC_BSPC,
KC_Q ,KC_D , KC_T ,KC_Y ,KC_K ,KC_P ,_______,
KC_ESC ,KC_S ,KC_F ,_______,KC_J ,KC_L ,KC_QUOT,
KC_A ,KC_C ,KC_G ,KC_H ,KC_COMM,KC_SCLN,KC_SLSH,
KC_LSFT,KC_X ,KC_V ,_______,KC_M ,KC_DOT ,KC_ENT ,
KC_Z ,_______,KC_B ,KC_N ,_______,KC_SLSH,_______,
_______,_______,_______,_______,_______,_______,KC_UP ,
KC_LCTL,KC_LGUI,_______,_______,KC_RALT,KC_LEFT,KC_RGHT,
_______,KC_LALT,MO(1) ,KC_SPC ,KC_RGUI,KC_RCTL,KC_DOWN
),
[1] = LAYOUT_portrait(
_______, _______,_______,_______,_______,_______,_______,_______,_______,_______,
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,
_______, _______,_______,_______,_______,_______,_______,_______,_______,_______,
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,
_______, _______,_______,_______,_______,_______,_______,_______,_______,_______,
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,
_______, _______,_______,_______,_______,_______,_______,_______,_______,_______,
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,
_______, _______,_______,_______,_______,_______,_______,_______,_______,_______,
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,
_______, _______,_______,_______,_______,_______,_______,_______,_______,_______,
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 ,
SFT_T(KC_SPC),KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,KC_B ,KC_N ,KC_M ,RCTL_T(KC_COMM)
),
};
2 changes: 2 additions & 0 deletions keyboards/hexboard/keymaps/default/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ENCODER_MAP_ENABLE = yes
MIDI_ENABLE = no
5 changes: 5 additions & 0 deletions keyboards/hexboard/keymaps/keyboard/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Copyright 2023 Zach DeCook
// SPDX-License-Identifier: GPL-3.0-only
#pragma once

#define MIDI_BASIC
earboxer marked this conversation as resolved.
Show resolved Hide resolved
Loading