home *** CD-ROM | disk | FTP | other *** search
Modula Definition | 1988-02-17 | 2.1 KB | 73 lines |
- DEFINITION MODULE RightControlPortIO; (* M2Amiga *)
-
- (* gestattet IO ueber rechten ControlPort und initialisiert
- PotGoResource.
-
- PIN: VERWENDUNG:
- R1 joystick switch, active low, input only (forward)
- R2 joystick switch, active low, input only (back)
- R3 joystick switch, active low, input only (left)
- R4 joystick switch, active low, input only (right)
-
- R5 PotGo IO, biderectional, als input active low, 300 micros
- R9 PotGo IO, biderectional, als input active low, 300 micros
-
- R6 fast biderectional IO, fire button
- *)
-
- TYPE PotPinNumbers = (R5, R9);
- JoyPinNumbers = (R1, R2, R3, R4);
- Level = (Low, High);
-
- VAR RightPotgoOpen : BOOLEAN;
-
-
- (* Bidirectinal PotGoIO ******************************************)
-
- PROCEDURE WriteToPotPin(Pin : PotPinNumbers; Value : Level);
-
- (* Ausgabe ueber PotPins 5 oder 9. Level liegt in ca. 300 micros an
- *)
-
- PROCEDURE ReadFromPotPin(Pin : PotPinNumbers) : Level;
-
- (* Eingaben von R5 oder R9 lesen
- *)
-
- PROCEDURE EnablePotGoAccess;
-
- (* Oeffnen der PotGoResource und Anlegen der Datenstruktur, um Pins
- 5 und 9 nutzen zu koennen. Prozedur wird nach dem Laden des Mo-
- duls selbstaendig aufgerufen. Sie kann auch aufgerufen werden,
- nachdem "CancelPotGoAccess" benutzt wurde. Ergebnis des Aufrufs
- enthaelt Variable "RightPotgoOpen".
- *)
-
- PROCEDURE CancelPotGoAccess;
-
- (* Aufgeben der PotGoResource, damit der Zugriffsmoeglichkeit auf
- Pin 5 und 9. Prozedur sollte immer aufgerufen werden, wenn Pin 5
- und 9 nicht benutzt werden.
- *)
-
- (* Input from Joystick switches R1, R2, R3 und R4 ****************)
-
- PROCEDURE ReadJoystick(Pin : JoyPinNumbers):Level;
-
- (* Individuelles Lesen der vier Joystick-Schalter. Normalerweise
- sind die Schalter offen, der Level somit High.
- Es gilt somit : active low
- *)
-
- (*Bidirectional IO ueber Pin 6 ************************************)
-
- PROCEDURE WriteToPin6 (Input : Level);
-
- PROCEDURE ReadFromPin6() : Level;
-
-
- END RightControlPortIO.
-
-
- Listing 2