xref: /openbmc/linux/Documentation/input/devices/amijoy.rst (revision a976c2951d8f376112361830aa7762beff83a205)
1*b08c118cSDmitry Torokhov~~~~~~~~~~~~~~~~~~~~~~~~~
2*b08c118cSDmitry TorokhovAmiga joystick extensions
3*b08c118cSDmitry Torokhov~~~~~~~~~~~~~~~~~~~~~~~~~
4*b08c118cSDmitry Torokhov
5*b08c118cSDmitry Torokhov
6*b08c118cSDmitry TorokhovAmiga 4-joystick parport extension
7*b08c118cSDmitry Torokhov~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8*b08c118cSDmitry Torokhov
9*b08c118cSDmitry TorokhovParallel port pins:
10*b08c118cSDmitry Torokhov
11*b08c118cSDmitry Torokhov
12*b08c118cSDmitry Torokhov=====  ======== ====   ==========
13*b08c118cSDmitry TorokhovPin    Meaning  Pin    Meaning
14*b08c118cSDmitry Torokhov=====  ======== ====   ==========
15*b08c118cSDmitry Torokhov 2     Up1	 6     Up2
16*b08c118cSDmitry Torokhov 3     Down1	 7     Down2
17*b08c118cSDmitry Torokhov 4     Left1	 8     Left2
18*b08c118cSDmitry Torokhov 5     Right1	 9     Right2
19*b08c118cSDmitry Torokhov13     Fire1	11     Fire2
20*b08c118cSDmitry Torokhov18     Gnd1	18     Gnd2
21*b08c118cSDmitry Torokhov=====  ======== ====   ==========
22*b08c118cSDmitry Torokhov
23*b08c118cSDmitry TorokhovAmiga digital joystick pinout
24*b08c118cSDmitry Torokhov~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
25*b08c118cSDmitry Torokhov
26*b08c118cSDmitry Torokhov=== ============
27*b08c118cSDmitry TorokhovPin Meaning
28*b08c118cSDmitry Torokhov=== ============
29*b08c118cSDmitry Torokhov1   Up
30*b08c118cSDmitry Torokhov2   Down
31*b08c118cSDmitry Torokhov3   Left
32*b08c118cSDmitry Torokhov4   Right
33*b08c118cSDmitry Torokhov5   n/c
34*b08c118cSDmitry Torokhov6   Fire button
35*b08c118cSDmitry Torokhov7   +5V (50mA)
36*b08c118cSDmitry Torokhov8   Gnd
37*b08c118cSDmitry Torokhov9   Thumb button
38*b08c118cSDmitry Torokhov=== ============
39*b08c118cSDmitry Torokhov
40*b08c118cSDmitry TorokhovAmiga mouse pinout
41*b08c118cSDmitry Torokhov~~~~~~~~~~~~~~~~~~
42*b08c118cSDmitry Torokhov
43*b08c118cSDmitry Torokhov=== ============
44*b08c118cSDmitry TorokhovPin Meaning
45*b08c118cSDmitry Torokhov=== ============
46*b08c118cSDmitry Torokhov1   V-pulse
47*b08c118cSDmitry Torokhov2   H-pulse
48*b08c118cSDmitry Torokhov3   VQ-pulse
49*b08c118cSDmitry Torokhov4   HQ-pulse
50*b08c118cSDmitry Torokhov5   Middle button
51*b08c118cSDmitry Torokhov6   Left button
52*b08c118cSDmitry Torokhov7   +5V (50mA)
53*b08c118cSDmitry Torokhov8   Gnd
54*b08c118cSDmitry Torokhov9   Right button
55*b08c118cSDmitry Torokhov=== ============
56*b08c118cSDmitry Torokhov
57*b08c118cSDmitry TorokhovAmiga analog joystick pinout
58*b08c118cSDmitry Torokhov~~~~~~~~~~~~~~~~~~~~~~~~~~~~
59*b08c118cSDmitry Torokhov
60*b08c118cSDmitry Torokhov=== ==============
61*b08c118cSDmitry TorokhovPin Meaning
62*b08c118cSDmitry Torokhov=== ==============
63*b08c118cSDmitry Torokhov1   Top button
64*b08c118cSDmitry Torokhov2   Top2 button
65*b08c118cSDmitry Torokhov3   Trigger button
66*b08c118cSDmitry Torokhov4   Thumb button
67*b08c118cSDmitry Torokhov5   Analog X
68*b08c118cSDmitry Torokhov6   n/c
69*b08c118cSDmitry Torokhov7   +5V (50mA)
70*b08c118cSDmitry Torokhov8   Gnd
71*b08c118cSDmitry Torokhov9   Analog Y
72*b08c118cSDmitry Torokhov=== ==============
73*b08c118cSDmitry Torokhov
74*b08c118cSDmitry TorokhovAmiga lightpen pinout
75*b08c118cSDmitry Torokhov~~~~~~~~~~~~~~~~~~~~~
76*b08c118cSDmitry Torokhov
77*b08c118cSDmitry Torokhov=== =============
78*b08c118cSDmitry TorokhovPin Meaning
79*b08c118cSDmitry Torokhov=== =============
80*b08c118cSDmitry Torokhov1   n/c
81*b08c118cSDmitry Torokhov2   n/c
82*b08c118cSDmitry Torokhov3   n/c
83*b08c118cSDmitry Torokhov4   n/c
84*b08c118cSDmitry Torokhov5   Touch button
85*b08c118cSDmitry Torokhov6   /Beamtrigger
86*b08c118cSDmitry Torokhov7   +5V (50mA)
87*b08c118cSDmitry Torokhov8   Gnd
88*b08c118cSDmitry Torokhov9   Stylus button
89*b08c118cSDmitry Torokhov=== =============
90*b08c118cSDmitry Torokhov
91*b08c118cSDmitry Torokhov-------------------------------------------------------------------------------
92*b08c118cSDmitry Torokhov
93*b08c118cSDmitry Torokhov======== === ==== ==== ====== ========================================
94*b08c118cSDmitry TorokhovNAME     rev ADDR type chip   Description
95*b08c118cSDmitry Torokhov======== === ==== ==== ====== ========================================
96*b08c118cSDmitry TorokhovJOY0DAT      00A   R   Denise Joystick-mouse 0 data (left vert, horiz)
97*b08c118cSDmitry TorokhovJOY1DAT      00C   R   Denise Joystick-mouse 1 data (right vert,horiz)
98*b08c118cSDmitry Torokhov======== === ==== ==== ====== ========================================
99*b08c118cSDmitry Torokhov
100*b08c118cSDmitry Torokhov        These addresses each read a 16 bit register. These in turn
101*b08c118cSDmitry Torokhov        are loaded from the MDAT serial stream and are clocked in on
102*b08c118cSDmitry Torokhov        the rising edge of SCLK. MLD output is used to parallel load
103*b08c118cSDmitry Torokhov        the external parallel-to-serial converter.This in turn is
104*b08c118cSDmitry Torokhov        loaded with the 4 quadrature inputs from each of two game
105*b08c118cSDmitry Torokhov        controller ports (8 total) plus 8 miscellaneous control bits
106*b08c118cSDmitry Torokhov        which are new for LISA and can be read in upper 8 bits of
107*b08c118cSDmitry Torokhov        LISAID.
108*b08c118cSDmitry Torokhov
109*b08c118cSDmitry Torokhov        Register bits are as follows:
110*b08c118cSDmitry Torokhov
111*b08c118cSDmitry Torokhov        - Mouse counter usage (pins  1,3 =Yclock, pins 2,4 =Xclock)
112*b08c118cSDmitry Torokhov
113*b08c118cSDmitry Torokhov======== === === === === === === === === ====== === === === === === === ===
114*b08c118cSDmitry Torokhov    BIT#  15  14  13  12  11  10  09  08     07  06  05  04  03  02  01  00
115*b08c118cSDmitry Torokhov======== === === === === === === === === ====== === === === === === === ===
116*b08c118cSDmitry TorokhovJOY0DAT   Y7  Y6  Y5  Y4  Y3  Y2  Y1  Y0     X7  X6  X5  X4  X3  X2  X1  X0
117*b08c118cSDmitry TorokhovJOY1DAT   Y7  Y6  Y5  Y4  Y3  Y2  Y1  Y0     X7  X6  X5  X4  X3  X2  X1  X0
118*b08c118cSDmitry Torokhov======== === === === === === === === === ====== === === === === === === ===
119*b08c118cSDmitry Torokhov
120*b08c118cSDmitry Torokhov        0=LEFT CONTROLLER PAIR, 1=RIGHT CONTROLLER PAIR.
121*b08c118cSDmitry Torokhov        (4 counters total). The bit usage for both left and right
122*b08c118cSDmitry Torokhov        addresses is shown below. Each 6 bit counter (Y7-Y2,X7-X2) is
123*b08c118cSDmitry Torokhov        clocked by 2 of the signals input from the mouse serial
124*b08c118cSDmitry Torokhov        stream. Starting with first bit received:
125*b08c118cSDmitry Torokhov
126*b08c118cSDmitry Torokhov         +-------------------+-----------------------------------------+
127*b08c118cSDmitry Torokhov         | Serial | Bit Name | Description                             |
128*b08c118cSDmitry Torokhov         +========+==========+=========================================+
129*b08c118cSDmitry Torokhov         |   0    | M0H      | JOY0DAT Horizontal Clock                |
130*b08c118cSDmitry Torokhov         +--------+----------+-----------------------------------------+
131*b08c118cSDmitry Torokhov         |   1    | M0HQ     | JOY0DAT Horizontal Clock (quadrature)   |
132*b08c118cSDmitry Torokhov         +--------+----------+-----------------------------------------+
133*b08c118cSDmitry Torokhov         |   2    | M0V      | JOY0DAT Vertical Clock                  |
134*b08c118cSDmitry Torokhov         +--------+----------+-----------------------------------------+
135*b08c118cSDmitry Torokhov         |   3    | M0VQ     | JOY0DAT Vertical Clock  (quadrature)    |
136*b08c118cSDmitry Torokhov         +--------+----------+-----------------------------------------+
137*b08c118cSDmitry Torokhov         |   4    | M1V      | JOY1DAT Horizontal Clock                |
138*b08c118cSDmitry Torokhov         +--------+----------+-----------------------------------------+
139*b08c118cSDmitry Torokhov         |   5    | M1VQ     | JOY1DAT Horizontal Clock (quadrature)   |
140*b08c118cSDmitry Torokhov         +--------+----------+-----------------------------------------+
141*b08c118cSDmitry Torokhov         |   6    | M1V      | JOY1DAT Vertical Clock                  |
142*b08c118cSDmitry Torokhov         +--------+----------+-----------------------------------------+
143*b08c118cSDmitry Torokhov         |   7    | M1VQ     | JOY1DAT Vertical Clock (quadrature)     |
144*b08c118cSDmitry Torokhov         +--------+----------+-----------------------------------------+
145*b08c118cSDmitry Torokhov
146*b08c118cSDmitry Torokhov         Bits 1 and 0 of each counter (Y1-Y0,X1-X0) may be
147*b08c118cSDmitry Torokhov         read to determine the state of the related input signal pair.
148*b08c118cSDmitry Torokhov         This allows these pins to double as joystick switch inputs.
149*b08c118cSDmitry Torokhov         Joystick switch closures can be deciphered as follows:
150*b08c118cSDmitry Torokhov
151*b08c118cSDmitry Torokhov         +------------+------+---------------------------------+
152*b08c118cSDmitry Torokhov         | Directions | Pin# | Counter bits                    |
153*b08c118cSDmitry Torokhov         +============+======+=================================+
154*b08c118cSDmitry Torokhov         | Forward    |  1   | Y1 xor Y0 (BIT#09 xor BIT#08)   |
155*b08c118cSDmitry Torokhov         +------------+------+---------------------------------+
156*b08c118cSDmitry Torokhov         | Left       |  3   | Y1                              |
157*b08c118cSDmitry Torokhov         +------------+------+---------------------------------+
158*b08c118cSDmitry Torokhov         | Back       |  2   | X1 xor X0 (BIT#01 xor BIT#00)   |
159*b08c118cSDmitry Torokhov         +------------+------+---------------------------------+
160*b08c118cSDmitry Torokhov         | Right      |  4   | X1                              |
161*b08c118cSDmitry Torokhov         +------------+------+---------------------------------+
162*b08c118cSDmitry Torokhov
163*b08c118cSDmitry Torokhov-------------------------------------------------------------------------------
164*b08c118cSDmitry Torokhov
165*b08c118cSDmitry Torokhov========  === ==== ==== ====== =================================================
166*b08c118cSDmitry TorokhovNAME      rev ADDR type chip    Description
167*b08c118cSDmitry Torokhov========  === ==== ==== ====== =================================================
168*b08c118cSDmitry TorokhovJOYTEST       036   W   Denise  Write to all 4  joystick-mouse counters at once.
169*b08c118cSDmitry Torokhov========  === ==== ==== ====== =================================================
170*b08c118cSDmitry Torokhov
171*b08c118cSDmitry Torokhov                  Mouse counter write test data:
172*b08c118cSDmitry Torokhov
173*b08c118cSDmitry Torokhov========= === === === === === === === === ====== === === === === === === ===
174*b08c118cSDmitry Torokhov     BIT#  15  14  13  12  11  10  09  08     07  06  05  04  03  02  01  00
175*b08c118cSDmitry Torokhov========= === === === === === === === === ====== === === === === === === ===
176*b08c118cSDmitry Torokhov  JOYxDAT  Y7  Y6  Y5  Y4  Y3  Y2  xx  xx     X7  X6  X5  X4  X3  X2  xx  xx
177*b08c118cSDmitry Torokhov  JOYxDAT  Y7  Y6  Y5  Y4  Y3  Y2  xx  xx     X7  X6  X5  X4  X3  X2  xx  xx
178*b08c118cSDmitry Torokhov========= === === === === === === === === ====== === === === === === === ===
179*b08c118cSDmitry Torokhov
180*b08c118cSDmitry Torokhov-------------------------------------------------------------------------------
181*b08c118cSDmitry Torokhov
182*b08c118cSDmitry Torokhov======= === ==== ==== ====== ========================================
183*b08c118cSDmitry TorokhovNAME    rev ADDR type chip   Description
184*b08c118cSDmitry Torokhov======= === ==== ==== ====== ========================================
185*b08c118cSDmitry TorokhovPOT0DAT  h  012   R   Paula  Pot counter data left pair (vert, horiz)
186*b08c118cSDmitry TorokhovPOT1DAT  h  014   R   Paula  Pot counter data right pair (vert,horiz)
187*b08c118cSDmitry Torokhov======= === ==== ==== ====== ========================================
188*b08c118cSDmitry Torokhov
189*b08c118cSDmitry Torokhov        These addresses each read a pair of 8 bit pot counters.
190*b08c118cSDmitry Torokhov        (4 counters total). The bit assignment for both
191*b08c118cSDmitry Torokhov        addresses is shown below. The counters are stopped by signals
192*b08c118cSDmitry Torokhov        from 2 controller connectors (left-right) with 2 pins each.
193*b08c118cSDmitry Torokhov
194*b08c118cSDmitry Torokhov====== === === === === === === === === ====== === === === === === === ===
195*b08c118cSDmitry Torokhov  BIT#  15  14  13  12  11  10  09  08     07  06  05  04  03  02  01  00
196*b08c118cSDmitry Torokhov====== === === === === === === === === ====== === === === === === === ===
197*b08c118cSDmitry Torokhov RIGHT  Y7  Y6  Y5  Y4  Y3  Y2  Y1  Y0     X7  X6  X5  X4  X3  X2  X1  X0
198*b08c118cSDmitry Torokhov  LEFT  Y7  Y6  Y5  Y4  Y3  Y2  Y1  Y0     X7  X6  X5  X4  X3  X2  X1  X0
199*b08c118cSDmitry Torokhov====== === === === === === === === === ====== === === === === === === ===
200*b08c118cSDmitry Torokhov
201*b08c118cSDmitry Torokhov         +--------------------------+-------+
202*b08c118cSDmitry Torokhov         | CONNECTORS               | PAULA |
203*b08c118cSDmitry Torokhov         +-------+------+-----+-----+-------+
204*b08c118cSDmitry Torokhov         | Loc.  | Dir. | Sym | pin | pin   |
205*b08c118cSDmitry Torokhov         +=======+======+=====+=====+=======+
206*b08c118cSDmitry Torokhov         | RIGHT | Y    | RX  | 9   | 33    |
207*b08c118cSDmitry Torokhov         +-------+------+-----+-----+-------+
208*b08c118cSDmitry Torokhov         | RIGHT | X    | RX  | 5   | 32    |
209*b08c118cSDmitry Torokhov         +-------+------+-----+-----+-------+
210*b08c118cSDmitry Torokhov         | LEFT  | Y    | LY  | 9   | 36    |
211*b08c118cSDmitry Torokhov         +-------+------+-----+-----+-------+
212*b08c118cSDmitry Torokhov         | LEFT  | X    | LX  | 5   | 35    |
213*b08c118cSDmitry Torokhov         +-------+------+-----+-----+-------+
214*b08c118cSDmitry Torokhov
215*b08c118cSDmitry Torokhov         With normal (NTSC or PAL) horiz. line rate, the pots will
216*b08c118cSDmitry Torokhov         give a full scale (FF) reading with about 500kohms in one
217*b08c118cSDmitry Torokhov         frame time. With proportionally faster horiz line times,
218*b08c118cSDmitry Torokhov         the counters will count proportionally faster.
219*b08c118cSDmitry Torokhov         This should be noted when doing variable beam displays.
220*b08c118cSDmitry Torokhov
221*b08c118cSDmitry Torokhov-------------------------------------------------------------------------------
222*b08c118cSDmitry Torokhov
223*b08c118cSDmitry Torokhov====== === ==== ==== ====== ================================================
224*b08c118cSDmitry TorokhovNAME   rev ADDR type chip   Description
225*b08c118cSDmitry Torokhov====== === ==== ==== ====== ================================================
226*b08c118cSDmitry TorokhovPOTGO      034   W   Paula  Pot port (4 bit) bi-direction and data, and pot
227*b08c118cSDmitry Torokhov			    counter start.
228*b08c118cSDmitry Torokhov====== === ==== ==== ====== ================================================
229*b08c118cSDmitry Torokhov
230*b08c118cSDmitry Torokhov-------------------------------------------------------------------------------
231*b08c118cSDmitry Torokhov
232*b08c118cSDmitry Torokhov====== === ==== ==== ====== ================================================
233*b08c118cSDmitry TorokhovNAME   rev ADDR type chip   Description
234*b08c118cSDmitry Torokhov====== === ==== ==== ====== ================================================
235*b08c118cSDmitry TorokhovPOTINP     016   R   Paula  Pot pin data read
236*b08c118cSDmitry Torokhov====== === ==== ==== ====== ================================================
237*b08c118cSDmitry Torokhov
238*b08c118cSDmitry Torokhov        This register controls a 4 bit bi-direction I/O port
239*b08c118cSDmitry Torokhov        that shares the same 4 pins as the 4 pot counters above.
240*b08c118cSDmitry Torokhov
241*b08c118cSDmitry Torokhov         +-------+----------+---------------------------------------------+
242*b08c118cSDmitry Torokhov         | BIT#  | FUNCTION | DESCRIPTION                                 |
243*b08c118cSDmitry Torokhov         +=======+==========+=============================================+
244*b08c118cSDmitry Torokhov         | 15    | OUTRY    | Output enable for Paula pin 33              |
245*b08c118cSDmitry Torokhov         +-------+----------+---------------------------------------------+
246*b08c118cSDmitry Torokhov         | 14    | DATRY    | I/O data Paula pin 33                       |
247*b08c118cSDmitry Torokhov         +-------+----------+---------------------------------------------+
248*b08c118cSDmitry Torokhov         | 13    | OUTRX    | Output enable for Paula pin 32              |
249*b08c118cSDmitry Torokhov         +-------+----------+---------------------------------------------+
250*b08c118cSDmitry Torokhov         | 12    | DATRX    | I/O data Paula pin 32                       |
251*b08c118cSDmitry Torokhov         +-------+----------+---------------------------------------------+
252*b08c118cSDmitry Torokhov         | 11    | OUTLY    | Out put enable for Paula pin 36             |
253*b08c118cSDmitry Torokhov         +-------+----------+---------------------------------------------+
254*b08c118cSDmitry Torokhov         | 10    | DATLY    | I/O data Paula pin 36                       |
255*b08c118cSDmitry Torokhov         +-------+----------+---------------------------------------------+
256*b08c118cSDmitry Torokhov         | 09    | OUTLX    | Output enable for Paula pin 35              |
257*b08c118cSDmitry Torokhov         +-------+----------+---------------------------------------------+
258*b08c118cSDmitry Torokhov         | 08    | DATLX    | I/O data  Paula pin 35                      |
259*b08c118cSDmitry Torokhov         +-------+----------+---------------------------------------------+
260*b08c118cSDmitry Torokhov         | 07-01 |   X      | Not used                                    |
261*b08c118cSDmitry Torokhov         +-------+----------+---------------------------------------------+
262*b08c118cSDmitry Torokhov         | 00    | START    | Start pots (dump capacitors,start counters) |
263*b08c118cSDmitry Torokhov         +-------+----------+---------------------------------------------+
264