Break device mode class driver interfaces into seperate config and state structs...
[pub/USBasp.git] / Projects / Magstripe / Magstripe.c
index 6e5e00b..4e26d9b 100644 (file)
@@ -46,7 +46,7 @@ BitBuffer_t TrackDataBuffers[3];
  *  passed to all HID Class driver functions, so that multiple instances of the same class\r
  *  within a device can be differentiated from one another.\r
  */\r
  *  passed to all HID Class driver functions, so that multiple instances of the same class\r
  *  within a device can be differentiated from one another.\r
  */\r
-USB_ClassInfo_HID_t Keyboard_HID_Interface =\r
+USB_ClassInfo_HID_Device_t Keyboard_HID_Interface =\r
        {\r
                .InterfaceNumber         = 0,\r
 \r
        {\r
                .InterfaceNumber         = 0,\r
 \r
@@ -153,11 +153,12 @@ ISR(TIMER0_COMPA_vect, ISR_BLOCK)
 /** HID Class driver callback function for the creation of a HID report for the host.\r
  *\r
  *  \param HIDInterfaceInfo  Pointer to the HID interface structure for the HID interface being referenced\r
 /** HID Class driver callback function for the creation of a HID report for the host.\r
  *\r
  *  \param HIDInterfaceInfo  Pointer to the HID interface structure for the HID interface being referenced\r
+ *  \param ReportID  Report ID requested by the host if non-zero, otherwise callback should set to the generated report ID\r
  *  \param ReportData  Pointer to the preallocated report buffer where the created report should be stored\r
  *\r
  *  \return Number of bytes in the created report\r
  */\r
  *  \param ReportData  Pointer to the preallocated report buffer where the created report should be stored\r
  *\r
  *  \return Number of bytes in the created report\r
  */\r
-uint16_t CALLBACK_USB_HID_CreateNextHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t* ReportID, void* ReportData)\r
+uint16_t CALLBACK_USB_HID_CreateNextHIDReport(USB_ClassInfo_HID_Device_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
@@ -201,10 +202,11 @@ uint16_t CALLBACK_USB_HID_CreateNextHIDReport(USB_ClassInfo_HID_t* HIDInterfaceI
 /** HID Class driver callback function for the processing of a received HID report from the host.\r
  *\r
  *  \param HIDInterfaceInfo  Pointer to the HID interface structure for the HID interface being referenced\r
 /** HID Class driver callback function for the processing of a received HID report from the host.\r
  *\r
  *  \param HIDInterfaceInfo  Pointer to the HID interface structure for the HID interface being referenced\r
+ *  \param ReportID  Report ID of the received report from the host\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
  *  \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, uint8_t ReportID,\r
+void CALLBACK_USB_HID_ProcessReceivedHIDReport(USB_ClassInfo_HID_Device_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
                                                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