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)
12 Permission to use, copy, modify, and distribute this software
13 and its documentation for any purpose and without fee is hereby
14 granted, provided that the above copyright notice appear in all
15 copies and that both that the copyright notice and this
16 permission notice and warranty disclaimer appear in supporting
17 documentation, and that the name of the author not be used in
18 advertising or publicity pertaining to distribution of the
19 software without specific, written prior permission.
21 The author disclaim all warranties with regard to this
22 software, including all implied warranties of merchantability
23 and fitness. In no event shall the author be liable for any
24 special, indirect or consequential damages or any damages
25 whatsoever resulting from loss of use, data or profits, whether
26 in an action of contract, negligence or other tortious action,
27 arising out of or in connection with the use or performance of
33 * Header file for GenericHID.c.
36 #ifndef _GENERICHID_H_
37 #define _GENERICHID_H_
42 #include <avr/power.h>
43 #include <avr/interrupt.h>
47 #include "Descriptors.h"
49 #include <LUFA/Version.h> // Library Version Information
50 #include <LUFA/Scheduler/Scheduler.h> // Simple scheduler for task management
51 #include <LUFA/Drivers/USB/USB.h> // USB Functionality
52 #include <LUFA/Drivers/Board/LEDs.h> // LEDs driver
55 /** HID Class specific request to get the next HID report from the device. */
56 #define REQ_GetReport 0x01
58 /** HID Class specific request to send the next HID report to the device. */
59 #define REQ_SetReport 0x09
62 /** Enum for the possible status codes for passing to the UpdateStatus() function. */
63 enum GenericHID_StatusCodes_t
65 Status_USBNotReady
= 0, /**< USB is not ready (disconnected from a USB host) */
66 Status_USBEnumerating
= 1, /**< USB interface is enumerating */
67 Status_USBReady
= 2, /**< USB interface is connected and ready */
71 /** Indicates that this module will catch the USB_Reset event when thrown by the library. */
72 HANDLES_EVENT(USB_Reset
);
74 /** Indicates that this module will catch the USB_Connect event when thrown by the library. */
75 HANDLES_EVENT(USB_Connect
);
77 /** Indicates that this module will catch the USB_Disconnect event when thrown by the library. */
78 HANDLES_EVENT(USB_Disconnect
);
80 /** Indicates that this module will catch the USB_ConfigurationChanged event when thrown by the library. */
81 HANDLES_EVENT(USB_ConfigurationChanged
);
83 /* Task Definitions: */
86 /* Function Prototypes: */
87 void UpdateStatus(uint8_t CurrentStatus
);
88 void ProcessGenericHIDReport(uint8_t* DataArray
);
89 void CreateGenericHIDReport(uint8_t* DataArray
);