blob: 4456d08e06555fa452f2e2a0345e842207bc141e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
#ifndef ZMK_KEYMAP_H
#define ZMK_KEYMAP_H
#include <devicetree.h>
#include <usb/usb_device.h>
#include <usb/class/usb_hid.h>
// TODO: Pull these in fro a kscan_gpio.h file from Zephyr!
//
#define MATRIX_NODE_ID DT_PATH(kscan)
#define MATRIX_ROWS DT_PROP_LEN(MATRIX_NODE_ID,row_gpios)
#define MATRIX_COLS DT_PROP_LEN(MATRIX_NODE_ID,col_gpios)
enum hid_kbd_code keymap[MATRIX_ROWS][MATRIX_COLS] = {
{ HID_KEY_A, HID_KEY_B },
{ HID_KEY_C, HID_KEY_D }
};
#define zmk_keymap_keycode_from_position(row, column) keymap[row][column]
#endif
|