Compare commits

...

15 Commits

Author SHA1 Message Date
Blake
2cac2d74c7
Merge 60f6f30808 into 9bea332a21 2024-11-20 22:22:13 -08:00
Ryan
9bea332a21
qmk via2json: Improve macro parsing (#24345) 2024-11-21 17:20:05 +11:00
Ryan
8cbcdcac62
qmk new-keymap: validate keymap name (#23420) 2024-11-21 17:18:51 +11:00
Blake Drayson
60f6f30808 Moving LT(0, x) overrides to keymap level 2024-10-15 19:40:21 +01:00
Blake Drayson
7bf782d9d6 halconf rename and matching QK_USER in daisy_v2.c 2024-10-15 14:00:55 +01:00
Blake
aedf860574
Update keyboards/draytronics/daisy_v2/keymaps/default/keymap.c
Co-authored-by: Ryan <fauxpark@gmail.com>
2024-10-15 13:57:25 +01:00
Blake
660d5f3c18
Update keyboards/draytronics/daisy_v2/readme.md
Co-authored-by: Ryan <fauxpark@gmail.com>
2024-10-15 13:48:07 +01:00
Blake Drayson
67a6dfe9ed Fixed encoder direction flip, with pin change and moved encoder map enable to keymap level. 2024-08-31 16:00:32 +01:00
Blake
65e0672a07
Update keyboards/draytronics/daisy_v2/config.h
Co-authored-by: Ryan <fauxpark@gmail.com>
2024-08-31 15:48:14 +01:00
Blake Drayson
65c2f158d8 Flip the direction of encoders correctly in config.h 2024-08-31 14:40:23 +01:00
Blake Drayson
0eaace20c1 Conversion to Encoder Map 2024-08-31 14:18:49 +01:00
Blake
aa3029b4df
Update keyboards/draytronics/daisy_v2/halconfig.h
Co-authored-by: Ryan <fauxpark@gmail.com>
2024-08-31 13:56:41 +01:00
Blake
1bd59415ed
Update keyboards/draytronics/daisy_v2/keyboard.json
Co-authored-by: Ryan <fauxpark@gmail.com>
2024-08-31 13:56:33 +01:00
Blake
dfd8d78b61
Update keyboards/draytronics/daisy_v2/keyboard.json
Co-authored-by: Ryan <fauxpark@gmail.com>
2024-08-31 13:56:26 +01:00
Blake Drayson
89d87c8386 New Daisy V2 Macropad 2024-06-13 16:25:31 +01:00
12 changed files with 2818 additions and 9 deletions

View File

@ -0,0 +1,45 @@
/*Copyright 2024 Blake Drayson / Draytronics
Contact info@draytronics.co.uk
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/>.
This code is inspired by and adapted from the code used in the Printed Pad by Noah Beidelman (@noahbei)
It also references the concept of glitching animations from Aleks (@aleksbrgt)
The pixel graphics used here are from a combination of sources;
1. Layer indicators are created by myself and free to use by anyone.
2. "Revengeday", "Cyber Cafe", "Cortex Implant" logos are used with kind permission of OBEY THE SYSTEM.
A collective of Fediverse instances and creatives. https://git.cyberwa.re/obey-the-system.
They are licenced as Non-Commercial and for use by members of the network, with attribution.
3. Key press indicator graphics were commissioned for this project and were designed by the
amazing https://corteximplant.com/@jadedtwin / https://www.jadedtwin.com/
*/
#pragma once
// Config for the STM32F072 to configure the OLED display via I2C.
#define I2C_DRIVER I2CD1
#define I2C1_SCL_PIN B8
#define I2C1_SDA_PIN B9
#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

View File

@ -0,0 +1,35 @@
/*Copyright 2024 Blake Drayson / Draytronics
Contact info@draytronics.co.uk
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/>.
This code is inspired by and adapted from the code used in the Printed Pad by Noah Beidelman (@noahbei)
It also references the concept of glitching animations from Aleks (@aleksbrgt)
The pixel graphics used here are from a combination of sources;
1. Layer indicators are created by myself and free to use by anyone.
2. "Revengeday", "Cyber Cafe", "Cortex Implant" logos are used with kind permission of OBEY THE SYSTEM.
A collective of Fediverse instances and creatives. https://git.cyberwa.re/obey-the-system.
They are licenced as Non-Commercial and for use by members of the network, with attribution.
3. Key press indicator graphics were commissioned for this project and were designed by the
amazing https://corteximplant.com/@jadedtwin / https://www.jadedtwin.com/
*/
#include "quantum.h"
void board_init(void) {
SYSCFG->CFGR1 |= SYSCFG_CFGR1_I2C1_DMA_RMP;
}

View File

@ -0,0 +1,35 @@
/*Copyright 2024 Blake Drayson / Draytronics
Contact info@draytronics.co.uk
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/>.
This code is inspired by and adapted from the code used in the Printed Pad by Noah Beidelman (@noahbei)
It also references the concept of glitching animations from Aleks (@aleksbrgt)
The pixel graphics used here are from a combination of sources;
1. Layer indicators are created by myself and free to use by anyone.
2. "Revengeday", "Cyber Cafe", "Cortex Implant" logos are used with kind permission of OBEY THE SYSTEM.
A collective of Fediverse instances and creatives. https://git.cyberwa.re/obey-the-system.
They are licenced as Non-Commercial and for use by members of the network, with attribution.
3. Key press indicator graphics were commissioned for this project and were designed by the
amazing https://corteximplant.com/@jadedtwin / https://www.jadedtwin.com/
*/
#pragma once
#define HAL_USE_I2C TRUE
#include_next <halconf.h>

View File

@ -0,0 +1,67 @@
{
"manufacturer": "Draytronics",
"keyboard_name": "DAISY",
"maintainer": "ghostseven",
"bootloader": "stm32-dfu",
"diode_direction": "COL2ROW",
"encoder": {
"enabled": true,
"rotary": [
{"pin_a": "A14", "pin_b": "A15"}
]
},
"features": {
"bootmagic": true,
"encoder": true,
"extrakey": true,
"mousekey": true,
"oled": true,
"rgblight": true
},
"matrix_pins": {
"cols": ["B11", "B10", "B2", "B1"],
"rows": ["A2", "A1", "A0"]
},
"processor": "STM32F072",
"qmk": {
"tap_keycode_delay": 10
},
"rgblight": {
"led_count": 4,
"animations": {
"breathing": true,
"rainbow_mood": true,
"rainbow_swirl": true,
"snake": true,
"knight": true,
"christmas": true,
"static_gradient": true,
"alternating": true,
"twinkle": true
}
},
"url": "https://www.draytronics.co.uk/daisy",
"usb": {
"device_version": "2.0.0",
"pid": "0x4441",
"vid": "0x4454"
},
"ws2812": {
"pin": "B12"
},
"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": [1, 3], "x": 3, "y": 1},
{"matrix": [2, 0], "x": 0, "y": 2},
{"matrix": [2, 1], "x": 1, "y": 2},
{"matrix": [2, 2], "x": 2, "y": 2},
{"matrix": [2, 3], "x": 3, "y": 2}
]
}
}
}

