Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ps2: Added ps2 mouse example #42

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions ps2/mouse/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
--------------------------------
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_qnx_mouse_initialize_and_move.sr
------------------------------

This file contains setup and communication between a QNX host and a standard mouse.
The mouse packets are 3 bytes long (standard mouse, no scrollwheel)
The sample includes x movement, y movement, and a click.

Initialize a ps2 mouse, configure it; the mouse then reports movement data.
- Power is turned on, mouse resets
- Host resets device, waits for reset to complete
- Host waits for GUI to start (about 90 seconds)
- Host sets sample rate to 40 samples/second
- Host sets resolution to 8 counts/mm
- Host enables data streaming
- After a delay, the mouse is moved, and reports its changing location in a sequence of 3 bytes:
- flags, x movement, y movement
- The sample includes x and y movement, as well as two left clicks


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

Binary file not shown.
Binary file added ps2/mouse/ps2_qnx_mouse_initialize_and_move.sr
Binary file not shown.