3 Copyright (C) Dean Camera, 2009.
5 dean [at] fourwalledcubicle [dot] com
6 www.fourwalledcubicle.com
10 Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
11 Copyright 2009 Denver Gingerich (denver [at] ossguy [dot] com)
13 Permission to use, copy, modify, and distribute this software
14 and its documentation for any purpose and without fee is hereby
15 granted, provided that the above copyright notice appear in all
16 copies and that both that the copyright notice and this
17 permission notice and warranty disclaimer appear in supporting
18 documentation, and that the name of the author not be used in
19 advertising or publicity pertaining to distribution of the
20 software without specific, written prior permission.
22 The author disclaim all warranties with regard to this
23 software, including all implied warranties of merchantability
24 and fitness. In no event shall the author be liable for any
25 special, indirect or consequential damages or any damages
26 whatsoever resulting from loss of use, data or profits, whether
27 in an action of contract, negligence or other tortious action,
28 arising out of or in connection with the use or performance of
32 #ifndef _KEYBOARD_MOUSE_H_
33 #define _KEYBOARD_MOUSE_H_
38 #include <avr/power.h>
42 #include "Descriptors.h"
44 #include <LUFA/Version.h>
45 #include <LUFA/Drivers/Board/Joystick.h>
46 #include <LUFA/Drivers/Board/LEDs.h>
47 #include <LUFA/Drivers/Board/Buttons.h>
48 #include <LUFA/Drivers/USB/USB.h>
49 #include <LUFA/Drivers/USB/Class/Device/HID.h>
52 #define LEDMASK_USB_NOTREADY LEDS_LED1
53 #define LEDMASK_USB_ENUMERATING (LEDS_LED2 | LEDS_LED3)
54 #define LEDMASK_USB_READY (LEDS_LED2 | LEDS_LED4)
55 #define LEDMASK_USB_ERROR (LEDS_LED1 | LEDS_LED3)
58 /** Type define for the keyboard HID report structure, for creating and sending HID reports to the host PC.
59 * This mirrors the layout described to the host in the HID report descriptor, in Descriptors.c.
63 uint8_t Modifier
; /**< Modifier mask byte, containing a mask of modifier keys set (such as shift or CTRL) */
64 uint8_t Reserved
; /**< Reserved, always set as 0x00 */
65 uint8_t KeyCode
[6]; /**< Array of up to six simultaneous key codes of pressed keys */
66 } USB_KeyboardReport_Data_t
;
68 /** Type define for the mouse HID report structure, for creating and sending HID reports to the host PC.
69 * This mirrors the layout described to the host in the HID report descriptor, in Descriptors.c.
73 uint8_t Button
; /**< Bit mask of the currently pressed mouse buttons */
74 int8_t X
; /**< Current mouse delta X movement, as a signed 8-bit integer */
75 int8_t Y
; /**< Current mouse delta Y movement, as a signed 8-bit integer */
76 } USB_MouseReport_Data_t
;
78 /* Function Prototypes: */
79 void SetupHardware(void);
81 void EVENT_USB_Connect(void);
82 void EVENT_USB_Disconnect(void);
83 void EVENT_USB_ConfigurationChanged(void);
84 void EVENT_USB_UnhandledControlPacket(void);
85 void EVENT_USB_StartOfFrame(void);
87 uint16_t CALLBACK_USB_HID_CreateNextHIDReport(USB_ClassInfo_HID_t
* HIDInterfaceInfo
, void* ReportData
);
88 void CALLBACK_USB_HID_ProcessReceivedHIDReport(USB_ClassInfo_HID_t
* HIDInterfaceInfo
,
89 void* ReportData
, uint16_t ReportSize
);