Added multiple Report ID support to the HID class driver. Removed OUT endpoint suppor...
authorDean Camera <dean@fourwalledcubicle.com>
Fri, 5 Jun 2009 02:23:31 +0000 (02:23 +0000)
committerDean Camera <dean@fourwalledcubicle.com>
Fri, 5 Jun 2009 02:23:31 +0000 (02:23 +0000)
23 files changed:
Demos/Device/GenericHID/Descriptors.c
Demos/Device/GenericHID/Descriptors.h
Demos/Device/GenericHID/GenericHID.c
Demos/Device/GenericHID/GenericHID.h
Demos/Device/Joystick/Joystick.c
Demos/Device/Joystick/Joystick.h
Demos/Device/Keyboard/Descriptors.c
Demos/Device/Keyboard/Descriptors.h
Demos/Device/Keyboard/Keyboard.c
Demos/Device/Keyboard/Keyboard.h
Demos/Device/KeyboardMouse/Descriptors.c
Demos/Device/KeyboardMouse/Descriptors.h
Demos/Device/KeyboardMouse/KeyboardMouse.c
Demos/Device/KeyboardMouse/KeyboardMouse.h
Demos/Device/Mouse/Mouse.c
Demos/Device/Mouse/Mouse.h
LUFA/Drivers/USB/Class/Device/CDC.c
LUFA/Drivers/USB/Class/Device/CDC.h
LUFA/Drivers/USB/Class/Device/HID.c
LUFA/Drivers/USB/Class/Device/HID.h
LUFA/Drivers/USB/Class/Device/MIDI.h
Projects/Magstripe/Magstripe.c
Projects/Magstripe/Magstripe.h

index ca1a110..6988166 100644 (file)
@@ -119,7 +119,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                        .InterfaceNumber        = 0x00,\r
                        .AlternateSetting       = 0x00,\r
                        \r
                        .InterfaceNumber        = 0x00,\r
                        .AlternateSetting       = 0x00,\r
                        \r
-                       .TotalEndpoints         = 2,\r
+                       .TotalEndpoints         = 1,\r
                                \r
                        .Class                  = 0x03,\r
                        .SubClass               = 0x00,\r
                                \r
                        .Class                  = 0x03,\r
                        .SubClass               = 0x00,\r
@@ -148,16 +148,6 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                        .EndpointSize           = GENERIC_EPSIZE,\r
                        .PollingIntervalMS      = 0x02\r
                },\r
                        .EndpointSize           = GENERIC_EPSIZE,\r
                        .PollingIntervalMS      = 0x02\r
                },\r
-\r
-       .GenericOUTEndpoint = \r
-               {\r
-                       .Header                 = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},\r
-                                                                                \r
-                       .EndpointAddress        = (ENDPOINT_DESCRIPTOR_DIR_OUT | GENERIC_OUT_EPNUM),\r
-                       .Attributes             = EP_TYPE_INTERRUPT,\r
-                       .EndpointSize           = GENERIC_EPSIZE,\r
-                       .PollingIntervalMS      = 0x02\r
-               }\r
 };\r
 \r
 /** Language descriptor structure. This descriptor, located in FLASH memory, is returned when the host requests\r
 };\r
 \r
 /** Language descriptor structure. This descriptor, located in FLASH memory, is returned when the host requests\r
index bc4c68a..01db53e 100644 (file)
                        USB_Descriptor_Interface_t            Interface;\r
                        USB_Descriptor_HID_t                  GenericHID;\r
                USB_Descriptor_Endpoint_t             GenericINEndpoint;\r
                        USB_Descriptor_Interface_t            Interface;\r
                        USB_Descriptor_HID_t                  GenericHID;\r
                USB_Descriptor_Endpoint_t             GenericINEndpoint;\r
-               USB_Descriptor_Endpoint_t             GenericOUTEndpoint;\r
                } USB_Descriptor_Configuration_t;\r
 \r
        /* Macros: */\r
                /** Endpoint number of the Generic HID reporting IN endpoint. */\r
                #define GENERIC_IN_EPNUM          1\r
 \r
                } USB_Descriptor_Configuration_t;\r
 \r
        /* Macros: */\r
                /** Endpoint number of the Generic HID reporting IN endpoint. */\r
                #define GENERIC_IN_EPNUM          1\r
 \r
-               /** Endpoint number of the Generic HID reporting OUT endpoint. */\r
-               #define GENERIC_OUT_EPNUM         2\r
-\r
                /** Size in bytes of the Generic HID reporting endpoint. */\r
                #define GENERIC_EPSIZE            8\r
                \r
                /** Size in bytes of the Generic HID reporting endpoint. */\r
                #define GENERIC_EPSIZE            8\r
                \r
index b933e45..172df7f 100644 (file)
@@ -47,9 +47,6 @@ USB_ClassInfo_HID_t Generic_HID_Interface =
                .ReportINEndpointNumber  = GENERIC_IN_EPNUM,\r
                .ReportINEndpointSize    = GENERIC_EPSIZE,\r
                \r
                .ReportINEndpointNumber  = GENERIC_IN_EPNUM,\r
                .ReportINEndpointSize    = GENERIC_EPSIZE,\r
                \r
-               .ReportOUTEndpointNumber = GENERIC_OUT_EPNUM,\r
-               .ReportOUTEndpointSize   = GENERIC_EPSIZE,\r
-               \r
                .ReportINBufferSize      = GENERIC_REPORT_SIZE,\r
 \r
                .UsingReportProtocol     = true,\r
                .ReportINBufferSize      = GENERIC_REPORT_SIZE,\r
 \r
                .UsingReportProtocol     = true,\r
@@ -133,7 +130,7 @@ ISR(TIMER0_COMPA_vect, ISR_BLOCK)
  *\r
  *  \return Number of bytes written in the report (or zero if no report is to be sent\r
  */\r
  *\r
  *  \return Number of bytes written in the report (or zero if no report is to be sent\r
  */\r
-uint16_t CALLBACK_USB_HID_CreateNextHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, void* ReportData)\r
+uint16_t CALLBACK_USB_HID_CreateNextHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t* ReportID, void* ReportData)\r
 {\r
        // Create generic HID report here\r
        \r
 {\r
        // Create generic HID report here\r
        \r
@@ -146,7 +143,8 @@ uint16_t CALLBACK_USB_HID_CreateNextHIDReport(USB_ClassInfo_HID_t* HIDInterfaceI
  *  \param ReportData  Pointer to a buffer where the created report has been stored\r
  *  \param ReportSize  Size in bytes of the received HID report\r
  */\r
  *  \param ReportData  Pointer to a buffer where the created report has been stored\r
  *  \param ReportSize  Size in bytes of the received HID report\r
  */\r
-void CALLBACK_USB_HID_ProcessReceivedHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, void* ReportData, uint16_t ReportSize)\r
+void CALLBACK_USB_HID_ProcessReceivedHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t ReportID,\r
+                                               void* ReportData, uint16_t ReportSize)\r
 {\r
        // Process received generic HID report here\r
 }\r
 {\r
        // Process received generic HID report here\r
 }\r
index b68dc4c..5ea084c 100644 (file)
@@ -72,8 +72,8 @@
                void EVENT_USB_ConfigurationChanged(void);\r
                void EVENT_USB_UnhandledControlPacket(void);\r
 \r
                void EVENT_USB_ConfigurationChanged(void);\r
                void EVENT_USB_UnhandledControlPacket(void);\r
 \r
-               uint16_t CALLBACK_USB_HID_CreateNextHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, void* ReportData);\r
-               void     CALLBACK_USB_HID_ProcessReceivedHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo,\r
+               uint16_t CALLBACK_USB_HID_CreateNextHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t* ReportID, void* ReportData);\r
+               void     CALLBACK_USB_HID_ProcessReceivedHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t ReportID, \r
                                                                   void* ReportData, uint16_t ReportSize);\r
                \r
 #endif\r
                                                                   void* ReportData, uint16_t ReportSize);\r
                \r
 #endif\r
index 66cb808..1cf59bb 100644 (file)
@@ -132,7 +132,7 @@ ISR(TIMER0_COMPA_vect, ISR_BLOCK)
  *\r
  *  \return Number of bytes written in the report (or zero if no report is to be sent\r
  */\r
  *\r
  *  \return Number of bytes written in the report (or zero if no report is to be sent\r
  */\r
-uint16_t CALLBACK_USB_HID_CreateNextHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, void* ReportData)\r
+uint16_t CALLBACK_USB_HID_CreateNextHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t* ReportID, void* ReportData)\r
 {\r
        USB_JoystickReport_Data_t* JoystickReport = (USB_JoystickReport_Data_t*)ReportData;\r
        \r
 {\r
        USB_JoystickReport_Data_t* JoystickReport = (USB_JoystickReport_Data_t*)ReportData;\r
        \r
@@ -164,7 +164,8 @@ uint16_t CALLBACK_USB_HID_CreateNextHIDReport(USB_ClassInfo_HID_t* HIDInterfaceI
  *  \param ReportData  Pointer to a buffer where the created report has been stored\r
  *  \param ReportSize  Size in bytes of the received HID report\r
  */\r
  *  \param ReportData  Pointer to a buffer where the created report has been stored\r
  *  \param ReportSize  Size in bytes of the received HID report\r
  */\r
-void CALLBACK_USB_HID_ProcessReceivedHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, void* ReportData, uint16_t ReportSize)\r
+void CALLBACK_USB_HID_ProcessReceivedHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t ReportID,\r
+                                               void* ReportData, uint16_t ReportSize)\r
 {\r
        // Unused (but mandatory for the HID class driver) in this demo, since there are no Host->Device reports\r
 }\r
 {\r
        // Unused (but mandatory for the HID class driver) in this demo, since there are no Host->Device reports\r
 }\r
index 9db357b..4209f4d 100644 (file)
@@ -83,8 +83,8 @@
                void EVENT_USB_ConfigurationChanged(void);\r
                void EVENT_USB_UnhandledControlPacket(void);\r
 \r
                void EVENT_USB_ConfigurationChanged(void);\r
                void EVENT_USB_UnhandledControlPacket(void);\r
 \r
-               uint16_t CALLBACK_USB_HID_CreateNextHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, void* ReportData);\r
-               void     CALLBACK_USB_HID_ProcessReceivedHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo,\r
+               uint16_t CALLBACK_USB_HID_CreateNextHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t* ReportID, void* ReportData);\r
+               void     CALLBACK_USB_HID_ProcessReceivedHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t ReportID, \r
                                                                   void* ReportData, uint16_t ReportSize);\r
 \r
 #endif\r
                                                                   void* ReportData, uint16_t ReportSize);\r
 \r
 #endif\r
index ddd19fc..8914909 100644 (file)
@@ -136,7 +136,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                        .InterfaceNumber        = 0x00,\r
                        .AlternateSetting       = 0x00,\r
                        \r
                        .InterfaceNumber        = 0x00,\r
                        .AlternateSetting       = 0x00,\r
                        \r
-                       .TotalEndpoints         = 2,\r
+                       .TotalEndpoints         = 1,\r
                                \r
                        .Class                  = 0x03,\r
                        .SubClass               = 0x01,\r
                                \r
                        .Class                  = 0x03,\r
                        .SubClass               = 0x01,\r
@@ -165,16 +165,6 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                        .EndpointSize           = KEYBOARD_EPSIZE,\r
                        .PollingIntervalMS      = 0x04\r
                },\r
                        .EndpointSize           = KEYBOARD_EPSIZE,\r
                        .PollingIntervalMS      = 0x04\r
                },\r
