温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

WRTnode如何添加显示支持

发布时间:2021-12-20 13:47:11 来源:亿速云 阅读:314 作者:小新 栏目:互联网科技

这篇文章主要介绍WRTnode如何添加显示支持,文中介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们一定要看完!

RoboPeak Mini USB Display 作为一个输出设备

一:下载RoboPeak Mini USB Display驱动代码

1:查看源码

在/driver/video目录下新建目录robopeak

将下载驱动源码放到 /drivers/video/robopeak下

但是会有一些小的问题:比如头文件的位置不对,以及缺少一些头文件等等。

2:这里提供改动以后的驱动代码

将下载驱动源码放到 drivers/video下并解压。

$ tar -jxvf robopeak.tar.bz2

二:如何将此添加到内核配置及编译:

1:在drivers/video/Kconfig添加 source "drivers/video/robopeak/Kconfig"

$(PATH)是driver所在的路径。

vi $(PATH)/drivers/video/Kconfig
comment "Frame buffer hardware drivers"     source "drivers/video/robopeak/Kconfig"     depends on FB

2:在drivers/video/Makefile添加 obj-$(CONFIG_FB_RPUSBDISP) += robopeak/

vi $(PATH)/driver/video/Makefile
obj-$(CONFIG_FB)  += fb.o obj-$(CONFIG_FB_RPUSBDISP)   += robopeak/

三:配置

$make kernel_menuconfig
Device Drivers: USB Support:   <*> Support for Host-side USB Graphics support:   <*> Support for frame buffer devices:   <*> Enable firmware EDID   <*> Framebuffer foreign endianness support   <*> Enable Video Mode Handling Helpers   <*> Enable Tile Blitting Support   <*> Robopeak USB Display     <*> Displaylink USB Framebuffer support   [*]Bootup logo:      <*> Standard 224-color Linux logo Character devices:   <*> Virtual terminal   <*> Enable character translations in console   <*> Support for console on virtual terminal   <*> Support for binding and unbinding console drivers Graphics support:    Console display driver support:      <*> Framebuffer Console support      <*> Map the console to the primary display device      <*> Framebuffer Console Rotation      <*> Select compiled-in fonts      <*> VGA 8x16 font

四:编译

$ make V=s -j

五:烧写固件并操作

1:一旦驱动程序识别的显示器,帧缓冲设备将被创建。(如为/dev/fb0设备)

#cat /proc/fb   0 #ls /dev/fb0 #cat /dev/urandom > /dev/fb0

您应该看到的显示画面充满了随机的色点。

展示一幅图片到屏幕上:

下载picture.bmp 并将它放到/tmp目录下。

#cat /tmp/picture.bmp > /dev/fb0

picture.bmp 要求是bmp格式,分辨率320*240,16位图。

显示一张图片在屏上。

WRTnode如何添加显示支持

清空屏幕:

#dd if=/dev/zero of=/dev/fb0

将fb0中的内容保存下来

Save the contents of the fb0

重新写回屏幕

#dd if=/dev/fb0 of=fbfile

Write back in the screen

#dd if=fbfile of=/dev/fb0

2:输入字符到RoboPeak Mini USB Display上显示

让我们来检查是否已经创建了帧缓冲的虚拟控制台:

# ls /sys/class/vtconsole/vtcon* /sys/class/vtconsole/vtcon0: bind       name       subsystem  uevent /sys/class/vtconsole/vtcon1: bind       name       subsystem  uevent

控制台已经创建。让我们来检查它是否属于在帧缓冲器:

# cat /sys/class/vtconsole/vtcon1/name (M) frame buffer device # cat /sys/class/vtconsole/vtcon1/bind 1 #echo hellowrtnode > /dev/vcs1

RoboPeak Mini USB Display 作为输入设备

一:在以上配置的前提下做以下配置:

$ make menuconfig
Base system:  <*> busybox: Linux System Utilities:  <*> lsusb Kernel modules: USB Support:  <*> kmod-usb-hid

二:编译

$make V=s -j

三:烧写固件并操作:

在/dev目录中有新设备创建:

#ls /dev/input/ -l crw-r--r--    1 root     root       13,  64 Sep 17 18:44 event0
#cat /proc/bus/input/devices I: Bus=0003 Vendor=0000 Product=0000 Version=0000 N: Name="RoboPeakUSBDisplayTS" P: Phys= S: Sysfs=/devices/virtual/input/input0 U: Uniq= H: Handlers=event0 B: PROP=0  B: EV=b B: KEY=400 0 0 0 0 0 0 0 0 0 0 B: ABS=1000003
#cat /dev/input/event0 |hexdump

Touch RoboPeak Mini USB Display, printed on the wrtnode

WRTnode如何添加显示支持

以上是“WRTnode如何添加显示支持”这篇文章的所有内容,感谢各位的阅读!希望分享的内容对大家有帮助,更多相关知识,欢迎关注亿速云行业资讯频道!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI