Skip to content

Commit

Permalink
Add Mriya44 config
Browse files Browse the repository at this point in the history
  • Loading branch information
AgiosAndreas committed May 15, 2023
1 parent 29a6c91 commit 286edf8
Show file tree
Hide file tree
Showing 17 changed files with 585 additions and 0 deletions.
90 changes: 90 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
on: [push, pull_request, workflow_dispatch]

name: Build

jobs:
matrix:
runs-on: ubuntu-latest
name: Fetch Build Keyboards
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install yaml2json
run: python3 -m pip install remarshal
- id: set-matrix
name: Fetch Build Matrix
run: |
matrix=$(yaml2json build.yaml | jq -c .)
yaml2json build.yaml
echo "::set-output name=matrix::${matrix}"
build:
runs-on: ubuntu-latest
container:
image: zmkfirmware/zmk-build-arm:stable
needs: matrix
name: Build
strategy:
fail-fast: false
matrix: ${{fromJson(needs.matrix.outputs.matrix)}}
steps:
- name: Prepare variables
id: variables
run: |
if [ -n "${{ matrix.shield }}" ]; then
EXTRA_CMAKE_ARGS="-DSHIELD=${{ matrix.shield }}"
ARTIFACT_NAME="${{ matrix.shield }}-${{ matrix.board }}-zmk"
DISPLAY_NAME="${{ matrix.shield }} - ${{ matrix.board }}"
else
EXTRA_CMAKE_ARGS=
DISPLAY_NAME="${{ matrix.board }}"
ARTIFACT_NAME="${{ matrix.board }}-zmk"
fi
echo ::set-output name=extra-cmake-args::${EXTRA_CMAKE_ARGS}
echo ::set-output name=artifact-name::${ARTIFACT_NAME}
echo ::set-output name=display-name::${DISPLAY_NAME}
- 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 (${{ steps.variables.outputs.display-name }})
run: |
west build -s zmk/app -b ${{ matrix.board }} -- -DZMK_CONFIG=${GITHUB_WORKSPACE}/config ${{ steps.variables.outputs.extra-cmake-args }} ${{ matrix.cmake-args }}
- name: ${{ steps.variables.outputs.display-name }} Kconfig file
run: cat build/zephyr/.config | grep -v "^#" | grep -v "^$"
- name: Rename artifacts
run: |
mkdir build/artifacts
if [ -f build/zephyr/zmk.uf2 ]
then
cp build/zephyr/zmk.uf2 "build/artifacts/${{ steps.variables.outputs.artifact-name }}.uf2"
elif [ -f build/zephyr/zmk.hex ]
then
cp build/zephyr/zmk.hex "build/artifacts/${{ steps.variables.outputs.artifact-name }}.hex"
fi
- name: Archive (${{ steps.variables.outputs.display-name }})
uses: actions/upload-artifact@v2
with:
name: firmware
path: build/artifacts
5 changes: 5 additions & 0 deletions build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
include:
- board: mriya_left
- board: mriya_right
- board: nice_nano_v2
shield: settings_reset
10 changes: 10 additions & 0 deletions config/boards/arm/mriya/Kconfig.board
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright (c) 2023 Andrei Gaevkii
# SPDX-License-Identifier: MIT

config BOARD_MRIYA_LEFT
bool "mriya_left"
depends on SOC_NRF52840_QIAA

config BOARD_MRIYA_RIGHT
bool "mriya_right"
depends on SOC_NRF52840_QIAA
52 changes: 52 additions & 0 deletions config/boards/arm/mriya/Kconfig.defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Copyright (c) 2023 Andrei Gaevkii
# SPDX-License-Identifier: MIT

if BOARD_MRIYA_LEFT

config ZMK_KEYBOARD_NAME
default "Mriya"

config ZMK_SPLIT_BLE_ROLE_CENTRAL
default y

endif # BOARD_MRIYA_LEFT

if BOARD_MRIYA_RIGHT

config ZMK_KEYBOARD_NAME
default "Mriya Right"

endif # BOARD_MRIYA_RIGHT


if BOARD_MRIYA_LEFT || BOARD_MRIYA_RIGHT

config BOARD
default "mriya"

config ZMK_SPLIT
default y

config BT_CTLR
default BT

config ZMK_BLE
default y

config ZMK_USB
default y

config ZMK_BATTERY_VOLTAGE_DIVIDER
default y

if USB

config USB_NRFX
default y

config USB_DEVICE_STACK
default y

endif # USB

