Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
BBORG_DISPLAY18-00A2.txt
/* Work in Progress */
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/pinctrl/am33xx.h>
#include <dt-bindings/board/am335x-bbw-bbb-base.h>
/dts-v1/;
/plugin/;
/ {
/*
* Free up the pins used by the cape from the pinmux helpers.
*/
fragment@0 {
target = <&ocp>;
__overlay__ {
P8_35_pinmux { status = "disabled"; }; /* LEDs - 1 */
P8_37_pinmux { status = "disabled"; }; /* LEDs - 2 */
P9_17_pinmux { status = "disabled"; }; /* LCD - CS */
P9_22_pinmux { status = "disabled"; }; /* LCD - SCLK */
P9_18_pinmux { status = "disabled"; }; /* LCD - MOSI? */
P9_21_pinmux { status = "disabled"; }; /* LCD - MISO? */
P8_33_pinmux { status = "disabled"; }; /* LCD - DC */
P8_31_pinmux { status = "disabled"; }; /* LCD - RST */
P8_29_pinmux { status = "disabled"; }; /* button - 1 */
P8_27_pinmux { status = "disabled"; }; /* button - 2 */
P8_30_pinmux { status = "disabled"; }; /* button - 3 */
P8_28_pinmux { status = "disabled"; }; /* button - 4 */
P9_12_pinmux { status = "disabled"; }; /* button - 5 */
P8_08_pinmux { status = "disabled"; }; /* button - 6 */
P8_07_pinmux { status = "disabled"; }; /* button - 7 */
P8_43_pinmux { status = "disabled"; }; /* button - 8 */
};
};
fragment@1 {
target = <&am33xx_pinmux>;
__overlay__ {
/* default state has all gpios released and mode set to SPI0 */
bb_spi0_pins: pinmux_bb_spi0_pins {
pinctrl-single,pins = <
0x150 0x30 /* spi0_sclk.spi0_sclk, INPUT_PULLUP | MODE0 */
0x154 0x30 /* spi0_d0.spi0_d0, INPUT_PULLUP | MODE0 */
0x158 0x10 /* spi0_d1.spi0_d1, OUTPUT_PULLUP | MODE0 */
0x15c 0x10 /* spi0_cs0.spi0_cs0, OUTPUT_PULLUP | MODE0 */
>;
};
};
};
fragment@2 {
target-path = "/";
__overlay__ {
bl_reg: backlight-regulator {
compatible = "regulator-fixed";
regulator-name = "backlight";
regulator-always-on;
regulator-boot-on;
};
/* backlight is set to GPIO */
backlight_gpio: backlight_gpio {
compatible = "gpio-backlight";
gpios = <&gpio2 5 GPIO_ACTIVE_HIGH>;
// connect lcd lite pin to P8.9 which is gpio2[5]
};
};
};
fragment@3 {
target = <&spi0>;
__overlay__ {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&bb_spi0_pins>;
display@0{
status = "okay";
compatible = "jianda,jd-t18003-t01", "sitronix,st7735r";
reg = <0>;
spi-max-frequency = <16000000>;
dc-gpios = <&gpio0 9 0>; // lcd dc P8.33 gpio0[9]
reset-gpios = <&gpio0 10 0>; // lcd reset P8.31 gpio0[10]
backlight = <&backlight_gpio>; // lcd lite P8.9 gpio2[69]
// rotation is optional
// rotation = <270>;
};
};
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment