Skip to content

Commit

Permalink
merge 'splitkb/qmk_firmware/elora`
Browse files Browse the repository at this point in the history
  • Loading branch information
VeyPatch committed Dec 17, 2024
1 parent 98f6bf3 commit 2fb0118
Show file tree
Hide file tree
Showing 17 changed files with 137 additions and 220 deletions.
8 changes: 1 addition & 7 deletions keyboards/splitkb/elora/keymaps/debug/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
bool oled_task_user(void) {
// A 128x32 OLED rotated 90 degrees is 5 characters wide and 16 characters tall
// This example string should fill that neatly
const char *text = PSTR("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123456789!@#$%^&*()[]{}-=_+?");

if (is_keyboard_master()) {
oled_write_P(text, true);
} else {
oled_write_P(text, false);
}
oled_write_P(PSTR("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123456789!@#$%^&*()[]{}-=_+?"), is_keyboard_master());
return false;
}
#endif
5 changes: 0 additions & 5 deletions keyboards/splitkb/elora/keymaps/debug/rules.mk
Original file line number Diff line number Diff line change
@@ -1,7 +1,2 @@
# Copyright 2024 splitkb.com (support@splitkb.com)
# SPDX-License-Identifier: GPL-2.0-or-later

OLED_ENABLE = yes

RGB_MATRIX_ENABLE = no
RGBLIGHT_ENABLE = yes
5 changes: 1 addition & 4 deletions keyboards/splitkb/elora/keymaps/default/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,4 @@
#pragma once

// Myriad boilerplate
#define MYRIAD_ENABLE

// Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed
#define DEBOUNCE 5
#define MYRIAD_ENABLE
4 changes: 2 additions & 2 deletions keyboards/splitkb/elora/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_ADJUST] = LAYOUT_myr(
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, QWERTY , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, DVORAK , _______, _______, _______, _______, RGB_TOG, RGB_SAI, RGB_HUI, RGB_VAI, RGB_MOD, _______,
_______, _______, _______, COLEMAK, _______, _______,_______, _______, _______, _______, _______, RGB_SAD, RGB_HUD, RGB_VAD, RGB_RMOD, _______,
_______, _______, _______, DVORAK , _______, _______, _______, _______, RM_TOGG, RM_SATU, RM_HUEU, RM_VALU, RM_NEXT, _______,
_______, _______, _______, COLEMAK, _______, _______,_______, _______, _______, _______, _______, RM_SATD, RM_HUED, RM_VALD, RM_PREV, _______,
_______, _______, _______,_______, _______, _______, _______, _______, _______, _______,

_______, _______, _______, _______, _______, _______, _______, _______, _______, _______
Expand Down
24 changes: 0 additions & 24 deletions keyboards/splitkb/elora/keymaps/default/rules.mk

This file was deleted.

3 changes: 0 additions & 3 deletions keyboards/splitkb/elora/keymaps/vial/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
// Myriad boilerplate
#define MYRIAD_ENABLE

// Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed
#define DEBOUNCE 5

/// Vial-specific settings

// Increase the EEPROM size for layout options
Expand Down
19 changes: 0 additions & 19 deletions keyboards/splitkb/elora/keymaps/vial/rules.mk
Original file line number Diff line number Diff line change
@@ -1,25 +1,6 @@
# Copyright 2024 splitkb.com (support@splitkb.com)
# SPDX-License-Identifier: GPL-2.0-or-later

## Hardware features

# OLED: optional, can be installed in socket
OLED_ENABLE = yes # Enable OLEDs, `yes` or `no`

# Audio: optional, requires soldering
# The Elora is equipped with a footprint
# for the PKLCS1212E4001-R1
AUDIO_ENABLE = no # Enable audio support, `yes` or `no`

## Software features

# Supported keycodes
MOUSEKEY_ENABLE = yes # Mouse movement using keys
EXTRAKEY_ENABLE = yes # Audio and system control

# N-key rollover instead of 6-key rollover
NKRO_ENABLE = yes # Enable N-Key Rollover

## Vial-specific settings

VIA_ENABLE = yes
Expand Down
26 changes: 22 additions & 4 deletions keyboards/splitkb/elora/readme.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
![Elora](https://i.imgur.com/AUCjyBuh.jpg)

# Elora
TODO TODO
The Elora is a 62-key keyboard, based on the Kyria by splitkb.com. It comes preassembled, is compatible with Vial so you don't need to program or compile your firmware, and accepts Myriad modules so you can add cool features with just a screwdriver.

Keyboard Maintainer: [splitkb.com](https://github.com/splitkb)
Hardware Availability: [splitkb.com](https://splitkb.com).
Expand All @@ -16,10 +18,26 @@ See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_to
You can enter the bootloader in 3 ways:

* **Reset button**: Double-tap the reset button on the side of the PCB.
* **Bootloader reset**: Hold down the "Boot" button and plug in the keyboard.
* **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available.
* **Bootloader reset**: As a last resort, hold down the small "Boot" button near the USB connector while plugging in the keyboard.

# Features
The Elora supports the following features:
The Elora is an evolved version of the Kyria that comes with a number row, and has an emphasis on ease of use for beginners, as well as being hackable for advanced customers. It comes preassembled: the only tool you need is a screwdriver.

- A comfortable 62 keys, including a number row. It's perfect for beginners who want to feel what a split keyboard feels like without the layout feeling cramped, and a nice option for people who know they frequently use the number row, like typists, gamers, some software engineers and Excel warriors.
- Powered by an RP2040 controller, it’s quick enough to handle anything a keyboard should be able to do… and much more.
- 16 megabytes of flash memory ensure that it’s ready for just about everything. Putting a sped-up movie on an RGB display you’ve wired up to your prototyping Myriad module? Say no more.
- Supports MX switches with preassembled hot-swap sockets. No soldering iron needed. You can solder them to the alternative set of pads if you'd prefer to, though.
- Supports Choc switches by soldering. This does require assembly with tools like a soldering iron. Hot swap is still possible using Mill-Max sockets, which too require soldering.
- Subtle RGB underglow with 6 LEDs per half to personalise the colour of your keyboard. It can be disabled for those who don't want it.
- Supports the tenting puck, which allows you to mount it to most camera tripods so you can place your keyboard at exactly the angle you want it.
- Supports up to one Myriad module per half, so you can add a myriad of available modules without having to solder.
- Supports up to one 128x64 pixel OLED display per half, which doesn't require soldering.
- There's a TRRS jack for foot pedal or external switch support. You can use one such switch per half by default, but the wiring supports up to three external switches per half. Great for accessibility purposes, or just plain fun if you want to hook up a digital foot pedal to your voice chat software, game or whatever else you can think of.
- If you're into soldering, you can put up to three encoders per half on seven predefined locations: near the top of the thumb cluster, at the innermost thumb cluster button, or each location on the outer columns. If you don't want to solder, you can of course still use a rotary encoder Myriad module.

# What's Myriad?

![A collection of Myriad modules](https://i.imgur.com/86u7BLMl.jpg)

- TODO TODO TODO
Myriad is a system that allows you to plug in modules to add new functionality to your keyboard, all without having to solder. It's an [open standard](https://myriad.splitkb.com/), meaning that anyone will be able to create their own modules, which you can then plug into your keyboard. It's a very capable standard, so we're very curious to see what other modules you will come up with!
4 changes: 4 additions & 0 deletions keyboards/splitkb/elora/rev1/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
// VBUS detection
#define USB_VBUS_PIN GP25

// Define matrix size
#define MATRIX_COLS 8
#define MATRIX_ROWS 12

// Encoders
// 3 onboard, 1 for Myriad
#define NUM_ENCODERS_LEFT 4
Expand Down
22 changes: 11 additions & 11 deletions keyboards/splitkb/elora/rev1/keyboard.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
{
"keyboard_name": "Elora rev1",
"bootloader": "rp2040",
"encoder": {
"driver": "quadrature",
"enabled": true
},
"features": {
"pointing_device": true,
"rgb_matrix": true,
"rgblight": false
},
"matrix_size": {
"cols": 8,
"rows": 12
"rgblight": false,
"encoder": true,
"oled": true,
"extrakey": true,
"mousekey": true,
"nkro": true,
"audio": false
},
"processor": "RP2040",
"rgb_matrix": {
Expand Down Expand Up @@ -93,7 +91,9 @@
"driver": "usart"
},
"transport": {
"protocol": "serial",
"sync": {
"matrix_state": true
},
"watchdog": true,
"watchdog_timeout": 3000
}
Expand All @@ -105,4 +105,4 @@
"driver": "vendor",
"pin": "GP15"
}
}
}
57 changes: 57 additions & 0 deletions keyboards/splitkb/elora/rev1/matrix.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
// Copyright 2024 splitkb.com (support@splitkb.com)
// SPDX-License-Identifier: GPL-2.0-or-later

#include "matrix.h"
#include "spi_master.h"

// The matrix is hooked up to a chain of 74xx165 shift registers.
// Pin F0 acts as Chip Select (active-low)
// The signal goes to a NOT gate, whose output is wired to
// a) the latch pin of the shift registers
// b) the "enable" pin of a tri-state buffer,
// attached between the shift registers and MISO
// F0 has an external pull-up.
// SCK works as usual.
//
// Note that the matrix contains a variety of data.
// In addition to the keys, it also reads the rotary encoders
// and whether the board is the left/right half.

void matrix_init_custom(void) {
// Note: `spi_init` has already been called
// in `keyboard_pre_init_kb()`, so nothing to do here
}

bool matrix_scan_custom(matrix_row_t current_matrix[]) {
// Enough to hold the shift registers
uint16_t length = 5;
uint8_t data[length];

// Matrix SPI config
// 1) Pin
// 2) Mode: Register shifts on rising clock, and clock idles low
// pol = 0 & pha = 0 => mode 0
// 3) LSB first: Register outputs H first, and we want H as MSB,
// as this result in a neat A-H order in the layout macro.
// 4) Divisor: 2 is the fastest possible, at Fclk / 2.
// range is 2-128
spi_start(GP13, false, 0, 128);
spi_receive(data, length);
spi_stop();

bool matrix_has_changed = false;
for (uint8_t i = 0; i < length; i++) {
// Bitwise NOT because we use pull-ups,
// and switches short the pin to ground,
// but the matrix uses 1 to indicate a pressed switch
uint8_t word = ~data[i];
matrix_has_changed |= current_matrix[i] ^ word;
current_matrix[i] = word;
}
#ifdef MYRIAD_ENABLE
bool myriad_hook_matrix(matrix_row_t current_matrix[]);
return matrix_has_changed || myriad_hook_matrix(current_matrix);
#else
return matrix_has_changed;
#endif
}
20 changes: 1 addition & 19 deletions keyboards/splitkb/elora/rev1/myriad.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,22 +312,4 @@ report_mouse_t pointing_device_driver_get_report(report_mouse_t mouse_report) {
void pointing_device_driver_init(void) {
gpio_set_pin_input(MYRIAD_ADC1); // Y
gpio_set_pin_input(MYRIAD_ADC2); // X
}

void myriad_task(void) {
myriad_card_t card = myriad_card_init();

switch (card) {
case SKB_SWITCHES:
// Handled via hook
break;
case SKB_ENCODER:
// Handled via hook
break;
case SKB_JOYSTICK:
// Handled via pointing_device_driver_get_report
break;
default:
break;
}
}
}
69 changes: 32 additions & 37 deletions keyboards/splitkb/elora/rev1/myriad.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,55 +3,50 @@

#pragma once

typedef enum {
UNINITIALIZED,
NONE,
INVALID,
UNKNOWN,
SKB_SWITCHES,
SKB_ENCODER,
SKB_JOYSTICK
} myriad_card_t;

void myriad_task(void);
bool myriad_hook_matrix(matrix_row_t current_matrix[]);
uint8_t myriad_hook_encoder(uint8_t index, bool pad_b);
#include <stdint.h>
#include <stdbool.h>
#include "matrix.h"

typedef enum { UNINITIALIZED, NONE, INVALID, UNKNOWN, SKB_SWITCHES, SKB_ENCODER, SKB_JOYSTICK } myriad_card_t;

bool myriad_hook_matrix(matrix_row_t current_matrix[]);
uint8_t myriad_hook_encoder(uint8_t index, bool pad_b);
myriad_card_t detect_myriad(void);

//// Elora-specific pinout

// Control signals
#define MYRIAD_PRESENT GP3
#define MYRIAD_MCU_OVERRIDE GP2
#define MYRIAD_PRESENT GP3
#define MYRIAD_MCU_OVERRIDE GP2

// General I/O
#define MYRIAD_ADC1 GP26
#define MYRIAD_ADC2 GP27
#define MYRIAD_ADC1_CHANNEL 0
#define MYRIAD_ADC2_CHANNEL 1
#define MYRIAD_PWM1 GP23
#define MYRIAD_PWM2 GP24
#define MYRIAD_GPIO1 GP4
#define MYRIAD_GPIO2 GP5
#define MYRIAD_GPIO3 GP6
#define MYRIAD_GPIO4 GP8
#define MYRIAD_ADC1 GP26
#define MYRIAD_ADC2 GP27
#define MYRIAD_ADC1_CHANNEL 0
#define MYRIAD_ADC2_CHANNEL 1
#define MYRIAD_PWM1 GP23
#define MYRIAD_PWM2 GP24
#define MYRIAD_GPIO1 GP4
#define MYRIAD_GPIO2 GP5
#define MYRIAD_GPIO3 GP6
#define MYRIAD_GPIO4 GP8

// UART
#define MYRIAD_RX GP17
#define MYRIAD_TX GP16
#define MYRIAD_CTS GP18
#define MYRIAD_RTS GP19
#define MYRIAD_RX GP17
#define MYRIAD_TX GP16
#define MYRIAD_CTS GP18
#define MYRIAD_RTS GP19

// SPI
#define MYRIAD_MISO GP12
#define MYRIAD_MOSI GP11
#define MYRIAD_SCK GP10
#define MYRIAD_MODULE_CS GP9
#define MYRIAD_MATRIX_CS GP13
#define MYRIAD_MISO GP12
#define MYRIAD_MOSI GP11
#define MYRIAD_SCK GP10
#define MYRIAD_MODULE_CS GP9
#define MYRIAD_MATRIX_CS GP13

// I2C
#define MYRIAD_SDA GP0
#define MYRIAD_SCL GP1
#define MYRIAD_SDA GP0
#define MYRIAD_SCL GP1

// RGB
#define MYRIAD_RGB GP15
#define MYRIAD_RGB GP15
Loading

0 comments on commit 2fb0118

Please sign in to comment.