45#include "debug/PS2.hh"
47#include "params/PS2Mouse.hh"
58 status(0), resolution(4), sampleRate(100)
67 DPRINTF(PS2,
"Mouse ID requested.\n");
72 DPRINTF(PS2,
"Disabling data reporting.\n");
77 DPRINTF(PS2,
"Enabling data reporting.\n");
82 panic(
"Mouse resend unimplemented.\n");
84 DPRINTF(PS2,
"Resetting the mouse.\n");
95 DPRINTF(PS2,
"Setting mouse scale to 1:1.\n");
100 DPRINTF(PS2,
"Setting mouse scale to 2:1.\n");
105 if (
data.size() == 1) {
106 DPRINTF(PS2,
"Setting mouse resolution.\n");
110 DPRINTF(PS2,
"Mouse resolution set to %d.\n",
data[1]);
116 DPRINTF(PS2,
"Getting mouse status.\n");
123 panic(
"Reading mouse data unimplemented.\n");
125 DPRINTF(PS2,
"Resetting Wrap Mode\n");
129 panic(
"Setting mouse wrap mode unimplemented.\n");
131 panic(
"Setting mouse remote mode unimplemented.\n");
133 if (
data.size() == 1) {
134 DPRINTF(PS2,
"Setting mouse sample rate.\n");
138 DPRINTF(PS2,
"Mouse sample rate %d samples "
139 "per second.\n",
data[1]);
145 DPRINTF(PS2,
"Disabling and resetting mouse.\n");
153 warn(
"Unknown mouse command %#02x.\n",
data[0]);
void serialize(CheckpointOut &cp) const override
Serialize an object.
void send(const uint8_t *data, size_t size)
Send data from a PS/2 device to a host.
void sendAck()
Send an ACK byte to the host.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
PS2Mouse(const PS2MouseParams &p)
bool recv(const std::vector< uint8_t > &data) override
Data received from host.
void serialize(CheckpointOut &cp) const override
Serialize an object.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
#define panic(...)
This implements a cprintf based panic() function.
const std::vector< uint8_t > ID
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
std::ostream CheckpointOut
#define UNSERIALIZE_SCALAR(scalar)
#define SERIALIZE_SCALAR(scalar)