Browse Source

Refactor ProMicro to a/d connector.

xmkb
Pete Johanson 4 years ago
parent
commit
2ff217d39e
  1. 55
      app/boards/arm/nice_nano/arduino_pro_micro_pins.dtsi
  2. 55
      app/boards/arm/proton_c/arduino_pro_micro_pins.dtsi
  3. 88
      app/boards/shields/kyria/kyria.overlay
  4. 8
      app/boards/shields/petejohanson_proton_handwire/petejohanson_proton_handwire.overlay

55
app/boards/arm/nice_nano/arduino_pro_micro_pins.dtsi

@ -5,30 +5,45 @@
*/ */
/ { / {
pro_micro_pins: connector { pro_micro_d: connector_d {
compatible = "arduino-pro-micro"; compatible = "arduino-pro-micro";
#gpio-cells = <2>; #gpio-cells = <2>;
gpio-map-mask = <0xffffffff 0xffffffc0>; gpio-map-mask = <0xffffffff 0xffffffc0>;
gpio-map-pass-thru = <0 0x3f>; gpio-map-pass-thru = <0 0x3f>;
gpio-map = gpio-map
<1 0 &gpio0 6 0>, /* D1 */ = <0 0 &gpio0 8 0> /* D0 */
<0 0 &gpio0 8 0>, /* D0 */ , <1 0 &gpio0 6 0> /* D1 */
<2 0 &gpio0 17 0>, /* D2 */ , <2 0 &gpio0 17 0> /* D2 */
<3 0 &gpio0 20 0>, /* D3 */ , <3 0 &gpio0 20 0> /* D3 */
<4 0 &gpio0 22 0>, /* D4/A6 */ , <4 0 &gpio0 22 0> /* D4/A6 */
<5 0 &gpio0 24 0>, /* D5 */ , <5 0 &gpio0 24 0> /* D5 */
<6 0 &gpio1 0 0>, /* D6/A7 */ , <6 0 &gpio1 0 0> /* D6/A7 */
<7 0 &gpio0 11 0>, /* D7 */ , <7 0 &gpio0 11 0> /* D7 */
<8 0 &gpio1 4 0>, /* D8/A8 */ , <8 0 &gpio1 4 0> /* D8/A8 */
<9 0 &gpio1 6 0>, /* D9/A9 */ , <9 0 &gpio1 6 0> /* D9/A9 */
<10 0 &gpio0 9 0>, /* D10/A10 */ , <10 0 &gpio0 9 0> /* D10/A10 */
<16 0 &gpio0 10 0>, /* D16 */ , <16 0 &gpio0 10 0> /* D16 */
<14 0 &gpio1 11 0>, /* D14 */ , <14 0 &gpio1 11 0> /* D14 */
<15 0 &gpio1 13 0>, /* D15 */ , <15 0 &gpio1 13 0> /* D15 */
<18 0 &gpio1 15 0>, /* A0 */ ;
<19 0 &gpio0 2 0>, /* A1 */ };
<20 0 &gpio0 29 0>, /* A2 */
<21 0 &gpio0 31 0>; /* A3 */ 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 &gpio1 15 0> /* A0 */
, <1 0 &gpio0 2 0> /* A1 */
, <2 0 &gpio0 29 0> /* A2 */
, <3 0 &gpio0 31 0> /* A3 */
, <6 0 &gpio0 22 0> /* D4/A6 */
, <7 0 &gpio1 0 0> /* D6/A7 */
, <8 0 &gpio1 4 0> /* D8/A8 */
, <9 0 &gpio1 6 0> /* D9/A9 */
, <10 0 &gpio0 9 0> /* D10/A10 */
;
}; };
}; };

55
app/boards/arm/proton_c/arduino_pro_micro_pins.dtsi

