linux device driver - OLED on Zedboard -
i new zedboard. have zedboard running ubuntu image. trying write driver run oled on board. on board start-up oled on board shows display(xilinx logo), therefore assuming has driver. have following questions:
a) how oled in zedboard internally connected, through spi, gpios or pl. if it's through spi/gpios pins?
b) tutorial or documentation can follow create userspace drivers using spi/gpio oled in zedboard?
c) have redhat desktop, there sdk can use develop userspace drivers zedboard redhat desktop.
i have seen lot of materials on zedboard none of them talks how oled internally connected. in 1 document shows it's connected pl. if that's case how can write userspace drivers using pl on zedboard? coding using c.
appreciate , in advance!
a) how oled in zedboard internally connected, through spi, gpios or pl. if it's through spi/gpios pins?
first or second result web search "zedboard oled pdf" - http://zedboard.org/sites/default/files/zedboard_hw_ug_v1_1.pdf search "oled" in (page numbers of pdf file, not printed in document):
page3: 2.4.4 oled...... ... ...... 19
page4: 128x32 oled display
page5: zynq xc7z020-csg484 oled <- bus_of_5 -> 128x32 oled
page20: 2.4.4 oled inteltronic/wisechip ug-2832hsweg04 oled display used on zedboard. provides 128x32 pixel, passive-matrix, monochrome display. display size 30mm x11.5mm x 1.45mm. table 11 - oled connections ... interface
oled_pin symb epp_pin function 9 res# u9 power reset controller , driver 8 cs# n/c chip select – pulled down on board 10 d/c# u10 data/command control 11 sclk ab12 serial clock input signal 12 sdin aa12 serial data input signal
so, know model of oled ug-2832hsweg04
(datasheet http://www.adafruit.com/datasheets/ug-2832hsweg04.pdf low-level details on data interface) , data connection; oled 1 serial data input , 1 serial clock.
pinout pdf http://www.xilinx.com/support/documentation/user_guides/ug865-zynq-7000-pkg-pinout.pdf (too long read), there shorter version of pin list in txt format: http://www.xilinx.com/support/packagefiles/z7packages/xc7z020clg484pkg.txt
device/package xc7z020clg484 9/18/2012 10:07:35
pin pin name memory byte group bank vccaux group super logic region i/o type aa12 io_l7p_t1_13 1 13 na na hr ab12 io_l7n_t1_13 1 13 na na hr
hr means "3.3v-capable high-range (hr) banks", both data pins "bank 13". pin name io_* "supports both input, output functionality", , part of "pl pins" (pl = programmable logic = fpga). default zedboard firmware of fpga part gives access pin arm part of chip linux kernel (ps = processing system = arm) routing internal processing_system gpio pin via system.ucf file like:
net processing_system7_0_gpio_pin[5] loc = ab12 | iostandard="lvcmos25"; # "oled-sclk" net processing_system7_0_gpio_pin[6] loc = aa12 | iostandard="lvcmos25"; # "oled-sdin"
then gpio pins registered in devicetree (dts) https://github.com/digilent/linux-digilent/blob/master/arch/arm/boot/dts/digilent-zed.dts in zed_oled
group:
zed_oled { compatible = "dglnt,pmodoled-gpio"; /* gpio pins */ vbat-gpio = <&ps7_gpio_0 55 0>; vdd-gpio = <&ps7_gpio_0 56 0>; res-gpio = <&ps7_gpio_0 57 0>; dc-gpio = <&ps7_gpio_0 58 0>; /* spi-gpios */ spi-bus-num = <2>; spi-speed-hz = <4000000>; spi-sclk-gpio = <&ps7_gpio_0 59 0>; spi-sdin-gpio = <&ps7_gpio_0 60 0>; };
b) tutorial or documentation can follow create userspace drivers using spi/gpio oled in zedboard?
according avnet's getting started pdf, "demo 2 – oled display" scetion on page 17 (web searched "zedboard oled") http://zedboard.org/sites/default/files/documentations/gs-aes-z7ev-7z020-g-14.1-v6%5b1%5d.pdf#page=17 there kernel driver pmodoled-gpio.ko
(on screenshot reported "pmodoled-gpio-spi"), oled driven gpio pins.
there 2 helper scripts: unload_oled
remove kernel module , load_oled
insert kernel. driver create special device file /dev/zed_oled
work display user-space , load_oled
displays /root/logo.bin
file using zed_oled
interface.
typical usage of zed_oled
cat yourfile.bin > /dev/zed_oled
, example http://people.mech.kuleuven.be/~lin.zhang/notes/emebedded-linux/zedboard-oled-display.html , better http://zedboard.org/content/zedboard-oled
the .bin file format. ... screen written right left, top bottom each pixel being represented bit within 1 of bytes within .bin file. bits read-in top down 8 pixels move on 1 pixel , write next 8 bits , continue until @ end of row. move down 8 pixels , again 3 more times.
you can writes c application, check code http://www.cnblogs.com/popo0904/p/3853144.html (you can use online web translation services read text)
documentation on kernel module pmodoled
used in standard zedboard demo: https://github.com/digilent/linux-digilent/blob/master/documentation/pmods/pmodoled.txt
the driver provides 512 byte display buffer display of pmodoled. whole screen divided 4 lines, each of them 128 bits wide , 8 bits high, shown in figure below.
+--------------------------...----------------------------+ + line 4 + +--------------------------...----------------------------+ + line 3 + +--------------------------...----------------------------+ + line 2 + +--------------------------...----------------------------+ msb (bit 7) + line 1 + +--------------------------...----------------------------+ lsb (bit 0) byte 127 byte 0
users can perform read , write functions device node access data inside display buffer.
and there source code of dirver: https://github.com/digilent/linux-digilent/blob/06b388903e5459687ba2538ae3895ffe29e2e39e/drivers/pmods/pmodoled-gpio.c
c) have redhat desktop, there sdk can use develop userspace drivers zedboard redhat desktop.
the standard driver kernel-space oled on zedboard, can use precompiled zedboard firmware. or can build kernel according zedboard instructions, in-kernel drivers built (if enabled in kernel configuration): http://zedboard.org/content/creating-linux-kernel-image-boot-zc702-sd-card-slot
Comments
Post a Comment