Appendix-iii, Instruction to gpio and push button driver – Sensoray 2411 User Manual
Page 11

Appendix-III:
Instruction to GPIO and Push Button Driver
(for Sensoray 2411/311/611 only)
1) with any ftp utility like FileZilla, load the distributed driver "swbt311drv.o" (for
311 GPIO and Push-Button) down to the following directory in the 2411 target system:
/lib/modules/2.4.10-S301/kernel/drivers/sensoray/.
2) run following to make node for 311 GPIO and Push-Button:
"cd /dev", "mknod swbt311drv0 c 126 0", "mknod swbt311drv1 c 126 1",
"ln –s /dev/swbt311drv0 /dev/swbt311drv"
3) run "depmod -a" to update dependency of the modules.
4) "reboot" system.
5) login. ("root", return; password, return)
6) run "modprobe bttv card=73 pll=1" to load the "bttv" driver; and
run "modprobe swbt311drv" to load the "swbt311drv" driver.
7) now, you are ready to run your own frame capturing application or demo application
distributed with 2411. For example, "cd /usr/user/demo2411" and "./lpcabbmp_cf" to run
"lpcabbmp_cf" demo program described in V; "cd /usr/user/demo2411" and "./btgjpg" to run
" btgjpg" demo program described in V.
8) as a summary, the pin definition of 311 JP1 for 311 GPIO is given blow:
pin-1
GPI0
pin-2
LVDD
pin-3
GPINT
pin-4
GPO3
pin-5
GND
pin-6
GND
pin-7
+12V
pin-8
+5V
pin-9
GPO2
pin-10 GPI3
pin-11 GPI2
pin-12 GPI1
pin-13 GPO0
pin-14 GPO1
There are 4 general inputs (GPI0, GPI1, GPI2 and GPI3), and 4 general outputs (GPO0,
GPO1, GPO2 and GPO3). Except GPI0 is optocoupled, all other GPIOs are as digital
Inputs/Outputs with TTL signal level. Refer to ”311 Instruction Manual” for more detailed
information on GPIO signals of 311 and circuitry connection.
In the demo application "lpcabbmp_cf" and " btgjpg", the GPI0 is used to connect a push-
button that will be used to take trigger for starting frame capturing. As the GPI0 is
optocoupled, the JP1-pin-1 and JP1-pin-5 of 311 are connected to the two ends (terminals)
of a switch push-button, respectively; and JP1-pin-2 and JP1-pin-8 are connected together
to provide +5V power for optocoupler.
9) In the "swbt311drv" driver, two API functions are provided:
ioctl( fd_bt, ReadRegDrv, &request ) is used for GPIO read. The parameter
"request.param1" contains the data read-in from the GPIO of 311. The GPI3&GPI2&GPI1&GPI0
are aligned up on bit3&bit2&bit1&bit0 of "request.param1". And, the status of
GPO3&GPO2&GPO1&GPO0 are aligned up on bit7&bit6&bit5&bit4 of "request.param1".
ioctl( fd_bt, WriteRegDrv, &request ) is used for GPIO write. The parameter
"request.param1" contains the data that will be writen out to GPIO. The
GPO3&GPO2&GPO1&GPO0 are aligned up on bit7&bit6&bit5&bit4 of "request.param1".