View File

@ -0,0 +1,118 @@
/*Copyright 2024 Blake Drayson / Draytronics
Contact info@draytronics.co.uk
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/>.
This code is inspired by and adapted from the code used in the Printed Pad by Noah Beidelman (@noahbei)
It also references the concept of glitching animations from Aleks (@aleksbrgt)
The pixel graphics used here are from a combination of sources;
1. Layer indicators are created by myself and free to use by anyone.
2. "Revengeday", "Cyber Cafe", "Cortex Implant" logos are used with kind permission of OBEY THE SYSTEM.
A collective of Fediverse instances and creatives. https://git.cyberwa.re/obey-the-system.
They are licenced as Non-Commercial and for use by members of the network, with attribution.
3. Key press indicator graphics were commissioned for this project and were designed by the
amazing https://corteximplant.com/@jadedtwin / https://www.jadedtwin.com/
*/
#include QMK_KEYBOARD_H
enum layers {
_BASE,
_CODE
};
enum my_keycodes {
ENCODER_PRESS = QK_USER,
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/*
*
* * See Note *
*
* Code Layer Media Next Media Prev Media Pause
*
* Prev Desk Miss Ctrl App Window Next Desk
*
*/
[_BASE] = LAYOUT(
LT(0, ENCODER_PRESS),
MO(_CODE), KC_MPRV, KC_MNXT, KC_MPLY,
C(KC_LEFT), C(KC_UP), C(KC_DOWN), C(KC_RIGHT)
),
/*
*
* * See Note *
*
* RGB Mode RBG Hue RGB Toggle
*
* Scrn Shot Force Quit GUI + F DFU Mode
*
*/
[_CODE] = LAYOUT(
LT(0, ENCODER_PRESS),
_______, RGB_MOD, RGB_HUI, RGB_TOG,
G(S(KC_5)), G(A(KC_ESC)), G(KC_F), QK_BOOT
)
/*
* See Note *
* Tapping on the rotary encoder switch will mute or unmute the volume.
* Pressing and holding will cycle through the OLED modes, they are as follows;
* 1. Layer indicator
* 2. Revengeday glitch logo
* 3. Cyber Cafe glitch logo
* 4. Cortex Implant glitch logo
* 5. Key press animation.
*
* By default the rotary encoder itself will adjust the volume but it can be adjusted by changing the encoder_update_user function.
*/
};
#if defined(ENCODER_MAP_ENABLE)
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
[_BASE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
[_CODE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
};
#endif
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch(keycode) {
case LT(0, ENCODER_PRESS):
if (record->event.pressed) {
// on tap
if (record->tap.count) {
tap_code(KC_MUTE);
}
#ifdef OLED_ENABLE
// on hold
else {
void oled_display_mode_step(void);
oled_display_mode_step();
// hidden = false;
// current_display_mode = (current_display_mode + 1) % 5;
// // When mode changes update EEPROM.
// kb_config.oled_mode = current_display_mode;
// eeconfig_update_kb(kb_config.raw);
}
#endif
}
return false;
}
return true;
}