@ -5,33 +5,44 @@
*/ */
/ { / {
pro_micro_pins: connector { pro_micro_d: connector_d {
compatible = "arduino-pro-micro"; compatible = "arduino-pro-micro";
#gpio-cells = <2>; #gpio-cells = <2>;
gpio-map-mask = <0xffffffff 0xffffffc0>; gpio-map-mask = <0xffffffff 0xffffffc0>;
gpio-map-pass-thru = <0 0x3f>; gpio-map-pass-thru = <0 0x3f>;
gpio-map = gpio-map
/* Down the front left side */ = <00 0 &gpioa 10 0> /* D0 */
<1 0 &gpioa 9 0>, /* D1 */ , <01 0 &gpioa 9 0> /* D1 */
<0 0 &gpioa 10 0>, /* D0 */ , <02 0 &gpiob 7 0> /* D2 */
<2 0 &gpiob 7 0>, /* D2 */ , <03 0 &gpiob 6 0> /* D3 */
<3 0 &gpiob 6 0>, /* D3 */ , <04 0 &gpiob 5 0> /* D4/A6 */
<4 0 &gpiob 5 0>, /* D4/A6 */ , <05 0 &gpiob 4 0> /* D5 */
<5 0 &gpiob 4 0>, /* D5 */ , <06 0 &gpiob 3 0> /* D6/A7 */
<6 0 &gpiob 3 0>, /* D6/A7 */ , <07 0 &gpiob 2 0> /* D7 */
<7 0 &gpiob 2 0>, /* D7 */ , <08 0 &gpiob 1 0> /* D8/A8 */
<8 0 &gpiob 1 0>, /* D8/A8 */ , <09 0 &gpiob 0 0> /* D9/A9 */
<9 0 &gpiob 0 0>, /* D9/A9 */ , <10 0 &gpiob 9 0> /* D10/A10 */
, <16 0 &gpiob 15 0> /* D16 */
, <14 0 &gpiob 14 0> /* D14 */
, <15 0 &gpiob 13 0> /* D15 */
};
/* Back up the front right side */ pro_micro_a: connector_a {
<10 0 &gpiob 9 0>, /* D10/A10 */ compatible = "arduino-pro-micro";
<16 0 &gpiob 15 0>, /* D16 */ #gpio-cells = <2>;
<14 0 &gpiob 14 0>, /* D14 */ gpio-map-mask = <0xffffffff 0xffffffc0>;
<15 0 &gpiob 13 0>, /* D15 */ gpio-map-pass-thru = <0 0x3f>;
<18 0 &gpiob 8 0>, /* A0 */ gpio-map
<19 0 &gpioa 0 0>, /* A1 */ = <00 0 &gpiob 8 0> /* A0 */
<20 0 &gpioa 1 0>, /* A2 */ , <01 0 &gpioa 0 0> /* A1 */
<21 0 &gpioa 2 0>; /* A3 */ , <02 0 &gpioa 1 0> /* A2 */
, <03 0 &gpioa 2 0> /* A3 */
, <06 0 &gpiob 5 0> /* D4/A6 */
, <07 0 &gpiob 3 0> /* D6/A7 */
, <08 0 &gpiob 1 0> /* D8/A8 */
, <09 0 &gpiob 0 0> /* D9/A9 */
, <10 0 &gpiob 9 0> /* D10/A10 */
;
}; };
}; };

88
app/boards/shields/kyria/kyria.overlay

