Skip to content

Instantly share code, notes, and snippets.

@franga2000
Created March 19, 2020 12:05
Show Gist options
  • Save franga2000/61c6bc2bd8836dc6158a10788b733422 to your computer and use it in GitHub Desktop.
Save franga2000/61c6bc2bd8836dc6158a10788b733422 to your computer and use it in GitHub Desktop.
/dts-v1/;
/plugin/;
/ {
compatible = "allwinner,sun8i-h3";
fragment@0 {
target = <&spi0>;
__overlay__ {
status = "okay";
spidev@0{
status = "disabled";
};
spidev@1{
status = "disabled";
};
};
};
fragment@1 {
target = <&pio>;
__overlay__ {
// Set up pins
ili9486_pins: ili9486_pins {
allwinner,pins = "PA2", "PC7"; // Add DC/RS nad RST pins here
allwinner,function = "gpio_in";
};
};
};
fragment@2 {
target = <&spi0>;
__overlay__ {
/* needed to avoid dtc warning */
#address-cells = <1>;
#size-cells = <0>;
ili9486: ili9486@0{
compatible = "ilitek,ili9486";
reg = <0>;
pinctrl-names = "default";
pinctrl-0 = <&ili9486_pins>;
spi-max-frequency = <16000000>;
txbuflen = <32768>;
rotate = <90>;
bgr = <0>;
fps = <30>;
buswidth = <8>;
regwidth = <16>;
// Select pins: 1st number = pos. of letter in the alphabet - 1
// 2nd number = pin number
// 3rd number = DON'T CHANGE! (1 = ACTIVE_LOW, 0 = ACTIVE_HIGH)
// Example: PA2 = <&pio 0 2 1>
// PC7 = <&pio 2 7 0>
reset-gpios = <&pio 0 2 1>; // RST pin
dc-gpios = <&pio 2 7 0>; // DC/RS pin
debug = <0>;
init = <0x10000b0 0x00
0x1000011
0x20000ff
0x100003a 0x55
0x1000036 0x28
0x10000c2 0x44
0x10000c5 0x00 0x00 0x00 0x00
0x10000e0 0x0f 0x1f 0x1c 0x0c 0x0f 0x08 0x48 0x98 0x37 0x0a 0x13 0x04 0x11 0x0d 0x00
0x10000e1 0x0f 0x32 0x2e 0x0b 0x0d 0x05 0x47 0x75 0x37 0x06 0x10 0x03 0x24 0x20 0x00
0x10000e2 0x0f 0x32 0x2e 0x0b 0x0d 0x05 0x47 0x75 0x37 0x06 0x10 0x03 0x24 0x20 0x00
0x1000036 0x28
0x1000011
0x1000029>;
};
};
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment