]> zub.fei.tuke.sk Git - walkera0701-joystick/commitdiff
Separate doc, kernel diff stable1.0-rc1
authorPeter Popovec <popovec@zubok.(none)>
Fri, 17 Oct 2008 11:20:49 +0000 (13:20 +0200)
committerPeter Popovec <popovec@zubok.(none)>
Fri, 17 Oct 2008 11:20:49 +0000 (13:20 +0200)
Removed Walkera_Wk-0701_PCM.pdf due unknown license.

Kconfig.diff [new file with mode: 0644]
Makefile
Makefile.diff [new file with mode: 0644]
Walkera_Wk-0701_PCM.pdf [deleted file]
walkera0701.c
walkera0701.txt [new file with mode: 0644]

diff --git a/Kconfig.diff b/Kconfig.diff
new file mode 100644 (file)
index 0000000..d575714
--- /dev/null
@@ -0,0 +1,19 @@
+--- linux-2.6.27.1.orig/drivers/input/joystick/Kconfig 2008-10-16 01:02:53.000000000 +0200
++++ linux-2.6.27.1/drivers/input/joystick/Kconfig      2008-10-17 10:11:30.000000000 +0200
+@@ -294,4 +294,16 @@
+         This option enables support for the LED which surrounds the Big X on
+         XBox 360 controller.
++config JOYSTICK_WALKERA0701
++      tristate "Walkera WK-0701 RC transmitter"
++      depends on HIGH_RES_TIMERS && PARPORT
++      help
++        Say Y or M here if you have a Walkera WK-0701 transmitter which is
++        supplied with a ready to fly Walkera helicopters such as HM36,
++        HM37, HM60 and want to use it via parport as a joystick. More
++        information is available: <file:Documentation/input/walkera0701.txt>
++
++        To compile this driver as a module, choose M here: the
++        module will be called walkera0701.
++
+ endif
index e9ef28f517f0a240aabadd3ca7e366fd8073c8d6..aaf4f67d9b358d03b17b7c297b8dc2580da21053 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -28,3 +28,8 @@ rmmod:
 insmod:        walkera0701.ko
        insmod walkera0701.ko
        
+kernel-patch:
+       cp walkera0701.c /usr/src/linux-`uname -r`/drivers/input/joystick/
+       cp walkera0701.txt /usr/src/linux-`uname -r`/Documentation/input/
+       patch /usr/src/linux-`uname -r`/drivers/input/joystick/Kconfig Kconfig.diff
+       patch /usr/src/linux-`uname -r`/drivers/input/joystick/Makefile Makefile.diff
diff --git a/Makefile.diff b/Makefile.diff
new file mode 100644 (file)
index 0000000..b33aca8
--- /dev/null
@@ -0,0 +1,8 @@
+--- linux-2.6.27.1.orig/drivers/input/joystick/Makefile        2008-10-16 01:02:53.000000000 +0200
++++ linux-2.6.27.1/drivers/input/joystick/Makefile     2008-10-17 10:04:23.000000000 +0200
+@@ -29,4 +29,5 @@
+ obj-$(CONFIG_JOYSTICK_WARRIOR)                += warrior.o
+ obj-$(CONFIG_JOYSTICK_XPAD)           += xpad.o
+ obj-$(CONFIG_JOYSTICK_ZHENHUA)                += zhenhua.o
++obj-$(CONFIG_JOYSTICK_WALKERA0701)    += walkera0701.o
diff --git a/Walkera_Wk-0701_PCM.pdf b/Walkera_Wk-0701_PCM.pdf
deleted file mode 100755 (executable)
index ac94262..0000000
Binary files a/Walkera_Wk-0701_PCM.pdf and /dev/null differ
index 701436b6be8a56adc289e0fb2ed6ab48c71f0ccd..adb0d144957f051663a3a3d35eea8d02c452e1b6 100644 (file)
@@ -2,6 +2,8 @@
  *  Parallel port to Walkera WK-0701 TX joystick
  *
  *  Copyright (c) 2008 Peter Popovec
+ *
+ *  More about driver:  <file:Documentation/input/walkera0701.txt>
  */
 
 /*
  * the Free Software Foundation.
 */
 
-/*
-download: 
-cg-clone http://zub.fei.tuke.sk/GIT/walkera0701-joystick 
-http://zub.fei.tuke.sk/cgi-bin/gitweb.cgi?p=walkera0701-joystick
-
-Cable: (walkera TX to parport)
-
-Walkera WK-0701 TX S-VIDEO connector:
- (back side of TX) 
-     __   __              S-video:                                  canon25
-    /  |_|  \             pin 2 (signal)              NPN           parport
-   / O 4 3 O \            pin 3 (GND)        LED        ________________  10 ACK
-  ( O 2   1 O )                                         | C
-   \   ___   /      2 ________________________|\|_____|/
-    | [___] |                                 |/|   B |\ 
-     -------        3 __________________________________|________________ 25 GND
-                                                          E
-Frame format:
-Based on walkera WK-0701 PCM Format description by Shaul Eizikovich.
-(downloaded from http://www.smartpropoplus.com/Docs/Walkera_Wk-0701_PCM.pdf)
-
-Signal pulses:
-                   (ANALOG)
-    SYNC      BIN   OCT
-  +---------+      +------+   
-  |         |      |      |
---+         +------+      +---
-
-Frame: 
- SYNC , BIN1, OCT1, BIN2, OCT2 ... BIN24, OCT24, BIN25, next frame SYNC .. 
-
-pulse length:
-   Binary values:              Analog octal values:
-
-   288 uS Binary 0             318 uS       000
-   438 uS Binary 1             398 uS       001
-                               478 uS       010
-                               558 uS       011
-                               638 uS       100
-  1306 uS SYNC                 718 uS       101
-                               798 uS       110
-                               878 uS       111
-
-24 bin+oct values + 1 bin value = 24*4+1 bits  = 97 bits
-
-all times in code  in ns
-*/
 
 //#define WK0701_DEBUG
 //#define WK0701_FULL_DEBUG
diff --git a/walkera0701.txt b/walkera0701.txt
new file mode 100644 (file)
index 0000000..eede895
--- /dev/null
@@ -0,0 +1,109 @@
+
+Walkera WK-0701 transmitter is supplied with a ready to fly Walkera
+helicopters such as HM36, HM37, HM60. The walkera0701 module enables to use
+this transmitter as joystick
+
+Devel homepage and download:
+http://zub.fei.tuke.sk/walkera-wk0701/
+
+or use cogito:
+cg-clone http://zub.fei.tuke.sk/GIT/walkera0701-joystick 
+
+
+Connecting to PC:
+
+At back side of transmitter S-video connector can be found. Modulation
+pulses from processor to HF part can be found at pin 2 of this connector,
+pin 3 is GND. Between pin 3 and CPU 5k6 resistor can be found. To get
+modulation pulses to PC, signal pulses must be amplified. 
+
+Cable: (walkera TX to parport)
+
+Walkera WK-0701 TX S-VIDEO connector:
+ (back side of TX) 
+     __   __              S-video:                                  canon25
+    /  |_|  \             pin 2 (signal)              NPN           parport
+   / O 4 3 O \            pin 3 (GND)        LED        ________________  10 ACK
+  ( O 2   1 O )                                         | C
+   \   ___   /      2 ________________________|\|_____|/
+    | [___] |                                 |/|   B |\ 
+     -------        3 __________________________________|________________ 25 GND
+                                                          E
+
+
+I use green LED and BC109 NPN transistor. 
+
+Software:
+
+Build kernel with walkera0701 module. Module walkera0701 need exclusive
+access to parport, modules like lp must be unloaded before loading
+walkera0701 module, check dmesg for error messages. Connect TX to PC by
+cable and run jstest /dev/input/js0 to see values from TX. If no value can
+be changed by TX "joystick", check output from /proc/interrupts. Value for
+(usually irq7) parport must increase if TX is on.
+
+
+
+Technical details:
+
+Driver use interrupt from parport ACK input bit to measure pulse length
+using hrtimers.  
+Frame format:
+Based on walkera WK-0701 PCM Format description by Shaul Eizikovich.
+(downloaded from http://www.smartpropoplus.com/Docs/Walkera_Wk-0701_PCM.pdf)
+
+Signal pulses:
+                   (ANALOG)
+    SYNC      BIN   OCT
+  +---------+      +------+   
+  |         |      |      |
+--+         +------+      +---
+
+Frame: 
+ SYNC , BIN1, OCT1, BIN2, OCT2 ... BIN24, OCT24, BIN25, next frame SYNC .. 
+
+pulse length:
+   Binary values:              Analog octal values:
+
+   288 uS Binary 0             318 uS       000
+   438 uS Binary 1             398 uS       001
+                               478 uS       010
+                               558 uS       011
+                               638 uS       100
+  1306 uS SYNC                 718 uS       101
+                               798 uS       110
+                               878 uS       111
+
+24 bin+oct values + 1 bin value = 24*4+1 bits  = 97 bits
+
+(Warning, pulses on ACK ar inverted by transistor, irq is rised up on sync
+to bin change or octal value to bin change). 
+
+Binary data representations:
+
+One binary and octal value can be grouped to nibble. 24 nibbles + one binary
+values can be sampled between sync pulses. 
+
+Values for first four channels (analog joystick values) can be found in
+first 10 nibbles. Analog value is represented by one sign bit and 9 bit
+absolute binary value. (10 bits per channel). Next nibble is checksum for
+first ten nibbles.
+
+Next nibbles 12 .. 21 represents four channels (not all channels can be
+directly controlled from TX). Binary representations ar the same as in first
+four channels. In nibbles 22 and 23 is a special magic number. Nibble 24 is
+checksum for nibbles 12..23.
+
+After last octal value for nibble 24 and next sync pulse one additional
+binary value can be sampled. This bit and magic number is not used in
+software driver. Some details about this magic numbers can be found in
+Walkera_Wk-0701_PCM.pdf.
+
+Checksum calculation:
+
+Summary of octal values in nibbles must be same as octal value in checksum
+nibble (only first 3 bits are used). Binary value for checksum nibble is
+calculated by sum of binary values in checked nibbles + sum of octal values
+in checked nibbles divided by 8. Only bit 0 of this sum is used.
+