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位图。
显示一张图片在屏上。
清空屏幕:
#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