Add TFT 1.3" Bonnet + Joystick as a new device

This commit is contained in:
Peter Frost 2021-03-13 23:55:48 +00:00
parent 4136b91069
commit 242247c1f3
2 changed files with 133 additions and 1 deletions

View file

@ -161,6 +161,23 @@ dtoverlay=pitft28-capacitive,{rotation}""",
"270": "0",
},
},
{
"type": "st7789v_bonnet_240x240",
"menulabel": "TFT 1.3\" Bonnet + Joystick",
"product": "1.3\" Joystick",
"kernel_upgrade": True,
"overlay_src": "overlays/tftbonnet13-overlay.dts",
"overlay_dest": "/boot/overlays/drm-tftbonnet13.dtbo",
"overlay": "dtoverlay=drm-tftbonnet13,rotate={pitftrot},fps=60",
"width": 240,
"height": 240,
"fbcp_rotations": {
"0": "0",
"90": "1",
"180": "2",
"270": "3",
},
},
]
# default rotations

View file

@ -0,0 +1,115 @@
/*
* Device Tree overlay for Adafruit TFT Bonnet 1.3" 240x240 Display + Joystick
*
*/
/dts-v1/;
/plugin/;
/ {
compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";
fragment@0 {
target = <&spi0>;
__overlay__ {
status = "okay";
spidev@0{
status = "disabled";
};
spidev@1{
status = "disabled";
};
};
};
fragment@1 {
target = <&gpio>;
__overlay__ {
pitft_pins: pitft_pins {
brcm,pins = <25>;
brcm,function = <1>; /* out */
brcm,pull = <0>; /* none */
};
};
};
fragment@2 {
target = <&spi0>;
__overlay__ {
/* needed to avoid dtc warning */
#address-cells = <1>;
#size-cells = <0>;
pitft: pitft@0{
compatible = "sitronix,st7789v";
reg = <0>;
pinctrl-names = "default";
pinctrl-0 = <&pitft_pins>;
spi-max-frequency = <32000000>;
rotate = <0>;
width = <240>;
height = <240>;
buswidth = <8>;
dc-gpios = <&gpio 25 0>;
led-gpios = <&gpio 26 0>;
debug = <0>;
};
};
};
fragment@3 {
target-path = "/";
__overlay__ {
keypad: tft_bonnet_keys {
compatible = "gpio-keys";
button@17 {
label = "Controller Up";
linux,code = <103>;
gpios = <&gpio 17 1>;
};
button@22 {
label = "Controller Down";
linux,code = <108>;
gpios = <&gpio 22 1>;
};
button@27 {
label = "Controller Left";
linux,code = <105>;
gpios = <&gpio 27 1>;
};
button@23 {
label = "Controller Right";
linux,code = <106>;
gpios = <&gpio 23 1>;
};
button@4 {
label = "Controller Center";
linux,code = <28>;
gpios = <&gpio 4 1>;
};
button@5 {
label = "Controller B";
linux,code = <48>;
gpios = <&gpio 5 1>;
};
button@6 {
label = "Controller A";
linux,code = <30>;
gpios = <&gpio 6 1>;
};
};
};
};
__overrides__ {
speed = <&pitft>,"spi-max-frequency:0";
rotate = <&pitft>,"rotate:0";
width = <&pitft>,"width:0";
height = <&pitft>,"height:0";
fps = <&pitft>,"fps:0";
debug = <&pitft>,"debug:0";
};
};