touchkit.hh revision 12655
12SN/A/* 21762SN/A * Copyright (c) 2010, 2017-2018 ARM Limited 32SN/A * All rights reserved 42SN/A * 52SN/A * The license below extends only to copyright in the software and shall 62SN/A * not be construed as granting a license to any other intellectual 72SN/A * property including but not limited to intellectual property relating 82SN/A * to a hardware implementation of the functionality of the software 92SN/A * licensed hereunder. You may use the software subject to the license 102SN/A * terms below provided that you ensure that this notice is replicated 112SN/A * unmodified and in its entirety in all distributions of the software, 122SN/A * modified or unmodified, in source code or in binary form. 132SN/A * 142SN/A * Redistribution and use in source and binary forms, with or without 152SN/A * modification, are permitted provided that the following conditions are 162SN/A * met: redistributions of source code must retain the above copyright 172SN/A * notice, this list of conditions and the following disclaimer; 182SN/A * redistributions in binary form must reproduce the above copyright 192SN/A * notice, this list of conditions and the following disclaimer in the 202SN/A * documentation and/or other materials provided with the distribution; 212SN/A * neither the name of the copyright holders nor the names of its 222SN/A * contributors may be used to endorse or promote products derived from 232SN/A * this software without specific prior written permission. 242SN/A * 252SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 262SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 272665Ssaidi@eecs.umich.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 282665Ssaidi@eecs.umich.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 292665Ssaidi@eecs.umich.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 302SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 312SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 325569Snate@binkert.org * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 335569Snate@binkert.org * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 342SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 355569Snate@binkert.org * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 367678Sgblack@eecs.umich.edu * 373614Sgblack@eecs.umich.edu * Authors: Andreas Sandberg 383614Sgblack@eecs.umich.edu */ 392166SN/A 402147SN/A#ifndef __DEV_PS2_TOUCHKIT_HH__ 415569Snate@binkert.org#define __DEV_PS2_TOUCHKIT_HH__ 422167SN/A 432147SN/A#include "base/vnc/vncinput.hh" 442090SN/A#include "dev/ps2/device.hh" 452222SN/A 462090SN/Astruct PS2TouchKitParams; 472201SN/A 482201SN/Aclass PS2TouchKit : public PS2Device, public VncMouse 492201SN/A{ 502112SN/A protected: 5110474Sandreas.hansson@arm.com static const uint8_t ID[]; 5210417Sandreas.hansson@arm.com 5310417Sandreas.hansson@arm.com public: 542175SN/A PS2TouchKit(const PS2TouchKitParams *p); 552222SN/A 562SN/A void serialize(CheckpointOut &cp) const override; 572SN/A void unserialize(CheckpointIn &cp) override; 582203SN/A 592166SN/A protected: // PS2Device 602166SN/A void recv(uint8_t data) override; 612203SN/A 622166SN/A public: // VncMouse 632222SN/A void mouseAt(uint16_t x, uint16_t y, uint8_t buttons) override; 645569Snate@binkert.org 652166SN/A protected: 664695Sgblack@eecs.umich.edu /** The vnc server we're connected to (if any) */ 672166SN/A VncInput *const vnc; 682222SN/A 692166SN/A /** 702166SN/A * If the controller should ignore the next N data bytes and 712203SN/A * acknowledge them. This occurs when the driver is attempting to 722166SN/A * setup some feature we don't care about. 732166SN/A */ 742203SN/A int ackNext; 752166SN/A 762222SN/A /** 775569Snate@binkert.org * Has the driver been initialized in TouchKit mode? The model 782166SN/A * suppresses touch event generation until this is true. 794695Sgblack@eecs.umich.edu */ 802166SN/A bool driverInitialized; 812222SN/A}; 824695Sgblack@eecs.umich.edu 832166SN/A#endif // __DEV_PS2_TOUCHKIT_HH__ 842166SN/A 852147SN/A