This commit is contained in:
Nick Winans 2024-09-02 20:13:37 -07:00 committed by GitHub
commit 52b0b6ea80
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 131 additions and 0 deletions

View file

@ -0,0 +1,9 @@
# Copyright (c) 2022 The ZMK Contributors
# SPDX-License-Identifier: MIT
if SHIELD_SWEET16
config ZMK_KEYBOARD_NAME
default "Sweet 16"
endif

View file

@ -0,0 +1,5 @@
# Copyright (c) 2022 The ZMK Contributors
# SPDX-License-Identifier: MIT
config SHIELD_SWEET16
def_bool $(shields_list_contains,sweet16)

View file

@ -0,0 +1,28 @@
&spi1 {
compatible = "nordic,nrf-spim";
status = "okay";
mosi-pin = <45>;
// Unused pins, needed for SPI definition, but not used by the ws2812 driver itself.
sck-pin = <5>;
miso-pin = <7>;
led_strip: ws2812@0 {
compatible = "worldsemi,ws2812-spi";
label = "WS2812";
/* SPI */
reg = <0>; /* ignored, but necessary for SPI bindings */
spi-max-frequency = <4000000>;
/* WS2812 */
chain-length = <12>; /* arbitrary; change at will */
spi-one-frame = <0x70>;
spi-zero-frame = <0x40>;
};
};
/ {
chosen {
zmk,underglow = &led_strip;
};
};

View file

@ -0,0 +1,3 @@
# Uncomment the following lines to enable RGB underglow
# CONFIG_ZMK_RGB_UNDERGLOW=y
# CONFIG_WS2812_STRIP=y

View file

@ -0,0 +1,44 @@
/*
* Copyright (c) 2022 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/bt.h>
#include <dt-bindings/zmk/rgb.h>
/ {
keymap {
compatible = "zmk,keymap";
default_layer {
// --------------------------
// | 7 | 8 | 9 | * |
// | 4 | 5 | 6 | / |
// | 1 | 2 | 3 | - |
// | 0 | ENT | LWR | = |
bindings = <
&kp N7 &kp N8 &kp N9 &kp ASTERISK
&kp N4 &kp N5 &kp N6 &kp SLASH
&kp N1 &kp N2 &kp N3 &kp MINUS
&kp N0 &kp ENTER &mo 1 &kp EQUAL
>;
};
lower_layer {
// ------------------------
// | BT1 | BT2 | BT3 | BT4 |
// | | | | |
// | | | | |
// | | | |BTCLR|
bindings = <
&bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3
&none &none &none &none
&none &none &none &none
&none &none &trans &bt BT_CLR
>;
};
};
};

View file

@ -0,0 +1,33 @@
/*
* Copyright (c) 2022 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#include <dt-bindings/zmk/matrix_transform.h>
/ {
chosen {
zmk,kscan = &kscan0;
};
kscan0: kscan_0 {
compatible = "zmk,kscan-gpio-matrix";
label = "KSCAN";
diode-direction = "col2row";
col-gpios
= <&pro_micro 2 GPIO_ACTIVE_HIGH>
, <&pro_micro 3 GPIO_ACTIVE_HIGH>
, <&pro_micro 4 GPIO_ACTIVE_HIGH>
, <&pro_micro 5 GPIO_ACTIVE_HIGH>
;
row-gpios
= <&pro_micro 21 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 20 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 19 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro 18 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
;
};
};

View file

@ -0,0 +1,9 @@
file_format: "1"
id: sweet16
name: Sweet 16
type: shield
url: https://1upkeyboards.com/shop/keyboard-kits/macro-pads/sweet16-macro-pad-white/
requires: [pro_micro]
features:
- keys
- underglow