+\r
+/** HID class driver callback function for the creation of HID reports to the host.\r
+ *\r
+ * \param[in] HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced\r
+ * \param[in,out] ReportID Report ID requested by the host if non-zero, otherwise callback should set to the generated report ID\r
+ * \param[in] ReportType Type of the report to create, either REPORT_ITEM_TYPE_In or REPORT_ITEM_TYPE_Feature\r
+ * \param[out] ReportData Pointer to a buffer where the created report should be stored\r
+ * \param[out] ReportSize Number of bytes written in the report (or zero if no report is to be sent\r
+ *\r
+ * \return Boolean true to force the sending of the report, false to let the library determine if it needs to be sent\r
+ */\r
+bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, uint8_t* const ReportID,\r
+ const uint8_t ReportType, void* ReportData, uint16_t* ReportSize)\r
+{\r
+ Device_Report_t* ReportParams = (Device_Report_t*)ReportData;\r
+\r
+ DS1307_GetDate(&ReportParams->Day, &ReportParams->Month, &ReportParams->Year);\r
+ DS1307_GetTime(&ReportParams->Hour, &ReportParams->Minute, &ReportParams->Second);\r
+ \r
+ ReportParams->LogInterval500MS = LoggingInterval500MS_SRAM;\r
+\r
+ *ReportSize = sizeof(Device_Report_t);\r
+ return true;\r
+}\r
+\r
+/** HID class driver callback function for the processing of HID reports from the host.\r
+ *\r
+ * \param[in] HIDInterfaceInfo Pointer to the HID class interface configuration structure being referenced\r
+ * \param[in] ReportID Report ID of the received report from the host\r
+ * \param[in] ReportData Pointer to a buffer where the created report has been stored\r
+ * \param[in] ReportSize Size in bytes of the received HID report\r
+ */\r
+void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, const uint8_t ReportID,\r
+ const void* ReportData, const uint16_t ReportSize)\r
+{\r
+ Device_Report_t* ReportParams = (Device_Report_t*)ReportData;\r
+ \r
+ GPIOR0 = ReportParams->Day;\r
+ GPIOR1 = ReportParams->Month;\r
+ GPIOR2 = ReportParams->Year;\r
+ \r
+ DS1307_SetDate(ReportParams->Day, ReportParams->Month, ReportParams->Year);\r
+ DS1307_SetTime(ReportParams->Hour, ReportParams->Minute, ReportParams->Second);\r
+ \r
+ /* If the logging interval has changed from its current value, write it to EEPROM */\r
+ if (LoggingInterval500MS_SRAM != ReportParams->LogInterval500MS)\r
+ {\r
+ LoggingInterval500MS_SRAM = ReportParams->LogInterval500MS;\r
+ eeprom_write_byte(&LoggingInterval500MS_EEPROM, LoggingInterval500MS_SRAM);\r
+ }\r
+}\r