-\r
-       .KeyboardLEDsEndpoint = \r
-               {\r
-                       .Header                 = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},\r
-\r
-                       .EndpointAddress        = (ENDPOINT_DESCRIPTOR_DIR_OUT | KEYBOARD_LEDS_EPNUM),\r
-                       .Attributes             = EP_TYPE_INTERRUPT,\r
-                       .EndpointSize           = KEYBOARD_EPSIZE,\r
-                       .PollingIntervalMS      = 0x04\r
-               }\r
 };\r
 \r
 /** Language descriptor structure. This descriptor, located in FLASH memory, is returned when the host requests\r
 };\r
 \r
 /** Language descriptor structure. This descriptor, located in FLASH memory, is returned when the host requests\r
index 0a95ca0..40b358c 100644 (file)
                        USB_Descriptor_Interface_t            Interface;\r
                        USB_Descriptor_HID_t                  KeyboardHID;\r
                USB_Descriptor_Endpoint_t             KeyboardEndpoint;\r
                        USB_Descriptor_Interface_t            Interface;\r
                        USB_Descriptor_HID_t                  KeyboardHID;\r
                USB_Descriptor_Endpoint_t             KeyboardEndpoint;\r
-               USB_Descriptor_Endpoint_t             KeyboardLEDsEndpoint;\r
                } USB_Descriptor_Configuration_t;\r
                                        \r
        /* Macros: */\r
                /** Endpoint number of the Keyboard HID reporting IN endpoint. */\r
                #define KEYBOARD_EPNUM               1\r
                } USB_Descriptor_Configuration_t;\r
                                        \r
        /* Macros: */\r
                /** Endpoint number of the Keyboard HID reporting IN endpoint. */\r
                #define KEYBOARD_EPNUM               1\r
-\r
-               /** Endpoint number of the Keyboard HID reporting OUT endpoint. */\r
-               #define KEYBOARD_LEDS_EPNUM          2\r
                \r
                /** Size in bytes of the Keyboard HID reporting IN and OUT endpoints. */                \r
                #define KEYBOARD_EPSIZE              8\r
                \r
                /** Size in bytes of the Keyboard HID reporting IN and OUT endpoints. */                \r
                #define KEYBOARD_EPSIZE              8\r
index 923dd71..bebad12 100644 (file)
@@ -48,9 +48,6 @@ USB_ClassInfo_HID_t Keyboard_HID_Interface =
         .ReportINEndpointNumber  = KEYBOARD_EPNUM,\r
         .ReportINEndpointSize    = KEYBOARD_EPSIZE,\r
 \r
         .ReportINEndpointNumber  = KEYBOARD_EPNUM,\r
         .ReportINEndpointSize    = KEYBOARD_EPSIZE,\r
 \r
-        .ReportOUTEndpointNumber = KEYBOARD_LEDS_EPNUM,\r
-        .ReportOUTEndpointSize   = KEYBOARD_EPSIZE,\r
-        \r
                .ReportINBufferSize      = sizeof(USB_KeyboardReport_Data_t),\r
 \r
         .IdleCount               = 500,\r
                .ReportINBufferSize      = sizeof(USB_KeyboardReport_Data_t),\r
 \r
         .IdleCount               = 500,\r
@@ -136,7 +133,7 @@ ISR(TIMER0_COMPA_vect, ISR_BLOCK)
  *\r
  *  \return Number of bytes written in the report (or zero if no report is to be sent\r
  */\r
  *\r
  *  \return Number of bytes written in the report (or zero if no report is to be sent\r
  */\r
-uint16_t CALLBACK_USB_HID_CreateNextHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, void* ReportData)\r
+uint16_t CALLBACK_USB_HID_CreateNextHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t* ReportID, void* ReportData)\r
 {\r
     USB_KeyboardReport_Data_t* KeyboardReport = (USB_KeyboardReport_Data_t*)ReportData;\r
     \r
 {\r
     USB_KeyboardReport_Data_t* KeyboardReport = (USB_KeyboardReport_Data_t*)ReportData;\r
     \r
@@ -168,7 +165,8 @@ uint16_t CALLBACK_USB_HID_CreateNextHIDReport(USB_ClassInfo_HID_t* HIDInterfaceI
  *  \param ReportData  Pointer to a buffer where the created report has been stored\r
  *  \param ReportSize  Size in bytes of the received HID report\r
  */\r
  *  \param ReportData  Pointer to a buffer where the created report has been stored\r
  *  \param ReportSize  Size in bytes of the received HID report\r
  */\r
-void CALLBACK_USB_HID_ProcessReceivedHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, void* ReportData, uint16_t ReportSize)\r
+void CALLBACK_USB_HID_ProcessReceivedHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t ReportID,\r
+                                               void* ReportData, uint16_t ReportSize)\r
 {\r
     uint8_t  LEDMask   = LEDS_NO_LEDS;\r
     uint8_t* LEDReport = (uint8_t*)ReportData;\r
 {\r
     uint8_t  LEDMask   = LEDS_NO_LEDS;\r
     uint8_t* LEDReport = (uint8_t*)ReportData;\r
index e04ae9e..1b4bb70 100644 (file)
@@ -86,8 +86,8 @@
                void EVENT_USB_ConfigurationChanged(void);\r
                void EVENT_USB_UnhandledControlPacket(void);\r
 \r
                void EVENT_USB_ConfigurationChanged(void);\r
                void EVENT_USB_UnhandledControlPacket(void);\r
 \r
-               uint16_t CALLBACK_USB_HID_CreateNextHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, void* ReportData);\r
-               void     CALLBACK_USB_HID_ProcessReceivedHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo,\r
+               uint16_t CALLBACK_USB_HID_CreateNextHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t* ReportID, void* ReportData);\r
+               void     CALLBACK_USB_HID_ProcessReceivedHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t ReportID, \r
                                                                   void* ReportData, uint16_t ReportSize);\r
 \r
 #endif\r
                                                                   void* ReportData, uint16_t ReportSize);\r
 \r
 #endif\r
index 145708d..c9a778f 100644 (file)
@@ -169,7 +169,7 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                        .InterfaceNumber        = 0x00,\r
                        .AlternateSetting       = 0x00,\r
                        \r
                        .InterfaceNumber        = 0x00,\r
                        .AlternateSetting       = 0x00,\r
                        \r
-                       .TotalEndpoints         = 2,\r
+                       .TotalEndpoints         = 1,\r
                                \r
                        .Class                  = 0x03,\r
                        .SubClass               = 0x01,\r
                                \r
                        .Class                  = 0x03,\r
                        .SubClass               = 0x01,\r
