summaryrefslogtreecommitdiff
path: root/app/include/zmk/sensors.h
diff options
context:
space:
mode:
authorPete Johanson <peter@peterjohanson.com>2020-07-22 16:30:05 -0400
committerGitHub <noreply@github.com>2020-07-22 16:30:05 -0400
commit36f36f21f7bbdaf2443947c8ed3ef0f597b7e5f9 (patch)
treec2d7e993a43e16787d6c5999469f849654c8bd72 /app/include/zmk/sensors.h
parent5896c3032b4d8c7ed4962672b75360a54c5b0e1c (diff)
parent5958bfed0bd764c50d1a926a29a419b6f99018d5 (diff)
Merge pull request #61 from petejohanson/sensors/sensor-keymap-bindings
Add sensor handling to keymaps.
Diffstat (limited to 'app/include/zmk/sensors.h')
-rw-r--r--app/include/zmk/sensors.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/app/include/zmk/sensors.h b/app/include/zmk/sensors.h
new file mode 100644
index 0000000..c60cd4b
--- /dev/null
+++ b/app/include/zmk/sensors.h
@@ -0,0 +1,12 @@
+/*
+ * Copyright (c) 2020 Peter Johanson <peter@peterjohanson.com>
+ *
+ * SPDX-License-Identifier: MIT
+ */
+
+#pragma once
+
+#define ZMK_KEYMAP_SENSORS_NODE DT_INST(0, zmk_keymap_sensors)
+#define ZMK_KEYMAP_HAS_SENSORS DT_NODE_EXISTS(ZMK_KEYMAP_SENSORS_NODE)
+#define ZMK_KEYMAP_SENSORS_LEN DT_PROP_LEN(ZMK_KEYMAP_SENSORS_NODE, sensors)
+#define ZMK_KEYMAP_SENSORS_BY_IDX(idx) DT_PHANDLE_BY_IDX(ZMK_KEYMAP_SENSORS_NODE, sensors, idx) \ No newline at end of file