endif # BOARD_MRIYA_LEFT || BOARD_MRIYA_RIGHT
8 changes: 8 additions & 0 deletions config/boards/arm/mriya/board.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#
# Copyright (c) 2022 The ZMK Contributors
# 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)
133 changes: 133 additions & 0 deletions config/boards/arm/mriya/mriya.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
/*
* Copyright (c) 2023 Andrei Gaevskii
*
* SPDX-License-Identifier: MIT
*/

/dts-v1/;
#include <nordic/nrf52840_qiaa.dtsi>

#include <dt-bindings/zmk/matrix_transform.h>


/ {
model = "mriya";
compatible = "mriya";

chosen {
zephyr,code-partition = &code_partition;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zmk,kscan = &kscan0;
zmk,matrix_transform = &default_transform;
zmk,battery = &vbatt;
};

default_transform: keymap_transform_0 {
compatible = "zmk,matrix-transform";
columns = <12>;
rows = <5>;
map = <
RC(1,5) RC(1,4) RC(1,3) RC(1,2) RC(1,1) RC(1,0) RC(1,6) RC(1,7) RC(1,8) RC(1,9) RC(1,10) RC(1,11)
RC(2,5) RC(2,4) RC(2,3) RC(2,2) RC(2,1) RC(2,0) RC(2,6) RC(2,7) RC(2,8) RC(2,9) RC(2,10) RC(2,11)
RC(3,5) RC(3,4) RC(3,3) RC(3,2) RC(3,1) RC(3,0) RC(3,6) RC(3,7) RC(3,8) RC(3,9) RC(3,10) RC(3,11)
RC(4,3) RC(4,2) RC(4,1) RC(4,0) RC(4,6) RC(4,7) RC(4,8) RC(4,9)
>;
};

kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix";
label = "KSCAN";

diode-direction = "col2row";
row-gpios
= <&gpio0 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&gpio1 9 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&gpio0 12 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&gpio0 21 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&gpio0 19 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
;
};

leds {
compatible = "gpio-leds";
blue_led: led_0 {
gpios = <&gpio0 23 GPIO_ACTIVE_HIGH>;
label = "Blue LED";
};
};

vbatt: vbatt {
compatible = "zmk,battery-voltage-divider";
label = "VBATT";
io-channels = <&adc 0>;
output-ohms = <2000000>;
full-ohms = <(2000000 + 806000)>;
};

};


&adc {
status = "okay";
};

&gpiote {
status = "okay";
};

&gpio0 {
status = "okay";
};

&gpio1 {
status = "okay";
};

&usbd {
status = "okay";
cdc_acm_uart: cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
label = "CDC_ACM_0";
};
};

&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>;
};
};
};
31 changes: 31 additions & 0 deletions config/boards/arm/mriya/mriya.keymap
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Copyright (c) 2023 Andrei Gaevskii
*
* SPDX-License-Identifier: MIT
*/

#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/bt.h>

&lt {
quick_tap_ms = <200>;
};

&mt {
quick_tap_ms = <200>;
};

/ {
keymap {
compatible = "zmk,keymap";

default_layer {
bindings = <
&none &none &none &none &none &none &none &none &none &none &none &none
&none &none &none &none &none &none &none &none &none &none &none &none
&none &none &none &none &none &none &none &none &none &none &none &none
&none &none &none &none &none &none &none &none
};
};
};
18 changes: 18 additions & 0 deletions config/boards/arm/mriya/mriya.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
identifier: mriya
name: Mriya
type: keyboard
arch: arm
toolchain:
- zephyr
- gnuarmemb
- xtools
supported:
- adc
- usb_device
- ble
- ieee802154
- pwm
- watchdog
- kscan
- nvs
- can
18 changes: 18 additions & 0 deletions config/boards/arm/mriya/mriya_left.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* Copyright (c) 2023 Anderi Gaevskii
*
* SPDX-License-Identifier: MIT
*/

#include "mriya.dtsi"

&kscan0 {
col-gpios
= <&gpio0 22 GPIO_ACTIVE_HIGH>
, <&gpio1 0 GPIO_ACTIVE_HIGH>
, <&gpio1 3 GPIO_ACTIVE_HIGH>
, <&gpio1 1 GPIO_ACTIVE_HIGH>
, <&gpio1 2 GPIO_ACTIVE_HIGH>
, <&gpio1 4 GPIO_ACTIVE_HIGH>
;
};
7 changes: 7 additions & 0 deletions config/boards/arm/mriya/mriya_left.keymap
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*
* Copyright (c) 2023 Andrei Gaevskii
*
* SPDX-License-Identifier: MIT
*/

#include "mriya.keymap"
Loading

0 comments on commit 286edf8

Please sign in to comment.