@@ -199,16 +199,6 @@ USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor =
                        .PollingIntervalMS      = 0x02\r
                },\r
 \r
                        .PollingIntervalMS      = 0x02\r
                },\r
 \r
-       .KeyboardOutEndpoint = \r
-               {\r
-                       .Header                 = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint},\r
-\r
-                       .EndpointAddress        = (ENDPOINT_DESCRIPTOR_DIR_OUT | KEYBOARD_OUT_EPNUM),\r
-                       .Attributes             = EP_TYPE_INTERRUPT,\r
-                       .EndpointSize           = HID_EPSIZE,\r
-                       .PollingIntervalMS      = 0x02\r
-               },\r
-\r
        .MouseInterface = \r
                {\r
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},\r
        .MouseInterface = \r
                {\r
                        .Header                 = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface},\r
index 152e511..1dcad08 100644 (file)
@@ -54,7 +54,6 @@
                        USB_Descriptor_Interface_t            KeyboardInterface;\r
                        USB_Descriptor_HID_t                  KeyboardHID;\r
                USB_Descriptor_Endpoint_t             KeyboardInEndpoint;\r
                        USB_Descriptor_Interface_t            KeyboardInterface;\r
                        USB_Descriptor_HID_t                  KeyboardHID;\r
                USB_Descriptor_Endpoint_t             KeyboardInEndpoint;\r
-               USB_Descriptor_Endpoint_t             KeyboardOutEndpoint;\r
                        USB_Descriptor_Interface_t            MouseInterface;\r
                        USB_Descriptor_HID_t                  MouseHID;\r
                USB_Descriptor_Endpoint_t             MouseInEndpoint;\r
                        USB_Descriptor_Interface_t            MouseInterface;\r
                        USB_Descriptor_HID_t                  MouseHID;\r
                USB_Descriptor_Endpoint_t             MouseInEndpoint;\r
@@ -64,9 +63,6 @@
                /** Endpoint number of the Keyboard HID reporting IN endpoint. */\r
                #define KEYBOARD_IN_EPNUM         1\r
 \r
                /** Endpoint number of the Keyboard HID reporting IN endpoint. */\r
                #define KEYBOARD_IN_EPNUM         1\r
 \r
-               /** Endpoint number of the Keyboard HID reporting OUT endpoint. */\r
-               #define KEYBOARD_OUT_EPNUM        2\r
-\r
                /** Endpoint number of the Mouse HID reporting IN endpoint. */\r
                #define MOUSE_IN_EPNUM            3\r
 \r
                /** Endpoint number of the Mouse HID reporting IN endpoint. */\r
                #define MOUSE_IN_EPNUM            3\r
 \r
index e68a247..5cea555 100644 (file)
@@ -48,9 +48,6 @@ USB_ClassInfo_HID_t Keyboard_HID_Interface =
 \r
                .ReportINEndpointNumber  = KEYBOARD_IN_EPNUM,\r
                .ReportINEndpointSize    = HID_EPSIZE,\r
 \r
                .ReportINEndpointNumber  = KEYBOARD_IN_EPNUM,\r
                .ReportINEndpointSize    = HID_EPSIZE,\r
-\r
-               .ReportOUTEndpointNumber = KEYBOARD_OUT_EPNUM,\r
-               .ReportOUTEndpointSize   = HID_EPSIZE,\r
                \r
                .ReportINBufferSize      = sizeof(USB_KeyboardReport_Data_t),\r
 \r
                \r
                .ReportINBufferSize      = sizeof(USB_KeyboardReport_Data_t),\r
 \r
@@ -70,9 +67,6 @@ USB_ClassInfo_HID_t Mouse_HID_Interface =
                .ReportINEndpointSize    = HID_EPSIZE,\r
 \r
                .ReportINBufferSize      = sizeof(USB_MouseReport_Data_t),\r
                .ReportINEndpointSize    = HID_EPSIZE,\r
 \r
                .ReportINBufferSize      = sizeof(USB_MouseReport_Data_t),\r
-\r
-               .ReportOUTEndpointNumber = 0,\r
-               .ReportOUTEndpointSize   = 0,\r
        };\r
 \r
 /** Main program entry point. This routine contains the overall program flow, including initial\r
        };\r
 \r
 /** Main program entry point. This routine contains the overall program flow, including initial\r
@@ -162,7 +156,7 @@ ISR(TIMER0_COMPA_vect, ISR_BLOCK)
  *\r
  *  \return Number of bytes written in the report (or zero if no report is to be sent\r
  */\r
  *\r
  *  \return Number of bytes written in the report (or zero if no report is to be sent\r
  */\r
-uint16_t CALLBACK_USB_HID_CreateNextHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, void* ReportData)\r
+uint16_t CALLBACK_USB_HID_CreateNextHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t* ReportID, void* ReportData)\r
 {\r
        uint8_t JoyStatus_LCL    = Joystick_GetStatus();\r
        uint8_t ButtonStatus_LCL = Buttons_GetStatus();\r
 {\r
        uint8_t JoyStatus_LCL    = Joystick_GetStatus();\r
        uint8_t ButtonStatus_LCL = Buttons_GetStatus();\r
@@ -221,7 +215,8 @@ uint16_t CALLBACK_USB_HID_CreateNextHIDReport(USB_ClassInfo_HID_t* HIDInterfaceI
  *  \param ReportData  Pointer to a buffer where the created report has been stored\r
  *  \param ReportSize  Size in bytes of the received HID report\r
  */\r
  *  \param ReportData  Pointer to a buffer where the created report has been stored\r
  *  \param ReportSize  Size in bytes of the received HID report\r
  */\r
-void CALLBACK_USB_HID_ProcessReceivedHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, void* ReportData, uint16_t ReportSize)\r
+void CALLBACK_USB_HID_ProcessReceivedHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t ReportID,\r
+                                               void* ReportData, uint16_t ReportSize)\r
 {\r
        if (HIDInterfaceInfo == &Keyboard_HID_Interface)\r
        {\r
 {\r
        if (HIDInterfaceInfo == &Keyboard_HID_Interface)\r
        {\r
index 9afe764..74b1c9e 100644 (file)
@@ -90,8 +90,8 @@
                void EVENT_USB_ConfigurationChanged(void);\r
                void EVENT_USB_UnhandledControlPacket(void);\r
 \r
                void EVENT_USB_ConfigurationChanged(void);\r
                void EVENT_USB_UnhandledControlPacket(void);\r
 \r
-               uint16_t CALLBACK_USB_HID_CreateNextHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, void* ReportData);\r
-               void     CALLBACK_USB_HID_ProcessReceivedHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo,\r
+               uint16_t CALLBACK_USB_HID_CreateNextHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t* ReportID, void* ReportData);\r
+               void     CALLBACK_USB_HID_ProcessReceivedHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t ReportID, \r
                                                                   void* ReportData, uint16_t ReportSize);\r
                \r
 #endif\r
                                                                   void* ReportData, uint16_t ReportSize);\r
                \r
 #endif\r
index 1bc62da..f5bd931 100644 (file)
@@ -130,7 +130,7 @@ ISR(TIMER0_COMPA_vect, ISR_BLOCK)
  *\r
  *  \return Number of bytes written in the report (or zero if no report is to be sent\r
  */\r
  *\r
  *  \return Number of bytes written in the report (or zero if no report is to be sent\r
  */\r
-uint16_t CALLBACK_USB_HID_CreateNextHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, void* ReportData)\r
+uint16_t CALLBACK_USB_HID_CreateNextHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t* ReportID, void* ReportData)\r
 {\r
        USB_MouseReport_Data_t* MouseReport = (USB_MouseReport_Data_t*)ReportData;\r
                \r
 {\r
        USB_MouseReport_Data_t* MouseReport = (USB_MouseReport_Data_t*)ReportData;\r
                \r
@@ -162,7 +162,8 @@ uint16_t CALLBACK_USB_HID_CreateNextHIDReport(USB_ClassInfo_HID_t* HIDInterfaceI
  *  \param ReportData  Pointer to a buffer where the created report has been stored\r
  *  \param ReportSize  Size in bytes of the received HID report\r
  */\r
  *  \param ReportData  Pointer to a buffer where the created report has been stored\r
  *  \param ReportSize  Size in bytes of the received HID report\r
  */\r
-void CALLBACK_USB_HID_ProcessReceivedHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, void* ReportData, uint16_t ReportSize)\r
+void CALLBACK_USB_HID_ProcessReceivedHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t ReportID,\r
+                                               void* ReportData, uint16_t ReportSize)\r
 {\r
        // Unused (but mandatory for the HID class driver) in this demo, since there are no Host->Device reports\r
 }\r
 {\r
        // Unused (but mandatory for the HID class driver) in this demo, since there are no Host->Device reports\r
 }\r
index 62d6d83..6de20ee 100644 (file)
@@ -85,8 +85,8 @@
                void EVENT_USB_ConfigurationChanged(void);\r
                void EVENT_USB_UnhandledControlPacket(void);\r
 \r
                void EVENT_USB_ConfigurationChanged(void);\r
                void EVENT_USB_UnhandledControlPacket(void);\r
 \r
-               uint16_t CALLBACK_USB_HID_CreateNextHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, void* ReportData);\r
-               void     CALLBACK_USB_HID_ProcessReceivedHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo,\r
+               uint16_t CALLBACK_USB_HID_CreateNextHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t* ReportID, void* ReportData);\r
+               void     CALLBACK_USB_HID_ProcessReceivedHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t ReportID, \r
                                                                   void* ReportData, uint16_t ReportSize);\r
 \r
 #endif\r
                                                                   void* ReportData, uint16_t ReportSize);\r
 \r
 #endif\r
index d27b0d2..dface2a 100644 (file)
@@ -169,7 +169,7 @@ uint8_t USB_CDC_ReceiveByte(USB_ClassInfo_CDC_t* CDCInterfaceInfo)
        return DataByte;\r
 }\r
 \r
        return DataByte;\r
 }\r
 \r
-void USB_CDC_SendSerialLineStateChanged(USB_ClassInfo_CDC_t* CDCInterfaceInfo, uint16_t LineStateMask)\r
+void USB_CDC_SendSerialLineStateChange(USB_ClassInfo_CDC_t* CDCInterfaceInfo, uint16_t LineStateMask)\r
 {\r
        Endpoint_SelectEndpoint(CDCInterfaceInfo->NotificationEndpointNumber);\r
        \r
 {\r
        Endpoint_SelectEndpoint(CDCInterfaceInfo->NotificationEndpointNumber);\r
        \r
index 3e67b1b..ee9e376 100644 (file)
                        uint8_t  NotificationEndpointNumber; /**< Endpoint number of the CDC interface's IN notification endpoint, if used */\r
                        uint16_t NotificationEndpointSize;  /**< Size in bytes of the CDC interface's IN notification endpoint, if used */\r
 \r
                        uint8_t  NotificationEndpointNumber; /**< Endpoint number of the CDC interface's IN notification endpoint, if used */\r
                        uint16_t NotificationEndpointSize;  /**< Size in bytes of the CDC interface's IN notification endpoint, if used */\r
 \r
-                       uint8_t  ControlLineState; /**< Current control line state, as set by the host */\r
+                       uint8_t  ControlLineState; /**< Current control line states, as set by the host */\r
 \r
                        struct\r
                        {\r
 \r
                        struct\r
                        {\r
                 *  \ref EVENT_USB_ConfigurationChanged() event so that the endpoints are configured when the configuration containing the\r
                 *  given CDC interface is selected.\r
                 *\r
                 *  \ref EVENT_USB_ConfigurationChanged() event so that the endpoints are configured when the configuration containing the\r
                 *  given CDC interface is selected.\r
                 *\r
-                *  \param CDCInterfaceInfo  Pointer to a structure containing an CDC Class configuration and state.\r
+                *  \param CDCInterfaceInfo  Pointer to a structure containing a CDC Class configuration and state.\r
                 *\r
                 *  \return Boolean true if the endpoints were sucessfully configured, false otherwise\r
                 */\r
                 *\r
                 *  \return Boolean true if the endpoints were sucessfully configured, false otherwise\r
                 */\r
                /** Processes incomming control requests from the host, that are directed to the given CDC class interface. This should be\r
                 *  linked to the library \ref EVENT_USB_UnhandledControlPacket() event.\r
                 *\r
                /** Processes incomming control requests from the host, that are directed to the given CDC class interface. This should be\r
                 *  linked to the library \ref EVENT_USB_UnhandledControlPacket() event.\r
                 *\r
-                *  \param CDCInterfaceInfo  Pointer to a structure containing an CDC Class configuration and state.\r
+                *  \param CDCInterfaceInfo  Pointer to a structure containing a CDC Class configuration and state.\r
                 */\r
                void USB_CDC_ProcessControlPacket(USB_ClassInfo_CDC_t* CDCInterfaceInfo);\r
 \r
                /** General management task for a given CDC class interface, required for the correct operation of the interface. This should\r
                 *  be called frequently in the main program loop, before the master USB management task \ref USB_USBTask().\r
                 *\r
                 */\r
                void USB_CDC_ProcessControlPacket(USB_ClassInfo_CDC_t* CDCInterfaceInfo);\r
 \r
                /** General management task for a given CDC class interface, required for the correct operation of the interface. This should\r
                 *  be called frequently in the main program loop, before the master USB management task \ref USB_USBTask().\r
                 *\r
-                *  \param CDCInterfaceInfo  Pointer to a structure containing an CDC Class configuration and state.\r
+                *  \param CDCInterfaceInfo  Pointer to a structure containing a CDC Class configuration and state.\r
                 */\r
                void USB_CDC_USBTask(USB_ClassInfo_CDC_t* CDCInterfaceInfo);\r
 \r
                 */\r
                void USB_CDC_USBTask(USB_ClassInfo_CDC_t* CDCInterfaceInfo);\r
 \r
-               void     EVENT_USB_CDC_LineEncodingChanged(USB_ClassInfo_CDC_t* CDCInterfaceInfo);\r
-               void     EVENT_USB_CDC_ControLineStateChanged(USB_ClassInfo_CDC_t* CDCInterfaceInfo);\r
+               /** CDC class driver event for a line encoding change on a CDC interface. This event fires each time the host requests a\r
+                *  line encoding change (containing the serial parity, baud and other configuration information) and may be hooked in the\r
+                *  user program by declaring a handler function with the same name and parameters listed here. The new line encoding\r
+                *  settings are available in the LineEncoding structure inside the CDC interface structure passed as a parameter.\r
+                *\r
+                *  \param CDCInterfaceInfo  Pointer to a structure containing a CDC Class configuration and state.\r
+                */\r
+               void EVENT_USB_CDC_LineEncodingChanged(USB_ClassInfo_CDC_t* CDCInterfaceInfo);\r
+               \r
+               /** CDC class driver event for a control line state change on a CDC interface. This event fires each time the host requests a\r
+                *  control line state change (containing the virtual serial control line states, such as DTR) and may be hooked in the\r
+                *  user program by declaring a handler function with the same name and parameters listed here. The new control line states\r
+                *  are available in the ControlLineState value inside the CDC interface structure passed as a parameter, set as a mask of\r
+                *  CDC_CONTROL_LINE_OUT_* masks.\r
+                *\r
+                *  \param CDCInterfaceInfo  Pointer to a structure containing a CDC Class configuration and state.\r
+                */             \r
+               void EVENT_USB_CDC_ControLineStateChanged(USB_ClassInfo_CDC_t* CDCInterfaceInfo);\r
 \r
                void     USB_CDC_SendString(USB_ClassInfo_CDC_t* CDCInterfaceInfo, char* Data, uint16_t Length);\r
                void     USB_CDC_SendByte(USB_ClassInfo_CDC_t* CDCInterfaceInfo, uint8_t Data);\r
                uint16_t USB_CDC_BytesReceived(USB_ClassInfo_CDC_t* CDCInterfaceInfo);\r
                uint8_t  USB_CDC_ReceiveByte(USB_ClassInfo_CDC_t* CDCInterfaceInfo);\r
 \r
                void     USB_CDC_SendString(USB_ClassInfo_CDC_t* CDCInterfaceInfo, char* Data, uint16_t Length);\r
                void     USB_CDC_SendByte(USB_ClassInfo_CDC_t* CDCInterfaceInfo, uint8_t Data);\r
                uint16_t USB_CDC_BytesReceived(USB_ClassInfo_CDC_t* CDCInterfaceInfo);\r
                uint8_t  USB_CDC_ReceiveByte(USB_ClassInfo_CDC_t* CDCInterfaceInfo);\r
-               void USB_CDC_SendSerialLineStateChanged(USB_ClassInfo_CDC_t* CDCInterfaceInfo, uint16_t LineStateMask);\r
+               void     USB_CDC_SendSerialLineStateChange(USB_ClassInfo_CDC_t* CDCInterfaceInfo, uint16_t LineStateMask);\r
 \r
        /* Disable C linkage for C++ Compilers: */\r
                #if defined(__cplusplus)\r
 \r
        /* Disable C linkage for C++ Compilers: */\r
                #if defined(__cplusplus)\r
index 5f8ccfb..0699218 100644 (file)
@@ -47,10 +47,11 @@ void USB_HID_ProcessControlPacket(USB_ClassInfo_HID_t* HIDInterfaceInfo)
 \r
                                uint8_t  ReportINData[HIDInterfaceInfo->ReportINBufferSize];\r
                                uint16_t ReportINSize;\r
 \r
                                uint8_t  ReportINData[HIDInterfaceInfo->ReportINBufferSize];\r
                                uint16_t ReportINSize;\r
+                               uint8_t  ReportID = (USB_ControlRequest.wValue & 0xFF);\r
 \r
                                memset(ReportINData, 0, sizeof(ReportINData));\r
 \r
                                memset(ReportINData, 0, sizeof(ReportINData));\r
-\r
-                               ReportINSize = CALLBACK_USB_HID_CreateNextHIDReport(HIDInterfaceInfo, ReportINData);\r
+                               \r
+                               ReportINSize = CALLBACK_USB_HID_CreateNextHIDReport(HIDInterfaceInfo, &ReportID, ReportINData);\r
 \r
                                Endpoint_Write_Control_Stream_LE(ReportINData, ReportINSize);\r
                                Endpoint_ClearOUT();\r
 \r
                                Endpoint_Write_Control_Stream_LE(ReportINData, ReportINSize);\r
                                Endpoint_ClearOUT();\r
@@ -64,11 +65,12 @@ void USB_HID_ProcessControlPacket(USB_ClassInfo_HID_t* HIDInterfaceInfo)
                                \r
                                uint16_t ReportOUTSize = USB_ControlRequest.wLength;\r
                                uint8_t  ReportOUTData[ReportOUTSize];\r
                                \r
                                uint16_t ReportOUTSize = USB_ControlRequest.wLength;\r
                                uint8_t  ReportOUTData[ReportOUTSize];\r
+                               uint8_t  ReportID = (USB_ControlRequest.wValue & 0xFF);\r
 \r
                                Endpoint_Read_Control_Stream_LE(ReportOUTData, ReportOUTSize);\r
                                Endpoint_ClearIN();\r
                                \r
 \r
                                Endpoint_Read_Control_Stream_LE(ReportOUTData, ReportOUTSize);\r
                                Endpoint_ClearIN();\r
                                \r
-                               CALLBACK_USB_HID_ProcessReceivedHIDReport(HIDInterfaceInfo, ReportOUTData, ReportOUTSize);\r
+                               CALLBACK_USB_HID_ProcessReceivedHIDReport(HIDInterfaceInfo, ReportID, ReportOUTData, ReportOUTSize);\r
                        }\r
                        \r
                        break;\r
                        }\r
                        \r
                        break;\r
@@ -135,15 +137,6 @@ bool USB_HID_ConfigureEndpoints(USB_ClassInfo_HID_t* HIDInterfaceInfo)
                return false;\r
        }\r
        \r
                return false;\r
        }\r
        \r
