47#include "debug/PS2.hh"
50#include "params/PS2TouchKit.hh"
61 enabled(false), touchKitEnabled(false)
90 DPRINTF(PS2,
"Resetting device.\n");
103 DPRINTF(PS2,
"Disabling device.\n");
109 DPRINTF(PS2,
"Enabling device.\n");
115 DPRINTF(PS2,
"Setting defaults and disabling device.\n");
128 return data.size() == 2;
150 panic(
"Unknown byte received: %#x\n",
data[0]);
166 const uint8_t cmd =
data[2];
175 warn_if(
len != 1,
"Unexpected activate packet length: %u\n",
len);
180 panic(
"Unimplemented touchscreen command: %#x\n", cmd);
189 for (
int i = 0;
i < size; ++
i)
208 const uint8_t resp[] = {
210 (uint8_t)(_x >> 7), (uint8_t)(_x & 0x7f),
211 (uint8_t)(_y >> 7), (uint8_t)(_y & 0x7f),
214 send(resp,
sizeof(resp));
size_t sendPending() const
Output buffer size.
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.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
VncInput *const vnc
The vnc server we're connected to (if any)
bool recvTouchKit(const std::vector< uint8_t > &data)
TouchKit(const PS2TouchKitParams &p)
void mouseAt(uint16_t x, uint16_t y, uint8_t buttons) override
called whenever the mouse moves or it's button state changes buttons is a simple mask with each butto...
void sendTouchKit(const uint8_t *data, size_t size)
bool touchKitEnabled
Has the driver enabled TouchKit mode? The model suppresses touch event generation until this is true.
void serialize(CheckpointOut &cp) const override
Serialize an object.
bool enabled
Is the device enabled?
bool recv(const std::vector< uint8_t > &data) override
Data received from host.
#define panic(...)
This implements a cprintf based panic() function.
#define warn_if(cond,...)
Conditional warning macro that checks the supplied condition and only prints a warning if the conditi...
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)