1
0
Fork 0

Initial bring up of bluehand by jpconstantineau

This commit is contained in:
KemoNine 2021-03-08 23:35:35 +00:00
parent cd4a06774a
commit 071d536141
12 changed files with 251 additions and 0 deletions

View file

@ -21,6 +21,10 @@ jobs:
shield: corne_5_col_artsey_left
- board: nice_nano
shield: corne_5_col_artsey_right
- board: bluemicro840_v1
shield: bluehand_left
- board: bluemicro840_v1
shield: bluehand_right
steps:
- name: Checkout
uses: actions/checkout@v2

View file

@ -0,0 +1,6 @@
#
# Copyright (c) 2021 Mike "KemoNine" Crosson
# SPDX-License-Identifier: MIT
#
target_sources_ifdef(CONFIG_SHIELD_BLUEHAND_LEFT || CONFIG_SHIELD_BLUEHAND_RIGHT app PRIVATE pwr_led.c)

View file

@ -0,0 +1,6 @@
if SHIELD_BLUEHAND_LEFT || SHIELD_BLUEHAND_RIGHT
config ZMK_KEYBOARD_NAME
default "BlueHand"
endif

View file

@ -0,0 +1,8 @@
# Copyright (c) 2021 Mike "KemoNine" Crosson
# SPDX-License-Identifier: MIT
config SHIELD_BLUEHAND_LEFT
def_bool $(shields_list_contains,bluehand_left)
config SHIELD_BLUEHAND_RIGHT
def_bool $(shields_list_contains,bluehand_right)

View file

@ -0,0 +1,3 @@
# BlueHand
This directory contains the ARTSEY implementation for `BlueHand` hardware being developed by Pierre Constantineau (jpconstantineau).

View file

@ -0,0 +1,11 @@
# Copyright (c) 2021 Mike "KemoNine" Crosson
# SPDX-License-Identifier: MIT
# Tune combos to allow proper ARTSEY support
CONFIG_ZMK_COMBO_MAX_COMBOS_PER_KEY=16
CONFIG_ZMK_COMBO_MAX_KEYS_PER_COMBO=8
CONFIG_ZMK_COMBO_MAX_PRESSED_COMBOS=8
# Turn on deep sleep
CONFIG_ZMK_SLEEP=y
CONFIG_ZMK_IDLE_SLEEP_TIMEOUT=900000

View file

@ -0,0 +1,39 @@
/*
* Copyright (c) 2021 Mike "KemoNine" Crosson
*
* SPDX-License-Identifier: MIT
*/
#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/bt.h>
// THE BOARD IS FLIPPED FOR LEFT BUT STILL WIRED RIGHT!
#define ARTSEY_LEFT 1
// ARTS Row
#define KEY_A 7
#define KEY_R 6
#define KEY_T 5
#define KEY_S 4
// EYIO Row
#define KEY_E 3
#define KEY_Y 2
#define KEY_I 1
#define KEY_O 0
// Define Offsets
#define LEADING_NONES NONE(0, 0, 0)
#define MIDDLE_NONES NONE(0, 0, 0)
#define TRAILING_NONES NONE(0, 0, 0)
// Include main artsey.io keymap
#include "../../../artsey.dtsi"
/ {
combos {
compatible = "zmk,combos";
combo_bt_nxt { key-positions = <KEY_A KEY_E KEY_S KEY_O>; bindings = <&bt BT_NXT>; };
combo_bt_clr { key-positions = <KEY_R KEY_Y KEY_T KEY_I>; bindings = <&bt BT_CLR>; };
};
};

View file

@ -0,0 +1,43 @@
/*
* Copyright (c) 2021 Mike "KemoNine" Crosson
*
* SPDX-License-Identifier: MIT
*/
#include <dt-bindings/zmk/matrix_transform.h>
/ {
chosen {
zmk,kscan = &kscan0;
};
kscan0: kscan_0 {
compatible = "zmk,kscan-gpio-direct";
label = "KSCAN";
input-gpios
= <&gpio0 29 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
, <&gpio0 2 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
, <&gpio0 28 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
, <&gpio0 3 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
, <&gpio0 13 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
, <&gpio0 24 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
, <&gpio0 9 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
, <&gpio0 10 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
;
};
leds {
compatible = "gpio-leds";
actled: led_a {
gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>;
label = "ACT LED";
};
powerled: led_p {
gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>;
label = "PWR LED";
};
};
};