View File

@ -0,0 +1 @@
ENCODER_MAP_ENABLE = yes

View File

@ -0,0 +1,36 @@
/*Copyright 2024 Blake Drayson / Draytronics
Contact info@draytronics.co.uk
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/>.
This code is inspired by and adapted from the code used in the Printed Pad by Noah Beidelman (@noahbei)
It also references the concept of glitching animations from Aleks (@aleksbrgt)
The pixel graphics used here are from a combination of sources;
1. Layer indicators are created by myself and free to use by anyone.
2. "Revengeday", "Cyber Cafe", "Cortex Implant" logos are used with kind permission of OBEY THE SYSTEM.
A collective of Fediverse instances and creatives. https://git.cyberwa.re/obey-the-system.
They are licenced as Non-Commercial and for use by members of the network, with attribution.
3. Key press indicator graphics were commissioned for this project and were designed by the
amazing https://corteximplant.com/@jadedtwin / https://www.jadedtwin.com/
*/
#pragma once
#include_next <mcuconf.h>
#undef STM32_I2C_USE_I2C1
#define STM32_I2C_USE_I2C1 TRUE

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,26 @@
# DAISY V2
![daisy](https://i.imgur.com/42p02KD.png)
An open source macro pad with a rotary encoder and OLED panel, this is an alternative version to the original through hole Daisy kit. More info / PCB designs available at [draytronics.co.uk/daisyV2](https://www.draytronics.co.uk/daisyV2)
* Keyboard Maintainer: [Blake Drayson](https://github.com/ghostseven)
* Hardware Supported: DAISY PCB V2 / STM32F072
* Hardware Availability: [draytronics.co.uk](https://draytronics.co.uk)
Make example for this keyboard (after setting up your build environment):
make draytronics/daisy_v2:default
Flashing example for this keyboard:
make draytronics/daisy_v2: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 rotary encoder button and plug in the keyboard
* **Physical reset button**: Briefly press the button on the back of the PCB
* **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available

View File

@ -0,0 +1 @@
SRC += oled.c

View File

@ -1,5 +1,6 @@
"""This script automates the copying of the default keymap into your own keymap.
"""
import re
import shutil
from milc import cli
@ -13,6 +14,13 @@ from qmk.keyboard import keyboard_completer, keyboard_folder
from qmk.userspace import UserspaceDefs
def validate_keymap_name(name):
"""Returns True if the given keymap name contains only a-z, 0-9 and underscore characters.
"""
regex = re.compile(r'^[a-zA-Z0-9][a-zA-Z0-9_]+$')
return bool(regex.match(name))
def prompt_keyboard():
prompt = """{fg_yellow}Select Keyboard{style_reset_all}
If you`re unsure you can view a full list of supported keyboards with {fg_yellow}qmk list-keyboards{style_reset_all}.
@ -60,6 +68,10 @@ def new_keymap(cli):
cli.log.error(f'Default keymap {{fg_cyan}}{keymap_path_default}{{fg_reset}} does not exist!')
return False
if not validate_keymap_name(user_name):
cli.log.error('Keymap names must contain only {fg_cyan}a-z{fg_reset}, {fg_cyan}0-9{fg_reset} and {fg_cyan}_{fg_reset}! Please choose a different name.')
return False
if keymap_path_new.exists():
cli.log.error(f'Keymap {{fg_cyan}}{user_name}{{fg_reset}} already exists! Please choose a different name.')
return False

View File

@ -29,6 +29,7 @@ def _convert_macros(via_macros):
if len(via_macros) == 0:
return list()
split_regex = re.compile(r'(}\,)|(\,{)')
macro_group_regex = re.compile(r'({.+?})')
macros = list()
for via_macro in via_macros:
# Split VIA macro to its elements
@ -38,13 +39,28 @@ def _convert_macros(via_macros):
macro_data = list()
for m in macro:
if '{' in m or '}' in m:
# Found keycode(s)
keycodes = m.split(',')
# Remove whitespaces and curly braces from around keycodes
keycodes = list(map(lambda s: s.strip(' {}'), keycodes))
# Remove the KC prefix
keycodes = list(map(lambda s: s.replace('KC_', ''), keycodes))
macro_data.append({"action": "tap", "keycodes": keycodes})
# Split macro groups
macro_groups = macro_group_regex.findall(m)
for macro_group in macro_groups:
# Remove whitespaces and curly braces from around group
macro_group = macro_group.strip(' {}')
macro_action = 'tap'
macro_keycodes = []
if macro_group[0] == '+':
macro_action = 'down'
macro_keycodes.append(macro_group[1:])
elif macro_group[0] == '-':
macro_action = 'up'
macro_keycodes.append(macro_group[1:])
else:
macro_keycodes.extend(macro_group.split(',') if ',' in macro_group else [macro_group])
# Remove the KC prefixes
macro_keycodes = list(map(lambda s: s.replace('KC_', ''), macro_keycodes))
macro_data.append({"action": macro_action, "keycodes": macro_keycodes})
else:
# Found text
macro_data.append(m)
@ -54,13 +70,13 @@ def _convert_macros(via_macros):
def _fix_macro_keys(keymap_data):
macro_no = re.compile(r'MACRO0?([0-9]{1,2})')
macro_no = re.compile(r'MACRO0?\(([0-9]{1,2})\)')
for i in range(0, len(keymap_data)):
for j in range(0, len(keymap_data[i])):
kc = keymap_data[i][j]
m = macro_no.match(kc)
if m:
keymap_data[i][j] = f'MACRO_{m.group(1)}'
keymap_data[i][j] = f'MC_{m.group(1)}'
return keymap_data