2 * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
20 * @APPLE_LICENSE_HEADER_END@
23 #ifndef _APPLEPS2MOUSE_H
24 #define _APPLEPS2MOUSE_H
26 #include <IOKit/ps2/ApplePS2MouseDevice.h>
27 #include <IOKit/hidsystem/IOHIPointing.h>
29 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
33 #define kPacketLengthMax 4
34 #define kPacketLengthStandard 3
35 #define kPacketLengthIntellimouse 4
39 kMouseTypeStandard
= 0x00,
40 kMouseTypeIntellimouse
= 0x03
43 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
44 // ApplePS2Mouse Class Declaration
47 class ApplePS2Mouse
: public IOHIPointing
49 OSDeclareDefaultStructors(ApplePS2Mouse
);
52 ApplePS2MouseDevice
* _device
;
53 unsigned _interruptHandlerInstalled
:1;
54 UInt8 _packetBuffer
[kPacketLengthMax
];
55 UInt32 _packetByteCount
;
57 IOFixed _resolution
; // (dots per inch)
60 virtual void dispatchRelativePointerEventWithPacket(UInt8
* packet
);
61 virtual UInt8
getMouseID();
62 virtual UInt32
getMouseInformation();
63 virtual void setCommandByte(UInt8 setBits
, UInt8 clearBits
);
64 virtual bool setIntellimouseMode();
65 virtual void setMouseEnable(bool enable
);
66 virtual void setMouseSampleRate(UInt8 sampleRate
);
69 virtual IOItemCount
buttonCount();
70 virtual IOFixed
resolution();
73 virtual bool init(OSDictionary
* properties
);
74 virtual ApplePS2Mouse
* probe(IOService
* provider
, SInt32
* score
);
76 virtual bool start(IOService
* provider
);
77 virtual void stop(IOService
* provider
);
79 virtual void interruptOccurred(UInt8 data
);
81 virtual UInt32
deviceType();
82 virtual UInt32
interfaceID();
85 #endif /* _APPLEPS2MOUSE_H */