mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-04-10 07:45:41 +00:00
New Daisy V2 Macropad
This commit is contained in:
parent
4a4eda4c3c
commit
89d87c8386
45
keyboards/draytronics/daisy_v2/config.h
Normal file
45
keyboards/draytronics/daisy_v2/config.h
Normal 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
|
122
keyboards/draytronics/daisy_v2/daisy_v2.c
Normal file
122
keyboards/draytronics/daisy_v2/daisy_v2.c
Normal file
@ -0,0 +1,122 @@
|
||||
/*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 "daisy_v2.h"
|
||||
|
||||
enum my_keycodes {
|
||||
ENCODER_PRESS = QK_KB,
|
||||
};
|
||||
|
||||
void board_init(void) {
|
||||
SYSCFG->CFGR1 |= SYSCFG_CFGR1_I2C1_DMA_RMP;
|
||||
}
|
||||
|
||||
const uint8_t max_layer = 3;
|
||||
uint8_t current_display_mode = 0;
|
||||
|
||||
bool hidden = false;
|
||||
|
||||
uint8_t key_pressed = 0;
|
||||
|
||||
|
||||
/* EEPROM Stuct and function to allow init / saving of OLED mode */
|
||||
typedef union {
|
||||
uint32_t raw;
|
||||
struct {
|
||||
uint8_t oled_mode :8;
|
||||
};
|
||||
} kb_config_t;
|
||||
|
||||
kb_config_t kb_config;
|
||||
|
||||
void eeconfig_init_kb(void) {
|
||||
//Init initial value and save to EEPROM.
|
||||
kb_config.raw = 0;
|
||||
eeconfig_update_kb(kb_config.raw);
|
||||
}
|
||||
/* End */
|
||||
|
||||
void keyboard_post_init_user(void) {
|
||||
//Read user value and set current_display_mode.
|
||||
kb_config.oled_mode = eeconfig_read_kb();
|
||||
current_display_mode = kb_config.oled_mode;
|
||||
|
||||
//This is an adjustment to resolve the issue that occurs when there is a
|
||||
//static colour underglow the first LED can be a different colour on first init.
|
||||
rgblight_disable_noeeprom();
|
||||
rgblight_enable_noeeprom();
|
||||
}
|
||||
|
||||
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
if (!process_record_user(keycode, record)) {
|
||||
return false;
|
||||
}
|
||||
#ifdef OLED_ENABLE
|
||||
if (record->event.pressed) {
|
||||
key_pressed++;
|
||||
} else {
|
||||
if (key_pressed)
|
||||
key_pressed--;
|
||||
}
|
||||
#endif
|
||||
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 {
|
||||
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;
|
||||
}
|
||||
|
||||
#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
|
46
keyboards/draytronics/daisy_v2/daisy_v2.h
Normal file
46
keyboards/draytronics/daisy_v2/daisy_v2.h
Normal file
@ -0,0 +1,46 @@
|
||||
/*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 "quantum.h"
|
||||
|
||||
//for oled key press
|
||||
extern uint8_t key_pressed;
|
||||
|
||||
// for changing oled display mode
|
||||
extern uint8_t current_display_mode;
|
||||
|
||||
// for hidden animation toggle
|
||||
extern bool hidden;
|
||||
|
||||
//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;
|
35
keyboards/draytronics/daisy_v2/halconfig.h
Normal file
35
keyboards/draytronics/daisy_v2/halconfig.h
Normal 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 //Enable I2C
|
||||
|
||||
#include_next <halconf.h>
|
68
keyboards/draytronics/daisy_v2/keyboard.json
Normal file
68
keyboards/draytronics/daisy_v2/keyboard.json
Normal file
@ -0,0 +1,68 @@
|
||||
{
|
||||
"manufacturer": "Draytronics",
|
||||
"keyboard_name": "DAISY",
|
||||
"maintainer": "ghostseven",
|
||||
"bootloader": "stm32-dfu",
|
||||
"diode_direction": "COL2ROW",
|
||||
"encoder": {
|
||||
"enabled": true,
|
||||
"rotary": [
|
||||
{"pin_a": "A15", "pin_b": "A14"}
|
||||
]
|
||||
},
|
||||
"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,
|
||||
"rgb_test": 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": [
|
||||
{"label": "", "matrix": [0, 0], "x": 0, "y": 0},
|
||||
{"label": "", "matrix": [1, 0], "x": 0, "y": 1},
|
||||
{"label": "", "matrix": [1, 1], "x": 1, "y": 1},
|
||||
{"label": "", "matrix": [1, 2], "x": 2, "y": 1},
|
||||
{"label": "", "matrix": [1, 3], "x": 3, "y": 1},
|
||||
{"label": "", "matrix": [2, 0], "x": 0, "y": 2},
|
||||
{"label": "", "matrix": [2, 1], "x": 1, "y": 2},
|
||||
{"label": "", "matrix": [2, 2], "x": 2, "y": 2},
|
||||
{"label": "", "matrix": [2, 3], "x": 3, "y": 2}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
94
keyboards/draytronics/daisy_v2/keymaps/default/keymap.c
Normal file
94
keyboards/draytronics/daisy_v2/keymaps/default/keymap.c
Normal file
@ -0,0 +1,94 @@
|
||||
/*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_KB,
|
||||
};
|
||||
|
||||
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.
|
||||
*/
|
||||
};
|
||||
|
||||
bool encoder_update_user(uint8_t index, bool clockwise) {
|
||||
if (clockwise) {
|
||||
tap_code(KC_VOLD);
|
||||
} else {
|
||||
tap_code(KC_VOLU);
|
||||
}
|
||||
return false;
|
||||
}
|
36
keyboards/draytronics/daisy_v2/mcuconf.h
Normal file
36
keyboards/draytronics/daisy_v2/mcuconf.h
Normal 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
|
2356
keyboards/draytronics/daisy_v2/oled.c
Normal file
2356
keyboards/draytronics/daisy_v2/oled.c
Normal file
File diff suppressed because it is too large
Load Diff
26
keyboards/draytronics/daisy_v2/readme.md
Normal file
26
keyboards/draytronics/daisy_v2/readme.md
Normal file
@ -0,0 +1,26 @@
|
||||
# DAISY V2
|
||||

|
||||
|
||||
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 [The QMK Tutorial](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
|
1
keyboards/draytronics/daisy_v2/rules.mk
Normal file
1
keyboards/draytronics/daisy_v2/rules.mk
Normal file
@ -0,0 +1 @@
|
||||
SRC += oled.c
|
Loading…
Reference in New Issue
Block a user