-       if (HIDInterfaceInfo->ReportOUTEndpointNumber)\r
-       {\r
-               if (!(Endpoint_ConfigureEndpoint(HIDInterfaceInfo->ReportOUTEndpointNumber, EP_TYPE_INTERRUPT,\r
-                                                                                ENDPOINT_DIR_OUT, HIDInterfaceInfo->ReportOUTEndpointSize, ENDPOINT_BANK_SINGLE)))\r
-               {\r
-                       return false;\r
-               }\r
-       }\r
-       \r
        return true;\r
 }\r
                \r
        return true;\r
 }\r
                \r
@@ -162,32 +155,20 @@ void USB_HID_USBTask(USB_ClassInfo_HID_t* HIDInterfaceInfo)
 \r
                uint8_t  ReportINData[HIDInterfaceInfo->ReportINBufferSize];\r
                uint16_t ReportINSize;\r
 \r
                uint8_t  ReportINData[HIDInterfaceInfo->ReportINBufferSize];\r
                uint16_t ReportINSize;\r
+               uint8_t  ReportID = 0;\r
 \r
                memset(ReportINData, 0, sizeof(ReportINData));\r
 \r
 \r
                memset(ReportINData, 0, sizeof(ReportINData));\r
 \r
-               ReportINSize = CALLBACK_USB_HID_CreateNextHIDReport(HIDInterfaceInfo, ReportINData);\r
+               ReportINSize = CALLBACK_USB_HID_CreateNextHIDReport(HIDInterfaceInfo, &ReportID, ReportINData);\r
 \r
                if (ReportINSize)\r
 \r
                if (ReportINSize)\r
-                 Endpoint_Write_Stream_LE(ReportINData, ReportINSize, NO_STREAM_CALLBACK);\r
-               \r
-               Endpoint_ClearIN();\r
-       }\r
-       \r
-       if (HIDInterfaceInfo->ReportOUTEndpointNumber)\r
-       {\r
-               Endpoint_SelectEndpoint(HIDInterfaceInfo->ReportOUTEndpointNumber);\r
-               \r
-               if (Endpoint_IsOUTReceived())\r
                {\r
                {\r
-                       uint16_t ReportOUTSize = Endpoint_BytesInEndpoint();\r
-                       uint8_t  ReportOUTData[ReportOUTSize];\r
-                       \r
-                       if (ReportOUTSize)\r
-                         Endpoint_Read_Stream_LE(ReportOUTData, ReportOUTSize, NO_STREAM_CALLBACK);\r
-                         \r
-                       CALLBACK_USB_HID_ProcessReceivedHIDReport(HIDInterfaceInfo, ReportOUTData, ReportOUTSize);\r
-                       \r
-                       Endpoint_ClearOUT();\r
+                       if (ReportID)\r
+                         Endpoint_Write_Stream_LE(&ReportID, sizeof(ReportID), NO_STREAM_CALLBACK);\r
+\r
+                       Endpoint_Write_Stream_LE(ReportINData, ReportINSize, NO_STREAM_CALLBACK);\r
                }\r
                }\r
+               \r
+               Endpoint_ClearIN();\r
        }\r
 }\r
        }\r
 }\r
index 9a56304..4fd6f2c 100644 (file)
 \r
                        uint8_t  ReportINEndpointNumber; /**< Endpoint number of the HID interface's IN report endpoint */\r
                        uint16_t ReportINEndpointSize; /**< Size in bytes of the HID interface's IN report endpoint */\r
 \r
                        uint8_t  ReportINEndpointNumber; /**< Endpoint number of the HID interface's IN report endpoint */\r
                        uint16_t ReportINEndpointSize; /**< Size in bytes of the HID interface's IN report endpoint */\r