View file

@ -0,0 +1,11 @@
# Copyright (c) 2021 Mike "KemoNine" Crosson
# SPDX-License-Identifier: MIT
# Tune combos to allow proper ARTSEY support
CONFIG_ZMK_COMBO_MAX_COMBOS_PER_KEY=16
CONFIG_ZMK_COMBO_MAX_KEYS_PER_COMBO=8
CONFIG_ZMK_COMBO_MAX_PRESSED_COMBOS=8
# Turn on deep sleep
CONFIG_ZMK_SLEEP=y
CONFIG_ZMK_IDLE_SLEEP_TIMEOUT=900000

View file

@ -0,0 +1,39 @@
/*
* Copyright (c) 2021 Mike "KemoNine" Crosson
*
* SPDX-License-Identifier: MIT
*/
#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/bt.h>
// THE BOARD IS FLIPPED FOR LEFT BUT STILL WIRED RIGHT!
#define ARTSEY_RIGHT 1
// ARTS Row
#define KEY_A 0
#define KEY_R 1
#define KEY_T 2
#define KEY_S 3
// EYIO Row
#define KEY_E 4
#define KEY_Y 5
#define KEY_I 6
#define KEY_O 7
// Define Offsets
#define LEADING_NONES NONE(0, 0, 0)
#define MIDDLE_NONES NONE(0, 0, 0)
#define TRAILING_NONES NONE(0, 0, 0)
// Include main artsey.io keymap
#include "../../../artsey.dtsi"
/ {
combos {
compatible = "zmk,combos";
combo_bt_nxt { key-positions = <KEY_A KEY_E KEY_S KEY_O>; bindings = <&bt BT_NXT>; };
combo_bt_clr { key-positions = <KEY_R KEY_Y KEY_T KEY_I>; bindings = <&bt BT_CLR>; };
};
};

View file

@ -0,0 +1,43 @@
/*
* Copyright (c) 2021 Mike "KemoNine" Crosson
*
* SPDX-License-Identifier: MIT
*/
#include <dt-bindings/zmk/matrix_transform.h>
/ {
chosen {
zmk,kscan = &kscan0;
};
kscan0: kscan_0 {
compatible = "zmk,kscan-gpio-direct";
label = "KSCAN";
input-gpios
= <&gpio0 29 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
, <&gpio0 2 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
, <&gpio0 28 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
, <&gpio0 3 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
, <&gpio0 13 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
, <&gpio0 24 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
, <&gpio0 9 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
, <&gpio0 10 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
;
};
leds {
compatible = "gpio-leds";
actled: led_a {
gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>;
label = "ACT LED";
};
powerled: led_p {
gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>;
label = "PWR LED";
};
};
};

View file

@ -0,0 +1,38 @@
/*
* Copyright (c) 2021 Mike "KemoNine" Crosson
*
* SPDX-License-Identifier: MIT
*/
#include <zephyr.h>
#include <device.h>
#include <devicetree.h>
#include <drivers/gpio.h>
#define PWR_LED_NODE DT_ALIAS(powerled)
#if DT_NODE_HAS_STATUS(PWR_LED_NODE, okay)
#define PWR_LED DT_GPIO_LABEL(PWR_LED_NODE, gpios)
#define PWR_LED_PIN DT_GPIO_PIN(PWR_LED_NODE, gpios)
#else
/* A build error here means your board isn't set up to blink an LED. */
#error "Unsupported board: pwr_led devicetree alias is not defined"
#define PWR_LED ""
#define PIN 0
#define FLAGS 0
#endif
static int pwr_led_init(const struct device *dev) {
dev = device_get_binding(PWR_LED);
if (dev == NULL) {
return -EIO;
}
if (gpio_pin_configure(dev, PWR_LED_PIN, GPIO_OUTPUT) < 0) {
return -EIO;
}
return gpio_pin_set(dev, PIN, (int)true);
}
SYS_INIT(pwr_led_init, APPLICATION, CONFIG_APPLICATION_INIT_PRIORITY);