@ -10,7 +10,7 @@
/ { / {
chosen { chosen {
zmk,kscan = &kscan0; zmk,kscan = &kscan_left;
zmk,matrix_transform = &default_transform; zmk,matrix_transform = &default_transform;
}; };
@ -25,12 +25,12 @@
kscan = <&kscan_left>; kscan = <&kscan_left>;
}; };
right { // right {
kscan = <&kscan_right>; // kscan = <&kscan_right>;
// TODO: Actually put this in the kscan driver, so it can report // // TODO: Actually put this in the kscan driver, so it can report
// HID events directly to host if plugged in directly. // // HID events directly to host if plugged in directly.
column-offset = <8>; // column-offset = <8>;
}; // };
}; };
default_transform: keymap_transform_0 { default_transform: keymap_transform_0 {
@ -65,42 +65,50 @@ RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(2,6) RC(2,7) RC(2,8) RC(2,9)
compatible = "zmk,kscan-gpio-matrix"; compatible = "zmk,kscan-gpio-matrix";
label = "KSCAN_LEFT"; label = "KSCAN_LEFT";
diode-direction = "row2col"; diode-direction = "col2row";
row-gpios = <&pro_micro_pins 8 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>, row-gpios
<&pro_micro_pins 7 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>, = <&pro_micro_d 8 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
<&pro_micro_pins 6 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>, , <&pro_micro_d 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
<&pro_micro_pins 4 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; , <&pro_micro_d 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&pro_micro_d 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
col-gpios = <&pro_micro_pins 10 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>, ;
<&pro_micro_pins 16 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>,
<&pro_micro_pins 14 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>, col-gpios
<&pro_micro_pins 15 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>, = <&pro_micro_a 3 (GPIO_ACTIVE_HIGH)>
<&pro_micro_pins 18 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>, , <&pro_micro_a 2 (GPIO_ACTIVE_HIGH)>
<&pro_micro_pins 19 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>, , <&pro_micro_a 1 (GPIO_ACTIVE_HIGH)>
<&pro_micro_pins 20 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>, , <&pro_micro_a 0 (GPIO_ACTIVE_HIGH)>
<&pro_micro_pins 21 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; , <&pro_micro_d 15 (GPIO_ACTIVE_HIGH)>
}; , <&pro_micro_d 14 (GPIO_ACTIVE_HIGH)>
, <&pro_micro_d 16 (GPIO_ACTIVE_HIGH)>
, <&pro_micro_d 10 (GPIO_ACTIVE_HIGH)>
;
kscan_right: kscan_right {
compatible = "zmk,kscan-gpio-matrix";
label = "KSCAN_RIGHT";
diode-direction = "row2col";
row-gpios = <&pro_micro_pins 8 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>,
<&pro_micro_pins 7 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>,
<&pro_micro_pins 6 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>,
<&pro_micro_pins 4 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
col-gpios = <&pro_micro_pins 21 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>,
<&pro_micro_pins 20 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>,
<&pro_micro_pins 19 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>,
<&pro_micro_pins 18 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>,
<&pro_micro_pins 15 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>,
<&pro_micro_pins 14 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>,
<&pro_micro_pins 16 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>,
<&pro_micro_pins 10 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
}; };
// kscan_right: kscan_right {
// compatible = "zmk,kscan-gpio-matrix";
// label = "KSCAN_RIGHT";
// diode-direction = "col2row";
// row-gpios
// = <&pro_micro_d 8 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
// , <&pro_micro_d 7 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
// , <&pro_micro_d 6 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
// , <&pro_micro_d 4 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
// ;
// col-gpios
// = <&pro_micro_d 10 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
// , <&pro_micro_d 16 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
// , <&pro_micro_d 14 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
// , <&pro_micro_d 15 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
// , <&pro_micro_a 0 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
// , <&pro_micro_a 1 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
// , <&pro_micro_a 2 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
// , <&pro_micro_a 3 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
// ;
// };
// TODO: Encoder node(s) // TODO: Encoder node(s)
// TODO: OLED node // TODO: OLED node
// TODO: RGB node(s) // TODO: RGB node(s)

8
app/boards/shields/petejohanson_proton_handwire/petejohanson_proton_handwire.overlay

@ -9,9 +9,9 @@
label = "KSCAN"; label = "KSCAN";
diode-direction = "row2col"; diode-direction = "row2col";
row-gpios = <&pro_micro_pins 6 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>, row-gpios = <&pro_micro_d 6 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>,
<&pro_micro_pins 7 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; <&pro_micro_d 7 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
col-gpios = <&pro_micro_pins 8 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>, col-gpios = <&pro_micro_d 8 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>,
<&pro_micro_pins 9 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; <&pro_micro_d 9 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
}; };
}; };

Loading…
Cancel
Save