V831没有RGB也没有MIPI,正好手上有几片i80 MCU屏幕可以用(320*480 3.5寸的,15块钱一片)

电路部分

屏幕部分:

image-20220424224457327

主控部分:

image-20220424224256792

image-20220424224331134

没啥好说的,照着Sipeed的抄就行了

配置设备树

lcd0: lcd0@01c0c000 {
	lcd_used            = <1>;

	lcd_driver_name     = "ili9481";

	lcd_x               = <320>;
	lcd_y               = <480>;
	lcd_width           = <108>;
	lcd_height          = <64>;
	lcd_dclk_freq       = <5>;

	lcd_pwm_used        = <0>;

	lcd_hbp             = <20>;
	lcd_ht              = <382>;
	lcd_hspw            = <2>;
	lcd_vbp             = <2>; // 320
	lcd_vt              = <486>; // 320
	lcd_vspw            = <2>;

	lcd_if              = <1>;
	lcd_frm             = <2>;
	lcd_cpu_mode        = <1>;
	lcd_cpu_te          = <0>;
	lcd_cpu_if	        = <14>;

	lcd_io_phase        = <0x0000>;
	lcdgamma4iep        = <22>;
	lcd_gamma_en        = <0>;
	lcd_cmap_en         = <0>;
	lcd_bright_curve_en = <0>;
	lcd_rb_swap         = <0>;

	lcd_gpio_0 = <&pio PH 5 1 0 3 0>; /* rst */
	lcd_gpio_1 = <&pio PD 21 1 0 3 0>; /* cs */
	lcd_bl_en = <&pio PH 6 1 0 3 1>;

	pinctrl-0 = <&rgb8_pins_a>;
	pinctrl-1 = <&rgb8_pins_b>;
};

因为这里用的是Kernel刷屏,所以就不配uboot的了

驱动

然后找大佬鼠嫖驱动,放到 lichee/linux-4.9/drivers/video/fbdev/sunxi/disp2/disp/lcd/文件夹下。

编辑 lichee/linux-4.9/drivers/video/fbdev/sunxi/disp2/disp/lcd/panels.c,找一个顺眼的地方加一下配置。

#ifdef CONFIG_LCD_SUPPORT_ILI9481
	&ili9481_panel,
#endif

编辑lichee/linux-4.9/drivers/video/fbdev/sunxi/disp2/disp/lcd/panels.h,找一个顺眼的地方加一下配置。

#ifdef CONFIG_LCD_SUPPORT_ILI9481
extern struct __lcd_panel ili9481_panel;
#endif

编辑lichee/linux-4.9/drivers/video/fbdev/sunxi/disp2/disp/lcd/Kconfig,找一个顺眼的地方加一下配置。

config LCD_SUPPORT_ILI9481
	bool "LCD support ili9481 panel"
	default n
	---help---
		If you want to support ili9481 panel for display driver, select it.

编辑 lichee/linux-4.9/drivers/video/fbdev/sunxi/disp2/disp/Makefile,找一个顺眼的地方加一下配置。

disp-$(CONFIG_LCD_SUPPORT_ILI9481) += lcd/ili9481.o

再打开 m kernel_menuconfig

Device Drivers  --->
	Graphics support  ---> 
		Frame buffer Devices  --->
			Video support for sunxi  --->
				LCD panels select  --->
					 [*] LCD support ili9481 panel        

image-20220424225342606

保存,编译kernel打包就好了。

启动系统

刷卡,启动系统,可以看到屏幕背光已经亮了。

image-20220424225747265

测试一下

echo 1 > sys/class/disp/disp/attr/colorbar

aseed

驱动和配置已经上传Github,自取