[ 1.108265] fb_st7735r spi0.0: fbtft_property_value: buswidth = 8
[ 1.114547] fb_st7735r spi0.0: fbtft_property_value: debug = 0
[ 1.120435] fb_st7735r spi0.0: fbtft_property_value: rotate = 90
[ 1.126555] fb_st7735r spi0.0: fbtft_property_value: fps = 60
[ 2.188617] Console: switching to colour frame buffer device 10x20
[ 2.197506] graphics fb0: fb_st7735r frame buffer, 80x160, 25 KiB video memory, 4 KiB buffer memory, fps=100, spi0.0 at 36 MHz
dev下面都有fb了纳闷了
&spi0 {
status = "okay";
st7735r@0{
compatible = "sitronix,st7735r";
reg = <0>;
status = "okay";
spi-max-frequency = <36000000>;
spi-cpol;
spi-cpha;
rotate = <90>;
fps = <60>;
buswidth = <8>;
dc-gpios = <&pio 3 16 GPIO_ACTIVE_HIGH>;
reset-gpios = <&pio 3 17 GPIO_ACTIVE_HIGH>;
led-gpios = <&pio 3 15 GPIO_ACTIVE_LOW>;
debug = <0x0>;
};
};
按照网上把申请io的地方换了
是不是我还有哪里有没设置
离线
SPI LCD 数据是单向的, soc根本不知道你的lcd是否存在,所以还是要确认lcd有没有坏,时序对不对?
屏幕应该是好的,时序确实了,家里没法看,我还是直接自己写一个看看
离线
又搞了一上午准备放弃自己写了的,最后检查了设备树结果发现spi引脚添加错了
大概操作流程就是先按照这个里面 https://www.bilibili.com/read/cv9947785 把引脚申请改了我用的是5.7.1
然后去fb_st7735r.c里面修改
static void set_addr_win(struct fbtft_par *par, int xs, int ys, int xe, int ye)
{
write_reg(par, MIPI_DCS_SET_COLUMN_ADDRESS,
//(xs+24) >> 8, (xs+24) & 0xFF, (xe+24) >> 8, (xe+24) & 0xFF);
xs >> 8, (xs+1) & 0xFF, xe >> 8, (xe+1) & 0xFF);
write_reg(par, MIPI_DCS_SET_PAGE_ADDRESS,
(ys+25) >> 8, (ys+26) & 0xFF, (ye+25) >> 8, (ye+26) & 0xFF);
//ys >> 8, ys & 0xFF, ye >> 8, ye & 0xFF);
write_reg(par, MIPI_DCS_WRITE_MEMORY_START);
}
static struct fbtft_display display = {
.regwidth = 8,
.width = 80,
.height = 160,
.init_sequence = default_init_sequence,
.gamma_num = 2,
.gamma_len = 16,
.gamma = DEFAULT_GAMMA,
.fbtftops = {
.set_addr_win = set_addr_win,
.set_var = set_var,
.set_gamma = set_gamma,
},
};
下面是设备树里面
&spi0 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&spi0_pd_pins>;
st7735r@0{
compatible = "sitronix,st7735r";
reg = <0>;
status = "okay";
spi-max-frequency = <36000000>;
spi-cpol;
spi-cpha;
rotate = <90>;
fps = <60>;
buswidth = <8>;
dc-gpios = <&pio 3 16 GPIO_ACTIVE_HIGH>;
reset-gpios = <&pio 3 17 GPIO_ACTIVE_HIGH>;
led-gpios = <&pio 3 15 GPIO_ACTIVE_LOW>;
debug = <0x0>;
};
};
然后修改bootargs 里面添加console=tty0
离线