本帖最后由 592924270 于 2024-7-31 08:30 编辑
分享6ull下的TFT2.4寸小屏显示的相关驱动及设置,屏幕启动ILI9341,触摸驱动XPT2046, 显示驱动和触摸驱动使用同一个SPI口,还外接一个AHT21温湿度传感器 QT界面显示温湿度以及RTC时间,一个按钮控制板子上的红色指示灯
1、dts的相关设置 &ecspi1{ fsl,spi-num-chipselects= <2>; cs-gpios= <&gpio4 26 0 &gpio423 0>; pinctrl-names = "default"; pinctrl-0 =<&pinctrl_ecspi1>; status = "okay"; ili9341@0{ compatible = "ilitek,ili9341"; reg = <0>; dc-gpios = <&gpio4 22 GPIO_ACTIVE_HIGH>; reset-gpios = <&gpio4 21 GPIO_ACTIVE_HIGH>; spi-max-frequency = <32000000>; rotation = <270>; bgr; fps= <30>; buswidth= <8>; debug= <0>; }; xpt2046@1{ compatible = "ti,tsc2046"; reg = <1>; pinctrl-0= <&pinctrl_tsc>; interrupt-parent= <&gpio1>; interrupts= <9 0>; interrupt-gpios= <&gpio1 9 GPIO_ACTIVE_LOW>; spi-max-frequency= <1000000>; pendown-gpio= <&gpio1 9 0>; vcc-supply= <®_can_3v3>; ti,x-min= /bits/ 16 <0>; ti,x-max= /bits/ 16 <240>; ti,y-min= /bits/ 16 <0>; ti,y-max= /bits/ 16 <320>; //ti,x-plate-ohms= /bits/ 16 <0>; //ti,pressure-max= /bits/ 16 <255>; linux,wakeup; }; };
pinctrl_ecspi1:ecspi1 fsl,pins = < MX6UL_PAD_CSI_DATA04__ECSPI1_SCLK 0x000010B1 MX6UL_PAD_CSI_DATA05__GPIO4_IO26 0x000010B0 MX6UL_PAD_CSI_DATA02__GPIO4_IO23 0x000010B0 MX6UL_PAD_CSI_DATA06__ECSPI1_MOSI 0x000010B1 MX6UL_PAD_CSI_DATA07__ECSPI1_MISO 0x000010B1 >; };
比如CSI也使用了上面的引脚需要屏蔽掉,还有gpio的一些重复引脚需要屏蔽,这里不在贴出来,
具体信息看附件
|