#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>

#define PIN_MACRO(name, pin) \
/ { \
    macros { \
        name: name { \
            compatible = "zmk,behavior-macro"; \
            wait-ms = <5>; \
            tap-ms = <5>; \
            #binding-cells = <0>; \
            bindings = <&kp P &kp I &kp N &kp SPACE>, pin, <&kp ENTER>; \
        }; \
    }; \
};

PIN_MACRO(pin0, <&kp N0>)
PIN_MACRO(pin1, <&kp N1>)
PIN_MACRO(pin2, <&kp N2>)
PIN_MACRO(pin3, <&kp N3>)
PIN_MACRO(pin4, <&kp N4>)
PIN_MACRO(pin5, <&kp N5>)
PIN_MACRO(pin6, <&kp N6>)
PIN_MACRO(pin7, <&kp N7>)
PIN_MACRO(pin8, <&kp N8>)
PIN_MACRO(pin9, <&kp N9>)
PIN_MACRO(pin10, <&kp N1 &kp N0>)

/ {
    keymap {
        compatible = "zmk,keymap";

        default_layer {
            bindings = <&pin0
                        &pin1
                        &pin2
                        &pin3
                        &pin4
                        &pin5
                        &pin6
                        &pin7
                        &pin8
                        &pin9
                        &pin10>;
        };
    };
};
