Commit 9798440c authored by Dean Camera's avatar Dean Camera
Browse files

Changed to new device mode Class Driver function name prefixes to make way for...

Changed to new device mode Class Driver function name prefixes to make way for similar host mode Class drivers.
parent b2330934
...@@ -62,7 +62,7 @@ int main(void) ...@@ -62,7 +62,7 @@ int main(void)
if (Microphone_Audio_Interface.InterfaceEnabled) if (Microphone_Audio_Interface.InterfaceEnabled)
ProcessNextSample(); ProcessNextSample();
USB_Audio_USBTask(&Microphone_Audio_Interface); Audio_Device_USBTask(&Microphone_Audio_Interface);
USB_USBTask(); USB_USBTask();
} }
} }
...@@ -92,7 +92,7 @@ void SetupHardware(void) ...@@ -92,7 +92,7 @@ void SetupHardware(void)
*/ */
void ProcessNextSample(void) void ProcessNextSample(void)
{ {
if ((TIFR0 & (1 << OCF0A)) && USB_Audio_IsReadyForNextSample(&Microphone_Audio_Interface)) if ((TIFR0 & (1 << OCF0A)) && Audio_Device_IsReadyForNextSample(&Microphone_Audio_Interface))
{ {
TIFR0 |= (1 << OCF0A); TIFR0 |= (1 << OCF0A);
...@@ -104,7 +104,7 @@ void ProcessNextSample(void) ...@@ -104,7 +104,7 @@ void ProcessNextSample(void)
AudioSample -= (SAMPLE_MAX_RANGE / 2)); AudioSample -= (SAMPLE_MAX_RANGE / 2));
#endif #endif
USB_Audio_WriteSample16(AudioSample); Audio_Device_WriteSample16(AudioSample);
} }
} }
...@@ -133,12 +133,12 @@ void EVENT_USB_ConfigurationChanged(void) ...@@ -133,12 +133,12 @@ void EVENT_USB_ConfigurationChanged(void)
{ {
LEDs_SetAllLEDs(LEDMASK_USB_READY); LEDs_SetAllLEDs(LEDMASK_USB_READY);
if (!(USB_Audio_ConfigureEndpoints(&Microphone_Audio_Interface))) if (!(Audio_Device_ConfigureEndpoints(&Microphone_Audio_Interface)))
LEDs_SetAllLEDs(LEDMASK_USB_ERROR); LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
} }
/** Event handler for the library USB Unhandled Control Packet event. */ /** Event handler for the library USB Unhandled Control Packet event. */
void EVENT_USB_UnhandledControlPacket(void) void EVENT_USB_UnhandledControlPacket(void)
{ {
USB_Audio_ProcessControlPacket(&Microphone_Audio_Interface); Audio_Device_ProcessControlPacket(&Microphone_Audio_Interface);
} }
...@@ -62,7 +62,7 @@ int main(void) ...@@ -62,7 +62,7 @@ int main(void)
if (Speaker_Audio_Interface.InterfaceEnabled) if (Speaker_Audio_Interface.InterfaceEnabled)
ProcessNextSample(); ProcessNextSample();
USB_Audio_USBTask(&Speaker_Audio_Interface); Audio_Device_USBTask(&Speaker_Audio_Interface);
USB_USBTask(); USB_USBTask();
} }
} }
...@@ -87,14 +87,14 @@ void SetupHardware(void) ...@@ -87,14 +87,14 @@ void SetupHardware(void)
*/ */
void ProcessNextSample(void) void ProcessNextSample(void)
{ {
if ((TIFR0 & (1 << OCF0A)) && USB_Audio_IsSampleReceived(&Speaker_Audio_Interface)) if ((TIFR0 & (1 << OCF0A)) && Audio_Device_IsSampleReceived(&Speaker_Audio_Interface))
{ {
/* Clear the sample reload timer */ /* Clear the sample reload timer */
TIFR0 |= (1 << OCF0A); TIFR0 |= (1 << OCF0A);
/* Retrieve the signed 16-bit left and right audio samples */ /* Retrieve the signed 16-bit left and right audio samples */
int16_t LeftSample_16Bit = (int16_t)USB_Audio_ReadSample16(); int16_t LeftSample_16Bit = (int16_t)Audio_Device_ReadSample16();
int16_t RightSample_16Bit = (int16_t)USB_Audio_ReadSample16(); int16_t RightSample_16Bit = (int16_t)Audio_Device_ReadSample16();
/* Massage signed 16-bit left and right audio samples into signed 8-bit */ /* Massage signed 16-bit left and right audio samples into signed 8-bit */
int8_t LeftSample_8Bit = (LeftSample_16Bit >> 8); int8_t LeftSample_8Bit = (LeftSample_16Bit >> 8);
...@@ -195,12 +195,12 @@ void EVENT_USB_ConfigurationChanged(void) ...@@ -195,12 +195,12 @@ void EVENT_USB_ConfigurationChanged(void)
{ {
LEDs_SetAllLEDs(LEDMASK_USB_READY); LEDs_SetAllLEDs(LEDMASK_USB_READY);
if (!(USB_Audio_ConfigureEndpoints(&Speaker_Audio_Interface))) if (!(Audio_Device_ConfigureEndpoints(&Speaker_Audio_Interface)))
LEDs_SetAllLEDs(LEDMASK_USB_ERROR); LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
} }
/** Event handler for the library USB Unhandled Control Packet event. */ /** Event handler for the library USB Unhandled Control Packet event. */
void EVENT_USB_UnhandledControlPacket(void) void EVENT_USB_UnhandledControlPacket(void)
{ {
USB_Audio_ProcessControlPacket(&Speaker_Audio_Interface); Audio_Device_ProcessControlPacket(&Speaker_Audio_Interface);
} }
...@@ -67,11 +67,11 @@ int main(void) ...@@ -67,11 +67,11 @@ int main(void)
{ {
CheckJoystickMovement(); CheckJoystickMovement();
uint16_t BytesToDiscard = USB_CDC_BytesReceived(&VirtualSerial_CDC_Interface); uint16_t BytesToDiscard = CDC_Device_BytesReceived(&VirtualSerial_CDC_Interface);
while (BytesToDiscard--) while (BytesToDiscard--)
USB_CDC_ReceiveByte(&VirtualSerial_CDC_Interface); CDC_Device_ReceiveByte(&VirtualSerial_CDC_Interface);
USB_CDC_USBTask(&VirtualSerial_CDC_Interface); CDC_Device_USBTask(&VirtualSerial_CDC_Interface);
USB_USBTask(); USB_USBTask();
} }
} }
...@@ -125,7 +125,7 @@ void CheckJoystickMovement(void) ...@@ -125,7 +125,7 @@ void CheckJoystickMovement(void)
{ {
ActionSent = true; ActionSent = true;
USB_CDC_SendString(&VirtualSerial_CDC_Interface, ReportString, strlen(ReportString)); CDC_Device_SendString(&VirtualSerial_CDC_Interface, ReportString, strlen(ReportString));
} }
} }
...@@ -146,12 +146,12 @@ void EVENT_USB_ConfigurationChanged(void) ...@@ -146,12 +146,12 @@ void EVENT_USB_ConfigurationChanged(void)
{ {
LEDs_SetAllLEDs(LEDMASK_USB_READY); LEDs_SetAllLEDs(LEDMASK_USB_READY);
if (!(USB_CDC_ConfigureEndpoints(&VirtualSerial_CDC_Interface))) if (!(CDC_Device_ConfigureEndpoints(&VirtualSerial_CDC_Interface)))
LEDs_SetAllLEDs(LEDMASK_USB_ERROR); LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
} }
/** Event handler for the library USB Unhandled Control Packet event. */ /** Event handler for the library USB Unhandled Control Packet event. */
void EVENT_USB_UnhandledControlPacket(void) void EVENT_USB_UnhandledControlPacket(void)
{ {
USB_CDC_ProcessControlPacket(&VirtualSerial_CDC_Interface); CDC_Device_ProcessControlPacket(&VirtualSerial_CDC_Interface);
} }
...@@ -88,17 +88,17 @@ int main(void) ...@@ -88,17 +88,17 @@ int main(void)
CheckJoystickMovement(); CheckJoystickMovement();
/* Discard all received data on the first CDC interface */ /* Discard all received data on the first CDC interface */
uint16_t BytesToDiscard = USB_CDC_BytesReceived(&VirtualSerial1_CDC_Interface); uint16_t BytesToDiscard = CDC_Device_BytesReceived(&VirtualSerial1_CDC_Interface);
while (BytesToDiscard--) while (BytesToDiscard--)
USB_CDC_ReceiveByte(&VirtualSerial1_CDC_Interface); CDC_Device_ReceiveByte(&VirtualSerial1_CDC_Interface);
/* Echo all received data on the second CDC interface */ /* Echo all received data on the second CDC interface */
uint16_t BytesToEcho = USB_CDC_BytesReceived(&VirtualSerial2_CDC_Interface); uint16_t BytesToEcho = CDC_Device_BytesReceived(&VirtualSerial2_CDC_Interface);
while (BytesToEcho--) while (BytesToEcho--)
USB_CDC_SendByte(&VirtualSerial2_CDC_Interface, USB_CDC_ReceiveByte(&VirtualSerial2_CDC_Interface)); CDC_Device_SendByte(&VirtualSerial2_CDC_Interface, CDC_Device_ReceiveByte(&VirtualSerial2_CDC_Interface));
USB_CDC_USBTask(&VirtualSerial1_CDC_Interface); CDC_Device_USBTask(&VirtualSerial1_CDC_Interface);
USB_CDC_USBTask(&VirtualSerial2_CDC_Interface); CDC_Device_USBTask(&VirtualSerial2_CDC_Interface);
USB_USBTask(); USB_USBTask();
} }
} }
...@@ -154,7 +154,7 @@ void CheckJoystickMovement(void) ...@@ -154,7 +154,7 @@ void CheckJoystickMovement(void)
{ {
ActionSent = true; ActionSent = true;
USB_CDC_SendString(&VirtualSerial1_CDC_Interface, ReportString, strlen(ReportString)); CDC_Device_SendString(&VirtualSerial1_CDC_Interface, ReportString, strlen(ReportString));
} }
} }
...@@ -175,16 +175,16 @@ void EVENT_USB_ConfigurationChanged(void) ...@@ -175,16 +175,16 @@ void EVENT_USB_ConfigurationChanged(void)
{ {
LEDs_SetAllLEDs(LEDMASK_USB_READY); LEDs_SetAllLEDs(LEDMASK_USB_READY);
if (!(USB_CDC_ConfigureEndpoints(&VirtualSerial1_CDC_Interface))) if (!(CDC_Device_ConfigureEndpoints(&VirtualSerial1_CDC_Interface)))
LEDs_SetAllLEDs(LEDMASK_USB_ERROR); LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
if (!(USB_CDC_ConfigureEndpoints(&VirtualSerial2_CDC_Interface))) if (!(CDC_Device_ConfigureEndpoints(&VirtualSerial2_CDC_Interface)))
LEDs_SetAllLEDs(LEDMASK_USB_ERROR); LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
} }
/** Event handler for the library USB Unhandled Control Packet event. */ /** Event handler for the library USB Unhandled Control Packet event. */
void EVENT_USB_UnhandledControlPacket(void) void EVENT_USB_UnhandledControlPacket(void)
{ {
USB_CDC_ProcessControlPacket(&VirtualSerial1_CDC_Interface); CDC_Device_ProcessControlPacket(&VirtualSerial1_CDC_Interface);
USB_CDC_ProcessControlPacket(&VirtualSerial2_CDC_Interface); CDC_Device_ProcessControlPacket(&VirtualSerial2_CDC_Interface);
} }
...@@ -63,7 +63,7 @@ int main(void) ...@@ -63,7 +63,7 @@ int main(void)
for (;;) for (;;)
{ {
USB_HID_USBTask(&Generic_HID_Interface); HID_Device_USBTask(&Generic_HID_Interface);
USB_USBTask(); USB_USBTask();
} }
} }
...@@ -106,14 +106,14 @@ void EVENT_USB_ConfigurationChanged(void) ...@@ -106,14 +106,14 @@ void EVENT_USB_ConfigurationChanged(void)
{ {
LEDs_SetAllLEDs(LEDMASK_USB_READY); LEDs_SetAllLEDs(LEDMASK_USB_READY);
if (!(USB_HID_ConfigureEndpoints(&Generic_HID_Interface))) if (!(HID_Device_ConfigureEndpoints(&Generic_HID_Interface)))
LEDs_SetAllLEDs(LEDMASK_USB_ERROR); LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
} }
/** Event handler for the library USB Unhandled Control Packet event. */ /** Event handler for the library USB Unhandled Control Packet event. */
void EVENT_USB_UnhandledControlPacket(void) void EVENT_USB_UnhandledControlPacket(void)
{ {
USB_HID_ProcessControlPacket(&Generic_HID_Interface); HID_Device_ProcessControlPacket(&Generic_HID_Interface);
} }
/** ISR to keep track of each millisecond interrupt, for determining the HID class idle period remaining when set. */ /** ISR to keep track of each millisecond interrupt, for determining the HID class idle period remaining when set. */
...@@ -130,7 +130,7 @@ ISR(TIMER0_COMPA_vect, ISR_BLOCK) ...@@ -130,7 +130,7 @@ ISR(TIMER0_COMPA_vect, ISR_BLOCK)
* *
* \return Number of bytes written in the report (or zero if no report is to be sent * \return Number of bytes written in the report (or zero if no report is to be sent
*/ */
uint16_t CALLBACK_USB_HID_CreateNextHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t* ReportID, void* ReportData) uint16_t CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t* ReportID, void* ReportData)
{ {
// Create generic HID report here // Create generic HID report here
...@@ -143,8 +143,8 @@ uint16_t CALLBACK_USB_HID_CreateNextHIDReport(USB_ClassInfo_HID_t* HIDInterfaceI ...@@ -143,8 +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 * \param ReportData Pointer to a buffer where the created report has been stored
* \param ReportSize Size in bytes of the received HID report * \param ReportSize Size in bytes of the received HID report
*/ */
void CALLBACK_USB_HID_ProcessReceivedHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t ReportID, void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t ReportID,
void* ReportData, uint16_t ReportSize) void* ReportData, uint16_t ReportSize)
{ {
// Process received generic HID report here // Process received generic HID report here
} }
...@@ -72,8 +72,8 @@ ...@@ -72,8 +72,8 @@
void EVENT_USB_ConfigurationChanged(void); void EVENT_USB_ConfigurationChanged(void);
void EVENT_USB_UnhandledControlPacket(void); void EVENT_USB_UnhandledControlPacket(void);
uint16_t CALLBACK_USB_HID_CreateNextHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t* ReportID, void* ReportData); uint16_t CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t* ReportID, void* ReportData);
void CALLBACK_USB_HID_ProcessReceivedHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t ReportID, void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t ReportID,
void* ReportData, uint16_t ReportSize); void* ReportData, uint16_t ReportSize);
#endif #endif
...@@ -63,7 +63,7 @@ int main(void) ...@@ -63,7 +63,7 @@ int main(void)
for (;;) for (;;)
{ {
USB_HID_USBTask(&Joystick_HID_Interface); HID_Device_USBTask(&Joystick_HID_Interface);
USB_USBTask(); USB_USBTask();
} }
} }
...@@ -108,14 +108,14 @@ void EVENT_USB_ConfigurationChanged(void) ...@@ -108,14 +108,14 @@ void EVENT_USB_ConfigurationChanged(void)
{ {
LEDs_SetAllLEDs(LEDMASK_USB_READY); LEDs_SetAllLEDs(LEDMASK_USB_READY);
if (!(USB_HID_ConfigureEndpoints(&Joystick_HID_Interface))) if (!(HID_Device_ConfigureEndpoints(&Joystick_HID_Interface)))
LEDs_SetAllLEDs(LEDMASK_USB_ERROR); LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
} }
/** Event handler for the library USB Unhandled Control Packet event. */ /** Event handler for the library USB Unhandled Control Packet event. */
void EVENT_USB_UnhandledControlPacket(void) void EVENT_USB_UnhandledControlPacket(void)
{ {
USB_HID_ProcessControlPacket(&Joystick_HID_Interface); HID_Device_ProcessControlPacket(&Joystick_HID_Interface);
} }
/** ISR to keep track of each millisecond interrupt, for determining the HID class idle period remaining when set. */ /** ISR to keep track of each millisecond interrupt, for determining the HID class idle period remaining when set. */
...@@ -132,7 +132,7 @@ ISR(TIMER0_COMPA_vect, ISR_BLOCK) ...@@ -132,7 +132,7 @@ ISR(TIMER0_COMPA_vect, ISR_BLOCK)
* *
* \return Number of bytes written in the report (or zero if no report is to be sent * \return Number of bytes written in the report (or zero if no report is to be sent
*/ */
uint16_t CALLBACK_USB_HID_CreateNextHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t* ReportID, void* ReportData) uint16_t CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t* ReportID, void* ReportData)
{ {
USB_JoystickReport_Data_t* JoystickReport = (USB_JoystickReport_Data_t*)ReportData; USB_JoystickReport_Data_t* JoystickReport = (USB_JoystickReport_Data_t*)ReportData;
...@@ -164,8 +164,8 @@ uint16_t CALLBACK_USB_HID_CreateNextHIDReport(USB_ClassInfo_HID_t* HIDInterfaceI ...@@ -164,8 +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 * \param ReportData Pointer to a buffer where the created report has been stored
* \param ReportSize Size in bytes of the received HID report * \param ReportSize Size in bytes of the received HID report
*/ */
void CALLBACK_USB_HID_ProcessReceivedHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t ReportID, void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t ReportID,
void* ReportData, uint16_t ReportSize) void* ReportData, uint16_t ReportSize)
{ {
// Unused (but mandatory for the HID class driver) in this demo, since there are no Host->Device reports // Unused (but mandatory for the HID class driver) in this demo, since there are no Host->Device reports
} }
...@@ -83,8 +83,8 @@ ...@@ -83,8 +83,8 @@
void EVENT_USB_ConfigurationChanged(void); void EVENT_USB_ConfigurationChanged(void);
void EVENT_USB_UnhandledControlPacket(void); void EVENT_USB_UnhandledControlPacket(void);
uint16_t CALLBACK_USB_HID_CreateNextHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t* ReportID, void* ReportData); uint16_t CALLBACK_HID_Device_CreateNextHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t* ReportID, void* ReportData);
void CALLBACK_USB_HID_ProcessReceivedHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t ReportID, void CALLBACK_HID_Device_ProcessReceivedHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t ReportID,
void* ReportData, uint16_t ReportSize); void* ReportData, uint16_t ReportSize);
#endif #endif
...@@ -64,7 +64,7 @@ int main(void) ...@@ -64,7 +64,7 @@ int main(void)
for (;;) for (;;)
{ {
USB_HID_USBTask(&Keyboard_HID_Interface); HID_Device_USBTask(&Keyboard_HID_Interface);
USB_USBTask(); USB_USBTask();
} }
} }
...@@ -109,14 +109,14 @@ void EVENT_USB_ConfigurationChanged(void) ...@@ -109,14 +109,14 @@ void EVENT_USB_ConfigurationChanged(void)
{ {
LEDs_SetAllLEDs(LEDMASK_USB_READY); LEDs_SetAllLEDs(LEDMASK_USB_READY);
if (!(USB_HID_ConfigureEndpoints(&Keyboard_HID_Interface))) if (!(HID_Device_ConfigureEndpoints(&Keyboard_HID_Interface)))
LEDs_SetAllLEDs(LEDMASK_USB_ERROR); LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
} }
/** Event handler for the library USB Unhandled Control Packet event. */ /** Event handler for the library USB Unhandled Control Packet event. */
void EVENT_USB_UnhandledControlPacket(void) void EVENT_USB_UnhandledControlPacket(void)
{ {
USB_HID_ProcessControlPacket(&Keyboard_HID_Interface); HID_Device_ProcessControlPacket(&Keyboard_HID_Interface);
} }
/** ISR to keep track of each millisecond interrupt, for determining the HID class idle period remaining when set. */ /** ISR to keep track of each millisecond interrupt, for determining the HID class idle period remaining when set. */
...@@ -133,7 +133,7 @@ ISR(TIMER0_COMPA_vect, ISR_BLOCK) ...@@ -133,7 +133,7 @@ ISR(TIMER0_COMPA_vect, ISR_BLOCK)
* *
* \return Number of bytes written in the report (or zero if no report is to be sent * \return Number of bytes written in the report (or zero if no report is to be sent
*/ */
uint16_t CALLBACK_USB_HID_CreateNextHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t* ReportID, void* ReportData) uint16_t CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t* ReportID, void* ReportData)
{ {
USB_KeyboardReport_Data_t* KeyboardReport = (USB_KeyboardReport_Data_t*)ReportData; USB_KeyboardReport_Data_t* KeyboardReport = (USB_KeyboardReport_Data_t*)ReportData;
...@@ -165,8 +165,8 @@ uint16_t CALLBACK_USB_HID_CreateNextHIDReport(USB_ClassInfo_HID_t* HIDInterfaceI ...@@ -165,8 +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 * \param ReportData Pointer to a buffer where the created report has been stored
* \param ReportSize Size in bytes of the received HID report * \param ReportSize Size in bytes of the received HID report
*/ */
void CALLBACK_USB_HID_ProcessReceivedHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t ReportID, void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t ReportID,
void* ReportData, uint16_t ReportSize) void* ReportData, uint16_t ReportSize)
{ {
uint8_t LEDMask = LEDS_NO_LEDS; uint8_t LEDMask = LEDS_NO_LEDS;
uint8_t* LEDReport = (uint8_t*)ReportData; uint8_t* LEDReport = (uint8_t*)ReportData;
......
...@@ -86,8 +86,8 @@ ...@@ -86,8 +86,8 @@
void EVENT_USB_ConfigurationChanged(void); void EVENT_USB_ConfigurationChanged(void);
void EVENT_USB_UnhandledControlPacket(void); void EVENT_USB_UnhandledControlPacket(void);
uint16_t CALLBACK_USB_HID_CreateNextHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t* ReportID, void* ReportData); uint16_t CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t* ReportID, void* ReportData);
void CALLBACK_USB_HID_ProcessReceivedHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t ReportID, void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t ReportID,
void* ReportData, uint16_t ReportSize); void* ReportData, uint16_t ReportSize);
#endif #endif
...@@ -80,8 +80,8 @@ int main(void) ...@@ -80,8 +80,8 @@ int main(void)
for (;;) for (;;)
{ {
USB_HID_USBTask(&Keyboard_HID_Interface); HID_Device_USBTask(&Keyboard_HID_Interface);
USB_HID_USBTask(&Mouse_HID_Interface); HID_Device_USBTask(&Mouse_HID_Interface);
USB_USBTask(); USB_USBTask();
} }
} }
...@@ -125,18 +125,18 @@ void EVENT_USB_ConfigurationChanged(void) ...@@ -125,18 +125,18 @@ void EVENT_USB_ConfigurationChanged(void)
{ {
LEDs_SetAllLEDs(LEDMASK_USB_READY); LEDs_SetAllLEDs(LEDMASK_USB_READY);
if (!(USB_HID_ConfigureEndpoints(&Keyboard_HID_Interface))) if (!(HID_Device_ConfigureEndpoints(&Keyboard_HID_Interface)))
LEDs_SetAllLEDs(LEDMASK_USB_ERROR); LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
if (!(USB_HID_ConfigureEndpoints(&Mouse_HID_Interface))) if (!(HID_Device_ConfigureEndpoints(&Mouse_HID_Interface)))
LEDs_SetAllLEDs(LEDMASK_USB_ERROR); LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
} }
/** Event handler for the library USB Unhandled Control Packet event. */ /** Event handler for the library USB Unhandled Control Packet event. */
void EVENT_USB_UnhandledControlPacket(void) void EVENT_USB_UnhandledControlPacket(void)
{ {
USB_HID_ProcessControlPacket(&Keyboard_HID_Interface); HID_Device_ProcessControlPacket(&Keyboard_HID_Interface);
USB_HID_ProcessControlPacket(&Mouse_HID_Interface); HID_Device_ProcessControlPacket(&Mouse_HID_Interface);
} }
/** ISR to keep track of each millisecond interrupt, for determining the HID class idle period remaining when set. */ /** ISR to keep track of each millisecond interrupt, for determining the HID class idle period remaining when set. */
...@@ -156,7 +156,7 @@ ISR(TIMER0_COMPA_vect, ISR_BLOCK) ...@@ -156,7 +156,7 @@ ISR(TIMER0_COMPA_vect, ISR_BLOCK)
* *
* \return Number of bytes written in the report (or zero if no report is to be sent * \return Number of bytes written in the report (or zero if no report is to be sent
*/ */
uint16_t CALLBACK_USB_HID_CreateNextHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t* ReportID, void* ReportData) uint16_t CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t* ReportID, void* ReportData)
{ {
uint8_t JoyStatus_LCL = Joystick_GetStatus(); uint8_t JoyStatus_LCL = Joystick_GetStatus();
uint8_t ButtonStatus_LCL = Buttons_GetStatus(); uint8_t ButtonStatus_LCL = Buttons_GetStatus();
...@@ -215,8 +215,8 @@ uint16_t CALLBACK_USB_HID_CreateNextHIDReport(USB_ClassInfo_HID_t* HIDInterfaceI ...@@ -215,8 +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 * \param ReportData Pointer to a buffer where the created report has been stored
* \param ReportSize Size in bytes of the received HID report * \param ReportSize Size in bytes of the received HID report
*/ */
void CALLBACK_USB_HID_ProcessReceivedHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t ReportID, void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t ReportID,
void* ReportData, uint16_t ReportSize) void* ReportData, uint16_t ReportSize)
{ {
if (HIDInterfaceInfo == &Keyboard_HID_Interface) if (HIDInterfaceInfo == &Keyboard_HID_Interface)
{ {
......
...@@ -90,8 +90,8 @@ ...@@ -90,8 +90,8 @@
void EVENT_USB_ConfigurationChanged(void); void EVENT_USB_ConfigurationChanged(void);
void EVENT_USB_UnhandledControlPacket(void); void EVENT_USB_UnhandledControlPacket(void);
uint16_t CALLBACK_USB_HID_CreateNextHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t* ReportID, void* ReportData); uint16_t CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t* ReportID, void* ReportData);
void CALLBACK_USB_HID_ProcessReceivedHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t ReportID, void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t ReportID,
void* ReportData, uint16_t ReportSize); void* ReportData, uint16_t ReportSize);
#endif #endif