summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPete Johanson <peter@peterjohanson.com>2020-07-01 22:58:30 -0400
committerPete Johanson <peter@peterjohanson.com>2020-07-01 22:58:30 -0400
commit7ce82fbd12854a379755802dd83b5592ed17f345 (patch)
tree0b8a66410bbcfc187204762662944fc5715f02be
parent4c5ed99381c47633c009177639896eebfb7e2002 (diff)
Add ability to have board overlay combined w/ shield keymap.
-rw-r--r--app/cmake/zmk_config.cmake3
-rw-r--r--app/dts/common/arduino_uno_pro_micro_map.dtsi49
2 files changed, 52 insertions, 0 deletions
diff --git a/app/cmake/zmk_config.cmake b/app/cmake/zmk_config.cmake
index 89c141a..c0993c7 100644
--- a/app/cmake/zmk_config.cmake
+++ b/app/cmake/zmk_config.cmake
@@ -44,6 +44,9 @@ endif()
set(CACHED_ZMK_CONFIG ${ZMK_CONFIG} CACHE STRING "Selected user ZMK config")
foreach(root ${BOARD_ROOT})
+ if (EXISTS "${root}/boards/${BOARD}.overlay")
+ list(APPEND ZMK_DTC_FILES "${root}/boards/${BOARD}.overlay")
+ endif()
find_path(BOARD_DIR
NAMES ${BOARD}_defconfig
PATHS ${root}/boards/*/*
diff --git a/app/dts/common/arduino_uno_pro_micro_map.dtsi b/app/dts/common/arduino_uno_pro_micro_map.dtsi
new file mode 100644
index 0000000..fe59a86
--- /dev/null
+++ b/app/dts/common/arduino_uno_pro_micro_map.dtsi
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2020 Pete Johanson
+ *
+ * SPDX-License-Identifier: MIT
+ */
+
+/* This provies a mapping from Arduino Uno to Arduino Pro Micro pins for development */
+
+/ {
+ pro_micro_d: connector_d {
+ compatible = "arduino-pro-micro";
+ #gpio-cells = <2>;
+ gpio-map-mask = <0xffffffff 0xffffffc0>;
+ gpio-map-pass-thru = <0 0x3f>;
+ gpio-map
+ = <0 0 &arduino_header 6 0> /* D0 */
+ , <1 0 &arduino_header 7 0> /* D1 */
+ , <2 0 &arduino_header 8 0> /* D2 */
+ , <3 0 &arduino_header 9 0> /* D3 */
+ , <4 0 &arduino_header 10 0> /* D4/A6 */
+ , <5 0 &arduino_header 11 0> /* D5 */
+ , <6 0 &arduino_header 12 0> /* D6/A7 */
+ , <7 0 &arduino_header 13 0> /* D7 */
+ , <8 0 &arduino_header 14 0> /* D8/A8 */
+ , <9 0 &arduino_header 15 0> /* D9/A9 */
+ , <10 0 &arduino_header 16 0> /* D10/A10 */
+ , <16 0 &arduino_header 17 0> /* D16 */
+ , <14 0 &arduino_header 18 0> /* D14 */
+ , <15 0 &arduino_header 19 0> /* D15 */
+ ;
+ };
+
+ pro_micro_a: connector_a {
+ compatible = "arduino-pro-micro";
+ #gpio-cells = <2>;
+ gpio-map-mask = <0xffffffff 0xffffffc0>;
+ gpio-map-pass-thru = <0 0x3f>;
+ gpio-map
+ = <0 0 &arduino_header 0 0> /* A0 */
+ , <1 0 &arduino_header 1 0> /* A1 */
+ , <2 0 &arduino_header 2 0> /* A2 */
+ , <3 0 &arduino_header 3 0> /* A3 */
+ ;
+ };
+};
+
+pro_micro_i2c: &arduino_i2c {};
+pro_micro_spi: &arduino_spi {};
+pro_micro_serial: &arduino_serial {};