一:下載RoboPeak Mini USB Display驅動代碼php
1:點擊查看源碼node
在/driver/video目錄下新建目錄robopeaklinux
將下載驅動源碼放到 /drivers/video/robopeak下git
可是會有一些小的問題:好比頭文件的位置不對,以及缺乏一些頭文件等等。github
2:這裏提供改動之後的驅動代碼dom
將下載驅動源碼放到 drivers/video下並解壓。ide
$ tar -jxvf robopeak.tar.bz2
二:如何將此添加到內核配置及編譯:spa
1:在drivers/video/Kconfig添加 source "drivers/video/robopeak/Kconfig"code
$(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
一:在以上配置的前提下作如下配置:
$ 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