diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 01efb3cc..00000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,49 +0,0 @@ -on: [push, pull_request, workflow_dispatch] - -name: Build - -jobs: - build: - runs-on: ubuntu-latest - container: - image: zmkfirmware/zmk-build-arm:2.4 - name: Build - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Cache west modules - uses: actions/cache@v2 - env: - cache-name: cache-zephyr-modules - with: - path: | - modules/ - tools/ - zephyr/ - bootloader/ - zmk/ - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('manifest-dir/west.yml') }} - restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- - - name: West Init - run: west init -l config - - name: West Update - run: west update - - name: West Zephyr export - run: west zephyr-export - - name: West Build (bt60) - run: west build -s zmk/app -b bt60 -- -DZMK_CONFIG="${GITHUB_WORKSPACE}/config" - - name: bt60 DTS File - if: ${{ always() }} - run: cat -n build/zephyr/bt60.dts.pre.tmp - - name: bt60 Kconfig file - run: cat build/zephyr/.config | grep -v "^#" | grep -v "^$" - - name: Rename zmk.uf2 - run: cp build/zephyr/zmk.uf2 bt60.uf2 - - name: Archive (bt60) - uses: actions/upload-artifact@v2 - with: - name: firmware - path: bt60.uf2 diff --git a/README.md b/README.md index 94333e80..32f2ccf6 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,14 @@ # zmk-config -This is the ZMK-Config repo for the Polarity works BT60 keyboard, with this you can customise your layout and keymap to suit your exact needs. -We have provided base keymaps for the following layouts on the soldered version: ANSI, ISO, Split backspace and right shift, Tsangan and all 1u bottom rows. These can be accessed by choosing the appropriate branch. The hotswap version has one fork which already includes support for split backspace however it is not bound to anything useful thus you will need to fork and customise to your taste +This is the ZMK-Config repo for the Polarity works CKP series of keyboards, with this you can customise your layout and keymap to suit your exact needs. +We have provided base keymaps for the following layouts on the soldered version: ANSI, ISO, Tsangan and all 1u keys. These can be accessed by choosing the appropriate branch. The hotswap versions now use the exact same firmware as the soldered ones making it harder to end up with an unusable board. + +# Layouts +The CKP series has a huge number of available layouts, however most should be configurable within the all 1u keys branch. the boards were designed so that where there is a place where multiple combinations can go, it's always the leftmost set of pins in software. Take the right shift for example, with a maximum of 3 possible keys in it's place however # Customisation In order to change the keymap to meet your needs, you will need a GitHub account. Click the "fork" button in the top right to create your own version of the repo, then use the drop down menu to select the branch with your layout. The keymap information is contained entirely within the file bt60.keymap. Download this file to your computer and open it in a text editor such as Atom or notepad++ then you can open and edit it. The full list of ZMK keycodes can be found [here](https://zmkfirmware.dev/docs/codes/keyboard-keypad/). -After editing the keymap file upload it to the original folder using the "Add file" dialog in GitHub, then click on "Actions" and wait for the build process to complete (The orange dot will go to either a red X or green tick). If your firmware doesn't compile you most likely made a mistake with the keys, double check the .keymap file and try again. +After editing the keymap file upload it to the original folder using the "Add file" dialog in GitHub, then click on "Actions" and wait for the build process to complete (The orange dot will go to either a red X or green tick). If your firmware doesn't compile you most likely made a mistake with the keys, use the action log (especially the DTSI file) to find the mistake, double check the .keymap file and try again. # Compilation and downloading If you have made any errors in the keymap the compilation will fail and there will be a red X in the actions dialog. Click on it and it will tell you where the problem is. @@ -13,7 +16,7 @@ After editing the keymap file upload it to the original folder using the "Add fi Put the keyboard into bootloader (Either double tap the hardware reset button or use the behaviour, typically fn + enter) and drag and drop the .uf2 file onto the usb drive that shows up # More advanced - If you want to exercise greater control over your BT60 and have a unique layout implemented you will need to change the matrix transform. The following diagram displays which keys connect to which row and column pins. Note that everything is zero indexed in the matrix transform + If you want to exercise greater control over your CKP and have a unique layout implemented you will need to change the matrix transform. The following diagram displays which keys connect to which row and column pins. Note that everything is zero indexed in the matrix transform, on the BT60V2 and BT65 the rows and colums that aren't present lead to nowhere so dont try and change the indexing, it's meant that way. ![alt text](rowcolmap.png) - The matrix transform can be found in bt60.dts, more information on how to do the matrix transforms can be found in the official ZMK documentation [here](https://zmkfirmware.dev/docs/development/new-shield#optional-matrix-transform) + The matrix transform can be found in btXX.dts where XX is the size of the board, more information on how to do the matrix transforms can be found in the official ZMK documentation [here](https://zmkfirmware.dev/docs/development/new-shield#optional-matrix-transform) We're always willing to accept pull requests if you've developed your own layouts :) diff --git a/config/boards/arm/bt60/CMakeLists.txt b/config/boards/arm/bt60/CMakeLists.txt deleted file mode 100644 index 00952c30..00000000 --- a/config/boards/arm/bt60/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -set_property(GLOBAL APPEND PROPERTY extra_post_build_commands - COMMAND ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/../tools/uf2/utils/uf2conv.py - -c - -b 0x26000 - -f 0xADA52840 - -o ${PROJECT_BINARY_DIR}/${CONFIG_KERNEL_BIN_NAME}.uf2 - ${PROJECT_BINARY_DIR}/${CONFIG_KERNEL_BIN_NAME}.bin -) diff --git a/config/boards/arm/bt60/Kconfig b/config/boards/arm/bt60/Kconfig deleted file mode 100644 index 148ad955..00000000 --- a/config/boards/arm/bt60/Kconfig +++ /dev/null @@ -1,7 +0,0 @@ -# SPDX-License-Identifier: MIT - -config BOARD_ENABLE_DCDC - bool "Enable DCDC mode" - select SOC_DCDC_NRF52X - default y - depends on BOARD_BT60 diff --git a/config/boards/arm/bt60/Kconfig.board b/config/boards/arm/bt60/Kconfig.board deleted file mode 100644 index 128ae6e3..00000000 --- a/config/boards/arm/bt60/Kconfig.board +++ /dev/null @@ -1,8 +0,0 @@ -# BT60 board configuration - -# Copyright (c) 2021 Polarity Works -# SPDX-License-Identifier: MIT - -config BOARD_BT60 - bool "bt60" - depends on SOC_NRF52840_QIAA diff --git a/config/boards/arm/bt60/Kconfig.defconfig b/config/boards/arm/bt60/Kconfig.defconfig deleted file mode 100644 index 3c6a257d..00000000 --- a/config/boards/arm/bt60/Kconfig.defconfig +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright (c) 2021 Polarity Works -# SPDX-License-Identifier: MIT - -if BOARD_BT60 - -config BOARD - default "bt60" - -if USB - -config USB_NRFX - default y - -config USB_DEVICE_STACK - default y - -endif # USB - -config BT_CTLR - default BT - -config ZMK_BLE - default y - -config ZMK_USB - default y - -config ZMK_BATTERY_VOLTAGE_DIVIDER - default y - -config ZMK_KEYBOARD_NAME - default "BT60" - -endif # BOARD_BT60 diff --git a/config/boards/arm/bt60/board.cmake b/config/boards/arm/bt60/board.cmake deleted file mode 100644 index fa847d50..00000000 --- a/config/boards/arm/bt60/board.cmake +++ /dev/null @@ -1,5 +0,0 @@ -# SPDX-License-Identifier: MIT - -board_runner_args(nrfjprog "--nrf-family=NRF52" "--softreset") -include(${ZEPHYR_BASE}/boards/common/blackmagicprobe.board.cmake) -include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake) diff --git a/config/boards/arm/bt60/bt60.dts b/config/boards/arm/bt60/bt60.dts deleted file mode 100644 index 6f7f1f55..00000000 --- a/config/boards/arm/bt60/bt60.dts +++ /dev/null @@ -1,216 +0,0 @@ -/* -* Copyright (c) 2021 Polarity Works -* -* SPDX-License-Identifier: MIT -*/ - -/dts-v1/; -#include -#include - -/ { - model = "BT60"; - compatible = "bt60"; - - chosen { - zephyr,code-partition = &code_partition; - zephyr,sram = &sram0; - zephyr,flash = &flash0; - zmk,kscan = &kscan0; - zmk,underglow = &led_strip; - zmk,backlight = &backlight; - zmk,matrix_transform = &default_transform; - }; - - sensors { - compatible = "zmk,keymap-sensors"; - sensors = <&left_encoder>; - }; - - default_transform: keymap_transform_0 { - compatible = "zmk,matrix-transform"; - columns = <16>; - rows = <6>; - map = < - RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,5) RC(0,6) RC(0,7) RC(0,8) RC(0,9) RC(0,10) RC(0,11) RC(0,12) RC(0,13) RC(0,14) RC(0,15) - RC(1,0) RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5) RC(1,6) RC(1,7) RC(1,8) RC(1,9) RC(1,11) RC(1,11) RC(1,12) RC(1,13) RC(1,15) - RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(2,6) RC(2,7) RC(2,8) RC(2,9) RC(2,10) RC(2,11) RC(2,12) RC(2,13) RC(2,15) - RC(3,0) RC(3,1) RC(3,2) RC(3,3) RC(3,4) RC(3,5) RC(3,6) RC(3,7) RC(3,8) RC(3,9) RC(3,10) RC(3,11) RC(3,13) RC(3,15) - RC(4,0) RC(4,2) RC(4,3) RC(4,4) RC(4,5) RC(4,6) RC(4,7) RC(4,8) RC(4,9) RC(4,10) RC(4,11) RC(4,12) RC(4,15) - RC(5,0) RC(5,1) RC(5,2) RC(5,5) RC(5,8) RC(5,9) RC(5,10) RC(5,11) RC(5,15) - >; - }; - - - kscan0: kscan_0 { - compatible = "zmk,kscan-gpio-matrix"; - label = "KSCAN"; - diode-direction = "col2row"; - - col-gpios - = <&gpio1 11 GPIO_ACTIVE_HIGH> - , <&gpio1 10 GPIO_ACTIVE_HIGH> - , <&gpio1 13 GPIO_ACTIVE_HIGH> - , <&gpio1 15 GPIO_ACTIVE_HIGH> - , <&gpio0 3 GPIO_ACTIVE_HIGH> - , <&gpio0 2 GPIO_ACTIVE_HIGH> - , <&gpio0 28 GPIO_ACTIVE_HIGH> - , <&gpio0 29 GPIO_ACTIVE_HIGH> - , <&gpio0 30 GPIO_ACTIVE_HIGH> - , <&gpio0 31 GPIO_ACTIVE_HIGH> - , <&gpio0 5 GPIO_ACTIVE_HIGH> - , <&gpio0 7 GPIO_ACTIVE_HIGH> - , <&gpio1 9 GPIO_ACTIVE_HIGH> - , <&gpio0 12 GPIO_ACTIVE_HIGH> - , <&gpio0 23 GPIO_ACTIVE_HIGH> - , <&gpio1 6 GPIO_ACTIVE_HIGH> - ; - - row-gpios - = <&gpio0 22 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> - , <&gpio1 0 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> - , <&gpio1 3 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> - , <&gpio1 1 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> - , <&gpio1 2 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> - , <&gpio1 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> - ; - }; - ext-power { - compatible = "zmk,ext-power-generic"; - label = "EXT_POWER"; - control-gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>; - }; - left_encoder: encoder_left { - compatible = "alps,ec11"; - label = "LEFT_ENCODER"; - a-gpios = <&gpio0 21 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; - b-gpios = <&gpio0 19 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; - resolution = <4>; - status = "okay"; - }; -backlight: pwmleds { - compatible = "pwm-leds"; - label = "Backlight LEDs"; - pwm_led_0 { - pwms = <&pwm0 17>; - label = "Backlight LED 0"; - }; -}; - - leds { - compatible = "gpio-leds"; - blue_led: led_0 { - gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>; - label = "Blue LED"; - }; - }; - - vbatt { - compatible = "zmk,battery-voltage-divider"; - label = "BATTERY"; - io-channels = <&adc 2>; - output-ohms = <2000000>; - full-ohms = <(2000000 + 806000)>; - }; -}; - -&adc { - status = "okay"; -}; - -&pwm0 { - status = "okay"; - ch0-pin = <17>; -}; - -&gpiote { - status = "okay"; -}; - -&gpio0 { - status = "okay"; -}; - -&gpio1 { - status = "okay"; -}; - -&i2c0 { - compatible = "nordic,nrf-twi"; - sda-pin = <17>; - scl-pin = <20>; -}; - -&uart0 { - compatible = "nordic,nrf-uarte"; - tx-pin = <6>; - rx-pin = <8>; -}; - -&usbd { - status = "okay"; -}; - - -&flash0 { - /* - * For more information, see: - * http://docs.zephyrproject.org/latest/devices/dts/flash_partitions.html - */ - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - sd_partition: partition@0 { - label = "softdevice"; - reg = <0x00000000 0x00026000>; - }; - code_partition: partition@26000 { - label = "code_partition"; - reg = <0x00026000 0x000c6000>; - }; - - /* - * The flash starting at 0x000ec000 and ending at - * 0x000f3fff is reserved for use by the application. - */ - - /* - * Storage partition will be used by FCB/LittleFS/NVS - * if enabled. - */ - storage_partition: partition@ec000 { - label = "storage"; - reg = <0x000ec000 0x00008000>; - }; - - boot_partition: partition@f4000 { - label = "adafruit_boot"; - reg = <0x000f4000 0x0000c000>; - }; - }; -}; - -&spi1 { - compatible = "nordic,nrf-spim"; - status = "okay"; - mosi-pin = <20>; - // Unused pins, needed for SPI definition, but not used by the ws2812 driver itself. - sck-pin = <27>; - miso-pin = <8>; - - led_strip: ws2812@0 { - compatible = "worldsemi,ws2812-spi"; - label = "WS2812"; - - /* SPI */ - reg = <0>; - spi-max-frequency = <4000000>; - - /* WS2812 */ - chain-length = <3>; /* number of LEDs */ - spi-one-frame = <0x70>; - spi-zero-frame = <0x40>; - }; -}; diff --git a/config/boards/arm/bt60/bt60.keymap b/config/boards/arm/bt60/bt60.keymap deleted file mode 100644 index 767c5697..00000000 --- a/config/boards/arm/bt60/bt60.keymap +++ /dev/null @@ -1,42 +0,0 @@ -#include -#include -#include -#include -#include - - -/ { - keymap { - compatible = "zmk,keymap"; - - default_layer { - // ------------------------------------------------------------------------------------------ - // | ESC | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F9 | F9 | F10 | F11 | F12 | DEL | RGB tog | RGB HUI - // | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BKSP | BACKlight tog - // | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | | | backlight up - // | CAPS | A | S | D | F | G | H | J | K | L | ; | ' | ENTER | backlight down - // | SHIFT | Z | X | C | V | B | N | M | , | . | / | SHIFT | bootloader - // | CTL | WIN | ALT | SPACE | ALT | 1 | MENU | CTRL | reset - // ------------------------------------------------------------------------------------------ - bindings = < - &kp ESC &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 &kp F12 &kp DEL &rgb_ug RGB_TOG &rgb_ug RGB_HUI - &kp GRAVE &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp MINUS &kp EQUAL &kp BSPC &bl BL_TOG - &kp TAB &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp LBKT &kp RBKT &kp BSLH &bl BL_INC - &kp CLCK &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &kp SQT &kp RET &bl BL_DEC - &kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp RSHFT &bootloader - &kp LCTRL &kp LGUI &kp LALT &kp SPACE &kp RALT &mo 1 &kp K_CMENU &kp RCTRL &reset - >; - sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN>; - }; - raise { - bindings = < - &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans - &trans &trans &kp UP &trans &trans &trans &trans &trans &kp INS &trans &kp PSCRN &kp SLCK &kp PAUSE_BREAK &reset &trans - &trans &kp LEFT &kp DOWN &kp RIGHT &trans &trans &trans &trans &trans &trans &kp HOME &kp PG_UP &bootloader &trans - &kp C_PREV &kp C_VOL_DN &kp C_VOL_UP &kp C_MUTE &trans &trans &trans &trans &trans &kp END &kp PG_DN &kp C_NEXT &trans - &bt BT_PRV &bt BT_NXT &trans &trans &trans &trans &trans &bt BT_CLR &trans - >; - sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN>; - }; - }; -}; diff --git a/config/boards/arm/bt60/bt60.yaml b/config/boards/arm/bt60/bt60.yaml deleted file mode 100644 index 35e90752..00000000 --- a/config/boards/arm/bt60/bt60.yaml +++ /dev/null @@ -1,15 +0,0 @@ -identifier: bt60 -name: bt60 -type: mcu -arch: arm -toolchain: - - zephyr - - gnuarmemb - - xtools -supported: - - adc - - usb_device - - ble - - ieee802154 - - pwm - - watchdog diff --git a/config/boards/arm/bt60/bt60_defconfig b/config/boards/arm/bt60/bt60_defconfig deleted file mode 100644 index 685df5e7..00000000 --- a/config/boards/arm/bt60/bt60_defconfig +++ /dev/null @@ -1,31 +0,0 @@ -# SPDX-License-Identifier: MIT - -CONFIG_SOC_SERIES_NRF52X=y -CONFIG_SOC_NRF52840_QIAA=y -CONFIG_BOARD_BT60=y - -# Enable MPU -CONFIG_ARM_MPU=y - -# enable GPIO -CONFIG_GPIO=y - -# encoder -CONFIG_EC11=y -CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y - -CONFIG_USE_DT_CODE_PARTITION=y - -CONFIG_MPU_ALLOW_FLASH_WRITE=y -CONFIG_NVS=y -CONFIG_SETTINGS_NVS=y -CONFIG_FLASH=y -CONFIG_FLASH_PAGE_LAYOUT=y -CONFIG_FLASH_MAP=y - -CONFIG_ZMK_RGB_UNDERGLOW=y -# Use the STRIP config specific to the LEDs you're using -CONFIG_WS2812_STRIP=y -CONFIG_ZMK_RGB_UNDERGLOW_SAT_START=50 -CONFIG_BT_CTLR_TX_PWR_PLUS_8=y -CONFIG_ZMK_BACKLIGHT=y diff --git a/config/west.yml b/config/west.yml deleted file mode 100644 index d255c02d..00000000 --- a/config/west.yml +++ /dev/null @@ -1,13 +0,0 @@ -manifest: - remotes: - - name: zmkfirmware - url-base: https://github.com/zmkfirmware - - name: bortoz - url-base: https://github.com/bortoz - projects: - - name: zmk - remote: bortoz - revision: backlight - import: app/west.yml - self: - path: config