Committer:
chris
Date:
Fri Oct 21 23:02:16 2011 +0000
Revision:
1:4d08e0ebf5dd
Parent:
0:e98d1c2b16c6

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
chris 0:e98d1c2b16c6 1 /* USBClass_HID.h */
chris 0:e98d1c2b16c6 2 /* Human Interface Device (HID) class */
chris 0:e98d1c2b16c6 3 /* Copyright (c) 2011 ARM Limited. All rights reserved. */
chris 0:e98d1c2b16c6 4
chris 0:e98d1c2b16c6 5 #ifndef _USB_CLASS_HID_
chris 0:e98d1c2b16c6 6 #define _USB_CLASS_HID_
chris 0:e98d1c2b16c6 7
chris 0:e98d1c2b16c6 8 /* These headers are included for child class. */
chris 0:e98d1c2b16c6 9 #include "USBEndpoints.h"
chris 0:e98d1c2b16c6 10 #include "USBDescriptor.h"
chris 0:e98d1c2b16c6 11 #include "USBHID_Types.h"
chris 0:e98d1c2b16c6 12 #include "USBDevice_Types.h"
chris 0:e98d1c2b16c6 13 #include "USBDevice.h"
chris 0:e98d1c2b16c6 14 #include "asciihid.h"
chris 0:e98d1c2b16c6 15
chris 0:e98d1c2b16c6 16 #include "USBDevice.h"
chris 0:e98d1c2b16c6 17
chris 0:e98d1c2b16c6 18 bool USBClass_HID_request(void);
chris 0:e98d1c2b16c6 19 void USBClass_HID_requestCompleted(void);
chris 0:e98d1c2b16c6 20 bool USBClass_HID_sendInputReport(uint8_t endpoint, HID_REPORT *report);
chris 0:e98d1c2b16c6 21 bool USBClass_HID_getOutputReport(uint8_t endpoint, HID_REPORT *report);
chris 0:e98d1c2b16c6 22
chris 0:e98d1c2b16c6 23
chris 0:e98d1c2b16c6 24 class USBHID: public USBDevice
chris 0:e98d1c2b16c6 25 {
chris 0:e98d1c2b16c6 26 public:
chris 0:e98d1c2b16c6 27 //reportDesc is called to initalize the length of the report descriptor
chris 0:e98d1c2b16c6 28 USBHID();
chris 0:e98d1c2b16c6 29 virtual uint8_t * ReportDesc(){return NULL;};
chris 0:e98d1c2b16c6 30 virtual uint16_t ReportDescLength();
chris 0:e98d1c2b16c6 31
chris 0:e98d1c2b16c6 32 virtual void HID_callbackSetReport(HID_REPORT *report);
chris 0:e98d1c2b16c6 33
chris 0:e98d1c2b16c6 34 virtual void USBCallback_busReset(void);
chris 0:e98d1c2b16c6 35 virtual bool USBCallback_request();
chris 0:e98d1c2b16c6 36 virtual void USBCallback_requestCompleted();
chris 0:e98d1c2b16c6 37 virtual bool USBCallback_setConfiguration(uint8_t configuration);
chris 0:e98d1c2b16c6 38
chris 0:e98d1c2b16c6 39 protected:
chris 0:e98d1c2b16c6 40 uint16_t reportLength;
chris 0:e98d1c2b16c6 41 };
chris 0:e98d1c2b16c6 42
chris 0:e98d1c2b16c6 43 void setInstanceHID(USBHID * _inst);
chris 0:e98d1c2b16c6 44
chris 0:e98d1c2b16c6 45 #endif