IMX6ULL开发板spi OLED驱动

视频地址:
https://www.bilibili.com/video/BV1Yb4y1t7Uj?p=144&spm_id_from=pageDriver&vd_source=1d93d6a5e22d4b223c6c3ac4f5727eb8

视频选集:P141 - P150

1、将文件上传到虚拟机共享目录
file

2、make编译出驱动
file

3、修改设备树

vim 100ask_imx6ull-14x14.dts
file

&ecspi1 {
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_ecspi1>;
		
    fsl,spi-num-chipselects = <2>;
    cs-gpios = <&gpio4 26 GPIO_ACTIVE_LOW>, <&gpio4 24 GPIO_ACTIVE_LOW>;
    status = "okay";

    oled: oled {
        compatible = "100ask,oled";
        reg = <0>;
        spi-max-frequency = <1000000>;
        dc-gpios = <&gpio4 20 GPIO_ACTIVE_HIGH>;
    };

编译设备树:
file
注意:必须退回到linux内核目录里编译

将设备树文件放到共享目录:

cp arch/arm/boot/dts/100ask_imx6ull-14x14.dts /home/book/nfs_rootfs/

4、替换设备树

进入开发板,将设备树拷贝到/boot之后重启

mount -t nfs -o nolock,vers=3 192.168.5.11:/home/book/nfs_rootfs /mnt
file

5、验证设备树

进入设备树查找oled

cd /sys/firmware/devicetree/base

find -name "*oled*"
file

进入oled目录查看:

cd ./soc/aips-bus@02000000/spba-bus@02000000/ecspi@02008000/oled
file

6、安装驱动

·insmod oled_drv.ko·
file

7、执行oled_test验证

./oled_test /dev/myoled
file
file

本文由博客一文多发平台 OpenWrite 发布!

  • 5
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值