| |||
| Home > Peripheral and Interface Components > Example Peripheral Components > PS2Mouse component | |||
The PS2Mouse component implements the PS/2 register interface of a PS/2 style mouse. The mouse movement and button press data must be provided from another component such as the Visualisation component.
Figure 5.32 shows a view of the component in System Canvas.
This component is written in LISA+.
Table 5.49 provides a brief description of the ports in the PS2Mouse component. See the RealView Emulation Baseboard User Guide (Lead Free).
Table 5.49. PS2Mouse ports
| Name | Port protocol | Type | Description |
|---|---|---|---|
| mouse | MouseStatus[a] | Slave | Receives keyboard input from, for example, the Visualisation component. |
| clk_in | ClockSignal | Slave | Drives the PS/2 clocking rate, typically 1MHz. |
| ps2 | PS2Data | Master | Connection to the PS/2 controller, for example the PL050_KMI. |
[a] The MouseStatus protocol is documented in Visualization Library. | |||
The PS2Mouse component has one additional protocol.
The MouseStatus protocol is used to pass mouse movement and button events to another component such as the PS2Mouse component. Events are only sent when the visualization window is in focus.
The protocol behaviors are:
mouseMove(int
dx, int dy) : voidThis is sent when the host mouse is moved. Mouse movement events are always relative.
mouseButton(uint8_t
button, bool down) : voidThis is sent when a button on the host mouse is pressed or released.
button indicates which button has been pressed or released and is typically 0,1 or 2 but can be anything up to 7 depending on the OS and attached mouse.
down is true if a button is pressed and false if released.
The PS2Mouse component has been tested as part of the VE example system using VE test suites and by booting operating systems.
The PS2Mouse component is not expected to significantly affect the performance of a PV system. However if it is connected to the Visualisation component, then the performance of the component is dependent on that of the visualization.