Skip to content

Commit

Permalink
ps2: moved ps2 microsoft mouse example
Browse files Browse the repository at this point in the history
- moved example of host-to-mouse configuration and mouse-to-host movement packets for
a 4-byte Microsft Mouse communicating with a Windows host into ps2/mouse directory
- Added README for the ps2/mouse directory, explaining the two examples
  • Loading branch information
kamocat committed Apr 29, 2023
1 parent 47a477a commit 3cb2d64
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions ps2/mouse/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
--------------------------------
PS/2 Mouse
--------------------------------

This is a collection of PS/2 mice communication examples.

For details see:
http://www-ug.eecg.utoronto.ca/desl/nios_devices_SoC/datasheets/PS2%20Protocol.htm
http://www-ug.eecg.utoronto.ca/desl/nios_devices_SoC/datasheets/PS2%20Mouse%20Protocol.htm


ps2_mouse_host_setup_and_movement.sr
------------------------------

This file contains a portion of setup from a QNX host to a trackball PS2 mouse.
The mouse packets are 3 bytes long (standard mouse, no scrollwheel)
The sample includes x movement, y movement, and a click.


ps2_microsoft_mouse_initialize_and_move.sr
------------------------------

This file contains setup and communication between a Windows host and a microsoft mouse.
The host releases the clock simultaneous to pulling the data low, which makes it challenging to
distinguish between "request-to-send" and a regular start-bit.

Initialize a ps2 mouse, configure it; the mouse then reports movement data.

- host resets device, waits for reset to complete
- host sets sample rate to 200, 100, 80 - this activates reporting scroll wheel data is available
- host sets device to maximum sample rate: 200; resolution=1: 2 count/mm; 1:1 scaling, stream mode
- host gets device id, enable data reporting
- after a delay, the mouse is moved, and reports it's changing location, in sequences of 4 bytes:
- flags, x movement, y movement, z (scroll wheel) movement.
- the sample data does not include any button presses or scroll wheel movement

File renamed without changes.

0 comments on commit 3cb2d64

Please sign in to comment.