&spi1 {
clock-frequency = <100000000>;
pinctrl-0 = <&spi1_pins_a &spi1_pins_b>;
pinctrl-1 = <&spi1_pins_c>;
pinctrl-names = "default", "sleep";
spi_slave_mode = <0>;
spi1_cs_number = <1>;
spi1_cs_bitmap = <1>;
spi_dbi_enable = <0>;
status = "okay";
spi_board1@0 {
device_type = "spi_board1";
compatible = "rohm,dh2228fv";
spi-max-frequency = <0x5f5e100>;
reg = <0x0>;
spi-rx-bus-width = <0x4>;
spi-tx-bus-width = <0x4>;
status = "disabled";
};
st7789v@0 {
status = "okay";
compatible = "sitronix,st7789v";
reg = <0>;
spi-max-frequency = <60000000>;
rotate = <0>;
bgr;
fps = <60>;
buswidth = <8>;
reset = <&pio PD 15 GPIO_ACTIVE_LOW>;
dc = <&pio PD 14 GPIO_ACTIVE_LOW>;
latch = <&pio PD 16 GPIO_ACTIVE_HIGH>;
debug = <1>;
};
};离线
我是这样写的,没毛病:
&spi1 {
clock-frequency = <15000000>;
pinctrl-0 = <&spi1_pins_a>;
pinctrl-names = "default", "sleep";
spi_slave_mode = <0>;
cs-gpios = <&pio 3 10 GPIO_ACTIVE_LOW>; // 可选:指定 CS 脚,如 PD10
status = "okay";
bias-pull-up;
display@0{
compatible = "sitronix,st7789v";
reg = <0>;
status = "okay";
spi-max-frequency = <15000000>;//96000000
spi-cpol;
spi-cpha;
rotate = <180>;
// width = <320>;
// height = <240>;
fps = <10>;
buswidth = <8>;
dc-gpios = <&pio 3 14 GPIO_ACTIVE_HIGH>; // Pd14 dc
reset-gpios = <&pio 3 15 GPIO_ACTIVE_HIGH>; // Pd15
//led-gpios = <&pio 0 0 GPIO_ACTIVE_LOW>; // PA0
debug = <0x0>;
};
}; 将SPI频率和帧率调低点
离线
然后staging driver 开启7789的驱动。
离线