-\r
-                       uint8_t  ReportOUTEndpointNumber; /**< Endpoint number of the HID interface's OUT report endpoint, if used */\r
-                       uint16_t ReportOUTEndpointSize;  /**< Size in bytes of the HID interface's OUT report endpoint, if used */\r
                        \r
                        uint8_t  ReportINBufferSize;\r
 \r
                        \r
                        uint8_t  ReportINBufferSize;\r
 \r
                void USB_HID_ProcessControlPacket(USB_ClassInfo_HID_t* HIDInterfaceInfo);\r
                void USB_HID_USBTask(USB_ClassInfo_HID_t* HIDInterfaceInfo);\r
                \r
                void USB_HID_ProcessControlPacket(USB_ClassInfo_HID_t* HIDInterfaceInfo);\r
                void USB_HID_USBTask(USB_ClassInfo_HID_t* HIDInterfaceInfo);\r
                \r
-               uint16_t CALLBACK_USB_HID_CreateNextHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, void* ReportData);\r
-               void     CALLBACK_USB_HID_ProcessReceivedHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, void* ReportData, uint16_t ReportSize);\r
+               /** HID class driver callback for the user creation of a HID input report. This callback may fire in response to either\r
+                *  HID class control requests from the host, or by the normal HID endpoint polling procedure. Inside this callback the\r
+                *  user is responsible for the creation of the next HID input report to be sent to the host.\r
+                *\r
+                *  \param HIDInterfaceInfo  Pointer to a structure containing a HID Class configuration and state.\r
+                *  \param ReportID  If preset to a non-zero value, this is the report ID being requested by the host. If zero, this should\r
+                *                   be set to the report ID of the generated HID input report. If multiple reports are not sent via the\r
+                *                   given HID interface, this parameter should be ignored.\r
+                *  \param ReportData  Pointer to a buffer where the generated HID report should be stored.\r
+                *\r
+                *  \return  Number of bytes in the generated input report, or zero if no report is to be sent\r
+                */\r
+               uint16_t CALLBACK_USB_HID_CreateNextHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t* ReportID, void* ReportData);\r
+\r
+               /** HID class driver callback for the user processing of a received HID input report. This callback may fire in response to\r
+                *  either HID class control requests from the host, or by the normal HID endpoint polling procedure. Inside this callback\r
+                *  the user is responsible for the processing of the received HID output report from the host.\r
+                *\r
+                *  \param HIDInterfaceInfo  Pointer to a structure containing a HID Class configuration and state.\r
+                *  \param ReportID  Report ID of the received output report. If multiple reports are not received via the given HID\r
+                *                   interface, this parameter should be ignored.\r
+                *  \param ReportData  Pointer to a buffer where the received HID report is stored.\r
+                */\r
+               void     CALLBACK_USB_HID_ProcessReceivedHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t ReportID, void* ReportData, uint16_t ReportSize);\r
 \r
        /* Disable C linkage for C++ Compilers: */\r
                #if defined(__cplusplus)\r
 \r
        /* Disable C linkage for C++ Compilers: */\r
                #if defined(__cplusplus)\r
index b2294d8..08a530a 100644 (file)
@@ -76,7 +76,7 @@
                /** MIDI command for a note off (deactivation) event */\r
                #define MIDI_COMMAND_NOTE_OFF       0x08\r
 \r
                /** MIDI command for a note off (deactivation) event */\r
                #define MIDI_COMMAND_NOTE_OFF       0x08\r
 \r
-               /** Standard key press velocity value used for all note events, as no pressure sensor is mounted */\r
+               /** Standard key press velocity value used for all note events */\r
                #define MIDI_STANDARD_VELOCITY      64\r
                \r
                /** Convenience macro. MIDI channels are numbered from 1-10 (natural numbers) however the logical channel\r
                #define MIDI_STANDARD_VELOCITY      64\r
                \r
                /** Convenience macro. MIDI channels are numbered from 1-10 (natural numbers) however the logical channel\r
index e32397c..6e5e00b 100644 (file)
@@ -157,7 +157,7 @@ ISR(TIMER0_COMPA_vect, ISR_BLOCK)
  *\r
  *  \return Number of bytes in the created report\r
  */\r
  *\r
  *  \return Number of bytes in the created report\r
  */\r
-uint16_t CALLBACK_USB_HID_CreateNextHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, void* ReportData)\r
+uint16_t CALLBACK_USB_HID_CreateNextHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t* ReportID, void* ReportData)\r
 {\r
        static bool IsKeyReleaseReport;\r
        static bool IsNewlineReport;\r
 {\r
        static bool IsKeyReleaseReport;\r
        static bool IsNewlineReport;\r
@@ -204,7 +204,8 @@ uint16_t CALLBACK_USB_HID_CreateNextHIDReport(USB_ClassInfo_HID_t* HIDInterfaceI
  *  \param ReportData  Pointer to the report buffer where the received report is stored\r
  *  \param ReportSize  Size in bytes of the report received from the host\r
  */\r
  *  \param ReportData  Pointer to the report buffer where the received report is stored\r
  *  \param ReportSize  Size in bytes of the report received from the host\r
  */\r
-void CALLBACK_USB_HID_ProcessReceivedHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, void* ReportData, uint16_t ReportSize)\r
+void CALLBACK_USB_HID_ProcessReceivedHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t ReportID,\r
+                                               void* ReportData, uint16_t ReportSize)\r
 {\r
        // Unused (but mandatory for the HID class driver) in this demo, since there are no Host->Device reports\r
 }\r
 {\r
        // Unused (but mandatory for the HID class driver) in this demo, since there are no Host->Device reports\r
 }\r
index 2b8aa37..6a13af4 100644 (file)
@@ -79,8 +79,8 @@
                void EVENT_USB_ConfigurationChanged(void);\r
                void EVENT_USB_UnhandledControlPacket(void);\r
 \r
                void EVENT_USB_ConfigurationChanged(void);\r
                void EVENT_USB_UnhandledControlPacket(void);\r
 \r
-               uint16_t CALLBACK_USB_HID_CreateNextHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, void* ReportData);\r
-               void     CALLBACK_USB_HID_ProcessReceivedHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo,\r
-                                                                  void* ReportData, uint16_t ReportSize);\r
+               uint16_t CALLBACK_USB_HID_CreateNextHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t* ReportID, void* ReportData);\r
+               void CALLBACK_USB_HID_ProcessReceivedHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t ReportID,\r
+                                                       void* ReportData, uint16_t ReportSize);\r
                \r
 #endif\r
                \r
 #endif\r