diff --git a/app/boards/shields/duck/CMakeCache.txt b/app/boards/shields/duck/CMakeCache.txt new file mode 100644 index 00000000..d93225e1 --- /dev/null +++ b/app/boards/shields/duck/CMakeCache.txt @@ -0,0 +1,65 @@ +# This is the CMakeCache file. +# For build in directory: /home/jackhartstein/zmk/app/boards/shields/duck +# It was generated by CMake: /usr/local/bin/cmake +# You can edit this file to change values found and used by cmake. +# If you do not want to change any of the values, simply exit the editor. +# If you do want to change a value, simply edit, save, and exit the editor. +# The syntax for the file is as follows: +# KEY:TYPE=VALUE +# KEY is the name of a variable in the cache. +# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!. +# VALUE is the current value for the KEY. + +######################## +# EXTERNAL cache entries +######################## + +//No help, variable specified on the command line. +BOARD:UNINITIALIZED=nice_nano + +//Path to a file. +BOARD_DIR:PATH=/home/jackhartstein/zmk/app/boards/arm/nice_nano + +//Selected user ZMK config +CACHED_ZMK_CONFIG:STRING= + +//No help, variable specified on the command line. +WEST_PYTHON:UNINITIALIZED=/usr/bin/python3 + + +######################## +# INTERNAL cache entries +######################## + +//This is the directory where this CMakeCache.txt was created +CMAKE_CACHEFILE_DIR:INTERNAL=/home/jackhartstein/zmk/app/boards/shields/duck +//Major version of cmake used to create the current loaded cache +CMAKE_CACHE_MAJOR_VERSION:INTERNAL=3 +//Minor version of cmake used to create the current loaded cache +CMAKE_CACHE_MINOR_VERSION:INTERNAL=19 +//Patch version of cmake used to create the current loaded cache +CMAKE_CACHE_PATCH_VERSION:INTERNAL=2 +//Path to CMake executable. +CMAKE_COMMAND:INTERNAL=/usr/local/bin/cmake +//Path to cpack program executable. +CMAKE_CPACK_COMMAND:INTERNAL=/usr/local/bin/cpack +//Path to ctest program executable. +CMAKE_CTEST_COMMAND:INTERNAL=/usr/local/bin/ctest +//Name of external makefile project generator. +CMAKE_EXTRA_GENERATOR:INTERNAL= +//Name of generator. +CMAKE_GENERATOR:INTERNAL=Ninja +//Generator instance identifier. +CMAKE_GENERATOR_INSTANCE:INTERNAL= +//Name of generator platform. +CMAKE_GENERATOR_PLATFORM:INTERNAL= +//Name of generator toolset. +CMAKE_GENERATOR_TOOLSET:INTERNAL= +//Source directory with the top level CMakeLists.txt file for this +// project +CMAKE_HOME_DIRECTORY:INTERNAL=/home/jackhartstein/zmk/app +//number of local generators +CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=1 +//Path to CMake installation. +CMAKE_ROOT:INTERNAL=/usr/local/share/cmake-3.19 + diff --git a/app/boards/shields/duck/CMakeFiles/cmake.check_cache b/app/boards/shields/duck/CMakeFiles/cmake.check_cache new file mode 100644 index 00000000..3dccd731 --- /dev/null +++ b/app/boards/shields/duck/CMakeFiles/cmake.check_cache @@ -0,0 +1 @@ +# This file is generated by cmake for dependency checking of the CMakeCache.txt file diff --git a/app/boards/shields/duck/Kconfig.defconfig b/app/boards/shields/duck/Kconfig.defconfig new file mode 100644 index 00000000..fd801036 --- /dev/null +++ b/app/boards/shields/duck/Kconfig.defconfig @@ -0,0 +1,11 @@ + # Copyright (c) 2020 The ZMK Contributors + # SPDX-License-Identifier: MIT + # + # Author: Jack Hartstein + +if SHIELD_DUCK + +config ZMK_KEYBOARD_NAME + default "duck" + +endif diff --git a/app/boards/shields/duck/Kconfig.shield b/app/boards/shields/duck/Kconfig.shield new file mode 100644 index 00000000..abf2a946 --- /dev/null +++ b/app/boards/shields/duck/Kconfig.shield @@ -0,0 +1,7 @@ + # Copyright (c) 2020 The ZMK Contributors + # SPDX-License-Identifier: MIT + # + # Author: Jack Hartstein + +config SHIELD_DUCK + def_bool $(shields_list_contains, duck) diff --git a/app/boards/shields/duck/boards/nice_nano.overlay b/app/boards/shields/duck/boards/nice_nano.overlay new file mode 100644 index 00000000..0185b13f --- /dev/null +++ b/app/boards/shields/duck/boards/nice_nano.overlay @@ -0,0 +1,35 @@ +/* Copyright (c) 2020 The ZMK Contributors + * SPDX-License-Identifier: MIT + * + * Author: Jack Hartstein + * Last Edited: Dec 20 2020 + */ + +&spi1 { + compatible = "nordic,nrf-spim"; + status = "okay"; + mosi-pin = <6>; + // 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 = <8>; /* arbitrary; change at will */ + spi-one-frame = <0x70>; + spi-zero-frame = <0x40>; + }; +}; + +/ { + chosen { + zmk,underglow = &led_strip; + }; +}; diff --git a/app/boards/shields/duck/duck.conf b/app/boards/shields/duck/duck.conf new file mode 100644 index 00000000..ca37616e --- /dev/null +++ b/app/boards/shields/duck/duck.conf @@ -0,0 +1,13 @@ +# Copyright (c) 2020 The ZMK Contributors +# SPDX-License-Identifier: MIT +# +# Author: Jack Hartstein + +# Enable Encoders +CONFIG_EC11=y +CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y + +# Enable underglow +CONFIG_ZMK_RGB_UNDERGLOW=y +# Use the STRIP config specific to the LEDs you're using +CONFIG_WS2812_STRIP=y diff --git a/app/boards/shields/duck/duck.dtsi b/app/boards/shields/duck/duck.dtsi new file mode 100644 index 00000000..c68068f1 --- /dev/null +++ b/app/boards/shields/duck/duck.dtsi @@ -0,0 +1,19 @@ +/* Copyright (c) 2020 The ZMK Contributors + * SPDX-License-Identitfier: MIT + * + * Author: Jack Hartstein + */ +/ { + left_encoder: encoder_left { + compatible = "alps,ec11"; + label = "LEFT_ENCODER"; + a-gpios = <&pro_micro_a 1 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; + b-gpios = <&pro_micro_a 2 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; + resolution = <2>; + }; + + sensors { + compatible = "zmk,keymap-sensors"; + sensors = <&left_encoder>; + }; +}; diff --git a/app/boards/shields/duck/duck.keymap b/app/boards/shields/duck/duck.keymap new file mode 100644 index 00000000..e1ba2b5f --- /dev/null +++ b/app/boards/shields/duck/duck.keymap @@ -0,0 +1,56 @@ +/* Copyright (c) 2020 The ZMK Contributors + * SPDX-License-Identifier: MIT + * + * Author: Jack Hartstein + */ + +#include +#include +#include +#include +#include + +#define DEFAULT 0 +#define FUNC 1 +#define RGB_BT 2 + +/ { + keymap { + compatible = "zmk,keymap"; + + default_layer { + bindings = < + &tog FUNC &kp KP_SLASH &kp KP_ASTERISK &kp KP_MINUS + &kp KP_NUMBER_7 &kp KP_NUMBER_8 &kp KP_NUMBER_9 &kp KP_PLUS + &kp KP_NUMBER_4 &kp KP_NUMBER_5 &kp KP_NUMBER_6 &none + &kp K_MUTE &kp KP_NUMBER_1 &kp KP_NUMBER_2 &kp KP_NUMBER_3 &kp KP_ENTER + &ext_power EP_TOG &none &kp KP_NUMBER_0 &kp KP_DOT &none + >; + + sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN>; + }; + + func_layer { + bindings = < + &tog RGB_BT &trans &trans &trans + &kp HOME &kp UP &kp PG_UP &trans + &kp LEFT &none &kp RIGHT &none + &trans &kp END &kp DOWN &kp PG_DN &trans + &trans &none &kp INS &kp DEL &none + >; + + sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN>; + }; + + rgb_bt_layer { + bindings = < + &tog DEFAULT &rgb_ug RGB_TOG &rgb_ug RGB_EFF &none + &rgb_ug RGB_HUI &rgb_ug RGB_SAI &rgb_ug RGB_BRI &none + &rgb_ug RGB_HUD &rgb_ug RGB_SAD &rgb_ug RGB_BRD &none + &bootloader &none &bt BT_CLR &bt BT_NXT &none + &trans &none &none &bt BT_PRV &none + >; + sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN>; + }; + }; +}; diff --git a/app/boards/shields/duck/duck.overlay b/app/boards/shields/duck/duck.overlay new file mode 100644 index 00000000..bccb539f --- /dev/null +++ b/app/boards/shields/duck/duck.overlay @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2020 The ZMK Contributors + * SPDX-License-Identifier: MIT + * + * Author: Jack Hartstein + */ + +#include "duck.dtsi" + +/ { + + chosen { + zmk,kscan = &kscan0; + }; + + kscan0: kscan_0 { + compatible = "zmk,kscan-gpio-matrix"; + label = "KSCAN"; + diode-direction = "col2row"; + + row-gpios + = <&pro_micro_d 5 GPIO_ACTIVE_HIGH> + , <&pro_micro_d 6 GPIO_ACTIVE_HIGH> + , <&pro_micro_d 7 GPIO_ACTIVE_HIGH> + , <&pro_micro_d 8 GPIO_ACTIVE_HIGH> + , <&pro_micro_d 9 GPIO_ACTIVE_HIGH> + ; + + col-gpios + = <&pro_micro_a 0 GPIO_ACTIVE_HIGH> + , <&pro_micro_d 15 GPIO_ACTIVE_HIGH> + , <&pro_micro_d 14 GPIO_ACTIVE_HIGH> + , <&pro_micro_d 16 GPIO_ACTIVE_HIGH> + , <&pro_micro_d 10 GPIO_ACTIVE_HIGH> + ; + }; +}; + +&left_encoder { + status = "okay"; +};