Skip to content

Instantly share code, notes, and snippets.

@YCF
Forked from petejohanson/board.dts
Created September 1, 2021 14:09
Show Gist options
  • Save YCF/a1d5bf971c1a39b839d34e2dc49b2fda to your computer and use it in GitHub Desktop.
Save YCF/a1d5bf971c1a39b839d34e2dc49b2fda to your computer and use it in GitHub Desktop.
Zephyr level shifter GPIO abstraction
/dts-v1/
/ {
shifter: 74hc595a@0 {
compatible = "ti,xx74hc595a";
a-gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>;
b-gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>;
c-gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>;
}
kscan: kscan0 {
compatible = "zmk,kscan-gpio-matrix";
diode-direction = "col2row";
col-gpios =
<&shifter 0 GPIO_ACTIVE_HIGH>,
<&shifter 1 GPIO_ACTIVE_HIGH>,
<&shifter 2 GPIO_ACTIVE_HIGH>,
<&shifter 3 GPIO_ACTIVE_HIGH>,
<&shifter 4 GPIO_ACTIVE_HIGH>
;
row-gpios = <&gpio0 0 GPIO_ACTIVE_HIGH GPIO_PULL_DOWN>;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment