Information Technology Reference
In-Depth Information
10.5 Mouse
Typically on modern PCs the PS/2-style mouse is preferred over serial port mice. PS/2-style
mice free up the serial port for other uses, such as for data transfers, modem connections, and
so on. Table 10.3 outlines the commands that can be used to program the mouse.
Table 10.3
Control register commands
Code
Command
Description
e6h
Reset scaling
e7h
Set scaling
e8h
Set resolution
Sets the resolution: 00h = 1 count/mm, 01h = 2 counts/mm,
02h = 4 counts/mm and 03 = 8 counts/mm.
e9h
Determine status
3 status bytes
Byte 1:
Bit 0: Right mouse button pressed (if 1).
Bit 2: Left mouse button pressed (if 1).
Bit 4: Scaling (0=1:1, 1=1:2).
Bit 5: Mouse (0=enabled, 1=disabled).
Bit 6: Mode (0=stream, 1=remote).
Byte 2: Resolution.
Byte 3: Sample rate.
eah
Set stream mode
ebh
Read data
Reads an 8-byte data packet from the mouse.
ech
Resets mouse to normal
mode
eeh
Sets mouse to wrap mode
In wrap mode all the commands or data sent to the mouse.
f0h
Set remote mode
f2h
Identify unit
00h = mouse
f3h
Set sampling rate
Sampling rate is then set by the value put into output
buffer: 0ah = 10 samples/s, 14h = 20 samples/s, 28h = 40
samples/s, 3c = 60 samples/s, 50h = 80 samples/s, 64h =
100 samples/s and c8h = 200 samples/s.
f4h
Enable mouse
f5h
Disable mouse
f6h
Set standard mouse to stan-
dard values
feh
Resend
ffh
Reset
The PS/2 mouse is programmed by:
 
Search WWH ::




Custom Search