|
| 1 | +/* |
| 2 | + * Copyright (c) 2020 The ZMK Contributors |
| 3 | + * |
| 4 | + * SPDX-License-Identifier: MIT |
| 5 | + */ |
| 6 | + |
| 7 | +/dts-v1/; |
| 8 | +#include <st/f0/stm32f072Xb.dtsi> |
| 9 | + |
| 10 | +#include <dt-bindings/zmk/matrix_transform.h> |
| 11 | + |
| 12 | +/ { |
| 13 | + model = "Ferris rev0.2"; |
| 14 | + compatible = "ferris,rev02", "st,stm32f072"; |
| 15 | + |
| 16 | + chosen { |
| 17 | + zephyr,sram = &sram0; |
| 18 | + zephyr,flash = &flash0; |
| 19 | + zmk,kscan = &kscan; |
| 20 | + zmk,matrix_transform = &transform; |
| 21 | + /* TODO: Enable once we support the IC for underglow |
| 22 | + zmk,underglow = &led_strip; |
| 23 | + */ |
| 24 | + }; |
| 25 | + |
| 26 | + transform: transform { |
| 27 | + compatible = "zmk,matrix-transform"; |
| 28 | + rows = <4>; |
| 29 | + columns = <10>; |
| 30 | + |
| 31 | + map = < |
| 32 | + RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,5) RC(0,6) RC(0,7) RC(0,8) RC(0,9) |
| 33 | + RC(1,0) RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5) RC(1,6) RC(1,7) RC(1,8) RC(1,9) |
| 34 | + 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) |
| 35 | + RC(3,3) RC(3,4) RC(3,5) RC(3,6) |
| 36 | + >; |
| 37 | + }; |
| 38 | + |
| 39 | + kscan: kscan { |
| 40 | + compatible = "zmk,kscan-composite"; |
| 41 | + label = "KSCAN"; |
| 42 | + rows = <4>; |
| 43 | + columns = <10>; |
| 44 | + |
| 45 | + left { |
| 46 | + kscan = <&kscan_left>; |
| 47 | + }; |
| 48 | + |
| 49 | + right { |
| 50 | + kscan = <&kscan_right>; |
| 51 | + column-offset = <5>; |
| 52 | + }; |
| 53 | + }; |
| 54 | + |
| 55 | + kscan_left: kscan_left { |
| 56 | + compatible = "zmk,kscan-gpio-matrix"; |
| 57 | + label = "KSCAN_LEFT"; |
| 58 | + |
| 59 | + diode-direction = "col2row"; |
| 60 | + |
| 61 | + col-gpios |
| 62 | + = <&gpiob 8 (GPIO_ACTIVE_HIGH)> |
| 63 | + , <&gpiob 4 (GPIO_ACTIVE_HIGH)> |
| 64 | + , <&gpiob 3 (GPIO_ACTIVE_HIGH)> |
| 65 | + , <&gpioa 15 (GPIO_ACTIVE_HIGH)> |
| 66 | + , <&gpioa 14 (GPIO_ACTIVE_HIGH)> |
| 67 | + ; |
| 68 | + row-gpios |
| 69 | + = <&gpiob 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> |
| 70 | + , <&gpiob 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> |
| 71 | + , <&gpiob 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> |
| 72 | + , <&gpioa 2 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> |
| 73 | + ; |
| 74 | + }; |
| 75 | + |
| 76 | + kscan_right: kscan_right { |
| 77 | + compatible = "zmk,kscan-gpio-matrix"; |
| 78 | + label = "KSCAN_RIGHT"; |
| 79 | + |
| 80 | + diode-direction = "row2col"; |
| 81 | + |
| 82 | + col-gpios |
| 83 | + = <&right_io 0 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> |
| 84 | + , <&right_io 1 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> |
| 85 | + , <&right_io 2 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> |
| 86 | + , <&right_io 3 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> |
| 87 | + , <&right_io 4 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> |
| 88 | + ; |
| 89 | + row-gpios |
| 90 | + = <&right_io 8 (GPIO_ACTIVE_LOW)> |
| 91 | + , <&right_io 9 (GPIO_ACTIVE_LOW)> |
| 92 | + , <&right_io 10 (GPIO_ACTIVE_LOW)> |
| 93 | + , <&right_io 11 (GPIO_ACTIVE_LOW)> |
| 94 | + ; |
| 95 | + }; |
| 96 | +}; |
| 97 | + |
| 98 | +&i2c2 { |
| 99 | + status = "okay"; |
| 100 | + clock-frequency = <I2C_BITRATE_FAST>; |
| 101 | + |
| 102 | + right_io: mcp23017@20 { |
| 103 | + compatible = "microchip,mcp23017"; |
| 104 | + status = "okay"; |
| 105 | + gpio-controller; |
| 106 | + reg = <0x20>; |
| 107 | + label = "RIGHT_IO"; |
| 108 | + #gpio-cells = <2>; |
| 109 | + ngpios = <16>; |
| 110 | + }; |
| 111 | +}; |
| 112 | + |
| 113 | +&usb { |
| 114 | + status = "okay"; |
| 115 | +}; |
| 116 | + |
| 117 | +&rtc { |
| 118 | + status = "okay"; |
| 119 | +}; |
| 120 | + |
| 121 | +&flash0 { |
| 122 | + /* |
| 123 | + * For more information, see: |
| 124 | + * http://docs.zephyrproject.org/latest/guides/dts/index.html#flash-partitions |
| 125 | + */ |
| 126 | + partitions { |
| 127 | + compatible = "fixed-partitions"; |
| 128 | + #address-cells = <1>; |
| 129 | + #size-cells = <1>; |
| 130 | + |
| 131 | + /* Set 6Kb of storage at the end of the 128Kb of flash */ |
| 132 | + storage_partition: partition@3e800 { |
| 133 | + label = "storage"; |
| 134 | + reg = <0x0001e800 0x00001800>; |
| 135 | + }; |
| 136 | + }; |
| 137 | +}; |
0 commit comments