-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add wired split support using UART communication
- Loading branch information
1 parent
edbbbc7
commit 9072f10
Showing
12 changed files
with
457 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,41 @@ | ||
# Copyright (c) 2021 The ZMK Contributors | ||
# SPDX-License-Identifier: MIT | ||
|
||
if SHIELD_A_DUX_LEFT || SHIELD_A_DUX_RIGHT | ||
|
||
if ZMK_BLE || ZMK_USB | ||
config ZMK_SPLIT | ||
default y | ||
endif | ||
|
||
if SHIELD_A_DUX_LEFT | ||
|
||
config ZMK_KEYBOARD_NAME | ||
default "A. Dux" | ||
|
||
if ZMK_BLE | ||
config ZMK_SPLIT_BLE_ROLE_CENTRAL | ||
default y | ||
endif | ||
|
||
if ZMK_USB | ||
choice ZMK_SPLIT_SERIAL_ROLE | ||
default ZMK_SPLIT_SERIAL_ROLE_CENTRAL | ||
endchoice | ||
endif | ||
|
||
if SHIELD_A_DUX_LEFT || SHIELD_A_DUX_RIGHT | ||
# SHIELD_A_DUX_LEFT | ||
endif | ||
|
||
config ZMK_SPLIT | ||
default y | ||
if SHIELD_A_DUX_RIGHT | ||
|
||
if ZMK_USB | ||
choice ZMK_SPLIT_SERIAL_ROLE | ||
default ZMK_SPLIT_SERIAL_ROLE_PERIPHERAL | ||
endchoice | ||
endif | ||
|
||
# SHIELD_A_DUX_RIGHT | ||
endif | ||
|
||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright (c) 2022 The ZMK Contributors | ||
* | ||
* SPDX-License-Identifier: MIT | ||
*/ | ||
|
||
/ { | ||
chosen { | ||
zmk,split-serial = &usart1; | ||
}; | ||
}; | ||
|
||
&usart1 { | ||
status = "okay"; | ||
}; | ||
|
||
&kscan0 { | ||
input-gpios = | ||
<&pro_micro_d 5 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>, | ||
<&pro_micro_d 0 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>, | ||
<&pro_micro_a 0 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>, | ||
<&pro_micro_d 16 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>, | ||
<&pro_micro_a 3 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>, | ||
<&pro_micro_d 6 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>, | ||
<&pro_micro_d 2 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>, /* Changed since swapped pins */ | ||
<&pro_micro_a 1 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>, | ||
<&pro_micro_d 14 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>, | ||
<&pro_micro_a 2 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>, | ||
<&pro_micro_d 7 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>, | ||
<&pro_micro_d 4 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>, | ||
<&pro_micro_d 1 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>, /* TODO: Use 0 if Console is needed */ | ||
<&pro_micro_d 15 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>, | ||
<&pro_micro_d 10 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>, | ||
<&pro_micro_d 8 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>, | ||
<&pro_micro_d 9 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> | ||
; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* Copyright (c) 2022 The ZMK Contributors | ||
* | ||
* SPDX-License-Identifier: MIT | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <zephyr/types.h> | ||
|
||
#define SPLIT_DATA_LEN 16 | ||
|
||
#define SPLIT_TYPE_KEYPOSITION 0 | ||
|
||
typedef struct _split_data_t { | ||
uint16_t type; | ||
uint8_t data[SPLIT_DATA_LEN]; | ||
uint16_t crc; | ||
} split_data_t; | ||
|
||
int zmk_split_position_pressed(uint8_t position); | ||
|
||
int zmk_split_position_released(uint8_t position); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.