2020-05-11 07:13:24 +10:00
|
|
|
#pragma once
|
2020-05-02 13:37:37 +10:00
|
|
|
|
|
|
|
#include <devicetree.h>
|
|
|
|
#include <usb/usb_device.h>
|
|
|
|
#include <usb/class/usb_hid.h>
|
2020-05-18 23:11:46 +10:00
|
|
|
#include <dt-bindings/zmk/keys.h>
|
2020-05-02 13:37:37 +10:00
|
|
|
|
2020-05-18 23:11:46 +10:00
|
|
|
#include <zmk/matrix.h>
|
|
|
|
#include <zmk/keys.h>
|
2020-05-02 13:37:37 +10:00
|
|
|
|
2020-05-04 05:49:33 +10:00
|
|
|
#define ZMK_KEYMAP_NODE DT_CHOSEN(zmk_keymap)
|
2020-05-11 07:13:24 +10:00
|
|
|
#define ZMK_KEYMAP_LAYERS_LEN DT_PROP_LEN(ZMK_KEYMAP_NODE, layers)
|
2020-05-02 13:37:37 +10:00
|
|
|
|
2020-05-19 03:50:30 +10:00
|
|
|
/* TODO: Need to actually be able to get a NODELABEL from a node id
|
2020-05-19 03:42:41 +10:00
|
|
|
#define _ZMK_KEYMAP_GENERATE_LAYER_CONST(node_id) \
|
2020-05-19 03:50:30 +10:00
|
|
|
DT_NODELABEL_FOR_NODE(node_id)_layer,
|
2020-05-19 03:42:41 +10:00
|
|
|
|
|
|
|
enum zmk_keymap_layer
|
|
|
|
{
|
|
|
|
DT_FOREACH_CHILD(DT_INST(0, zmk_layers), _ZMK_KEYMAP_GENERATE_LAYER_CONST)
|
|
|
|
};
|
2020-05-19 03:50:30 +10:00
|
|
|
*/
|
2020-05-19 03:42:41 +10:00
|
|
|
|
2020-05-11 07:13:24 +10:00
|
|
|
bool zmk_keymap_layer_activate(u8_t layer);
|
|
|
|
bool zmk_keymap_layer_deactivate(u8_t layer);
|
2020-05-02 13:37:37 +10:00
|
|
|
|
2020-05-11 07:13:24 +10:00
|
|
|
zmk_key
|
|
|
|
zmk_keymap_keycode_from_position(u32_t row, u32_t column);
|