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

pull/1469/head
Dean Camera 16 years ago
parent b2330934b9
commit 9798440ca4

@ -62,7 +62,7 @@ int main(void)
if (Microphone_Audio_Interface.InterfaceEnabled)
ProcessNextSample();
USB_Audio_USBTask(&Microphone_Audio_Interface);
Audio_Device_USBTask(&Microphone_Audio_Interface);
USB_USBTask();
}
}
@ -92,7 +92,7 @@ void SetupHardware(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);
@ -104,7 +104,7 @@ void ProcessNextSample(void)
AudioSample -= (SAMPLE_MAX_RANGE / 2));
#endif
USB_Audio_WriteSample16(AudioSample);
Audio_Device_WriteSample16(AudioSample);
}
}
@ -133,12 +133,12 @@ void EVENT_USB_ConfigurationChanged(void)
{
LEDs_SetAllLEDs(LEDMASK_USB_READY);
if (!(USB_Audio_ConfigureEndpoints(&Microphone_Audio_Interface)))
if (!(Audio_Device_ConfigureEndpoints(&Microphone_Audio_Interface)))
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
}
/** Event handler for the library USB Unhandled Control Packet event. */
void EVENT_USB_UnhandledControlPacket(void)
{
USB_Audio_ProcessControlPacket(&Microphone_Audio_Interface);
Audio_Device_ProcessControlPacket(&Microphone_Audio_Interface);
}

@ -62,7 +62,7 @@ int main(void)
if (Speaker_Audio_Interface.InterfaceEnabled)
ProcessNextSample();
USB_Audio_USBTask(&Speaker_Audio_Interface);
Audio_Device_USBTask(&Speaker_Audio_Interface);
USB_USBTask();
}
}
@ -87,14 +87,14 @@ void SetupHardware(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 */
TIFR0 |= (1 << OCF0A);
/* Retrieve the signed 16-bit left and right audio samples */
int16_t LeftSample_16Bit = (int16_t)USB_Audio_ReadSample16();
int16_t RightSample_16Bit = (int16_t)USB_Audio_ReadSample16();
int16_t LeftSample_16Bit = (int16_t)Audio_Device_ReadSample16();
int16_t RightSample_16Bit = (int16_t)Audio_Device_ReadSample16();
/* Massage signed 16-bit left and right audio samples into signed 8-bit */
int8_t LeftSample_8Bit = (LeftSample_16Bit >> 8);
@ -195,12 +195,12 @@ void EVENT_USB_ConfigurationChanged(void)
{
LEDs_SetAllLEDs(LEDMASK_USB_READY);
if (!(USB_Audio_ConfigureEndpoints(&Speaker_Audio_Interface)))
if (!(Audio_Device_ConfigureEndpoints(&Speaker_Audio_Interface)))
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
}
/** Event handler for the library USB Unhandled Control Packet event. */
void EVENT_USB_UnhandledControlPacket(void)
{
USB_Audio_ProcessControlPacket(&Speaker_Audio_Interface);
Audio_Device_ProcessControlPacket(&Speaker_Audio_Interface);
}

@ -67,11 +67,11 @@ int main(void)
{
CheckJoystickMovement();
uint16_t BytesToDiscard = USB_CDC_BytesReceived(&VirtualSerial_CDC_Interface);
uint16_t BytesToDiscard = CDC_Device_BytesReceived(&VirtualSerial_CDC_Interface);
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();
}
}
@ -125,7 +125,7 @@ void CheckJoystickMovement(void)
{
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)
{
LEDs_SetAllLEDs(LEDMASK_USB_READY);
if (!(USB_CDC_ConfigureEndpoints(&VirtualSerial_CDC_Interface)))
if (!(CDC_Device_ConfigureEndpoints(&VirtualSerial_CDC_Interface)))
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
}
/** Event handler for the library USB Unhandled Control Packet event. */
void EVENT_USB_UnhandledControlPacket(void)
{
USB_CDC_ProcessControlPacket(&VirtualSerial_CDC_Interface);
CDC_Device_ProcessControlPacket(&VirtualSerial_CDC_Interface);
}

@ -88,17 +88,17 @@ int main(void)
CheckJoystickMovement();
/* 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--)
USB_CDC_ReceiveByte(&VirtualSerial1_CDC_Interface);
CDC_Device_ReceiveByte(&VirtualSerial1_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--)
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);
USB_CDC_USBTask(&VirtualSerial2_CDC_Interface);
CDC_Device_USBTask(&VirtualSerial1_CDC_Interface);
CDC_Device_USBTask(&VirtualSerial2_CDC_Interface);
USB_USBTask();
}
}
@ -154,7 +154,7 @@ void CheckJoystickMovement(void)
{
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)
{
LEDs_SetAllLEDs(LEDMASK_USB_READY);
if (!(USB_CDC_ConfigureEndpoints(&VirtualSerial1_CDC_Interface)))
if (!(CDC_Device_ConfigureEndpoints(&VirtualSerial1_CDC_Interface)))
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
if (!(USB_CDC_ConfigureEndpoints(&VirtualSerial2_CDC_Interface)))
if (!(CDC_Device_ConfigureEndpoints(&VirtualSerial2_CDC_Interface)))
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
}
/** Event handler for the library USB Unhandled Control Packet event. */
void EVENT_USB_UnhandledControlPacket(void)
{
USB_CDC_ProcessControlPacket(&VirtualSerial1_CDC_Interface);
USB_CDC_ProcessControlPacket(&VirtualSerial2_CDC_Interface);
CDC_Device_ProcessControlPacket(&VirtualSerial1_CDC_Interface);
CDC_Device_ProcessControlPacket(&VirtualSerial2_CDC_Interface);
}

@ -63,7 +63,7 @@ int main(void)
for (;;)
{
USB_HID_USBTask(&Generic_HID_Interface);
HID_Device_USBTask(&Generic_HID_Interface);
USB_USBTask();
}
}
@ -106,14 +106,14 @@ void EVENT_USB_ConfigurationChanged(void)
{
LEDs_SetAllLEDs(LEDMASK_USB_READY);
if (!(USB_HID_ConfigureEndpoints(&Generic_HID_Interface)))
if (!(HID_Device_ConfigureEndpoints(&Generic_HID_Interface)))
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
}
/** Event handler for the library USB Unhandled Control Packet event. */
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. */
@ -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
*/
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
@ -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 ReportSize Size in bytes of the received HID report
*/
void CALLBACK_USB_HID_ProcessReceivedHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t ReportID,
void* ReportData, uint16_t ReportSize)
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t ReportID,
void* ReportData, uint16_t ReportSize)
{
// Process received generic HID report here
}

@ -72,8 +72,8 @@
void EVENT_USB_ConfigurationChanged(void);
void EVENT_USB_UnhandledControlPacket(void);
uint16_t CALLBACK_USB_HID_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* ReportData, uint16_t ReportSize);
uint16_t CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t* ReportID, void* ReportData);
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t ReportID,
void* ReportData, uint16_t ReportSize);
#endif

@ -63,7 +63,7 @@ int main(void)
for (;;)
{
USB_HID_USBTask(&Joystick_HID_Interface);
HID_Device_USBTask(&Joystick_HID_Interface);
USB_USBTask();
}
}
@ -108,14 +108,14 @@ void EVENT_USB_ConfigurationChanged(void)
{
LEDs_SetAllLEDs(LEDMASK_USB_READY);
if (!(USB_HID_ConfigureEndpoints(&Joystick_HID_Interface)))
if (!(HID_Device_ConfigureEndpoints(&Joystick_HID_Interface)))
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
}
/** Event handler for the library USB Unhandled Control Packet event. */
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. */
@ -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
*/
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;
@ -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 ReportSize Size in bytes of the received HID report
*/
void CALLBACK_USB_HID_ProcessReceivedHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t ReportID,
void* ReportData, uint16_t ReportSize)
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t ReportID,
void* ReportData, uint16_t ReportSize)
{
// Unused (but mandatory for the HID class driver) in this demo, since there are no Host->Device reports
}

@ -83,8 +83,8 @@
void EVENT_USB_ConfigurationChanged(void);
void EVENT_USB_UnhandledControlPacket(void);
uint16_t CALLBACK_USB_HID_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* ReportData, uint16_t ReportSize);
uint16_t CALLBACK_HID_Device_CreateNextHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t* ReportID, void* ReportData);
void CALLBACK_HID_Device_ProcessReceivedHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t ReportID,
void* ReportData, uint16_t ReportSize);
#endif

@ -64,7 +64,7 @@ int main(void)
for (;;)
{
USB_HID_USBTask(&Keyboard_HID_Interface);
HID_Device_USBTask(&Keyboard_HID_Interface);
USB_USBTask();
}
}
@ -109,14 +109,14 @@ void EVENT_USB_ConfigurationChanged(void)
{
LEDs_SetAllLEDs(LEDMASK_USB_READY);
if (!(USB_HID_ConfigureEndpoints(&Keyboard_HID_Interface)))
if (!(HID_Device_ConfigureEndpoints(&Keyboard_HID_Interface)))
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
}
/** Event handler for the library USB Unhandled Control Packet event. */
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. */
@ -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
*/
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;
@ -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 ReportSize Size in bytes of the received HID report
*/
void CALLBACK_USB_HID_ProcessReceivedHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t ReportID,
void* ReportData, uint16_t ReportSize)
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t ReportID,
void* ReportData, uint16_t ReportSize)
{
uint8_t LEDMask = LEDS_NO_LEDS;
uint8_t* LEDReport = (uint8_t*)ReportData;

@ -86,8 +86,8 @@
void EVENT_USB_ConfigurationChanged(void);
void EVENT_USB_UnhandledControlPacket(void);
uint16_t CALLBACK_USB_HID_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* ReportData, uint16_t ReportSize);
uint16_t CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t* ReportID, void* ReportData);
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t ReportID,
void* ReportData, uint16_t ReportSize);
#endif

@ -80,8 +80,8 @@ int main(void)
for (;;)
{
USB_HID_USBTask(&Keyboard_HID_Interface);
USB_HID_USBTask(&Mouse_HID_Interface);
HID_Device_USBTask(&Keyboard_HID_Interface);
HID_Device_USBTask(&Mouse_HID_Interface);
USB_USBTask();
}
}
@ -125,18 +125,18 @@ void EVENT_USB_ConfigurationChanged(void)
{
LEDs_SetAllLEDs(LEDMASK_USB_READY);
if (!(USB_HID_ConfigureEndpoints(&Keyboard_HID_Interface)))
if (!(HID_Device_ConfigureEndpoints(&Keyboard_HID_Interface)))
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
if (!(USB_HID_ConfigureEndpoints(&Mouse_HID_Interface)))
if (!(HID_Device_ConfigureEndpoints(&Mouse_HID_Interface)))
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
}
/** Event handler for the library USB Unhandled Control Packet event. */
void EVENT_USB_UnhandledControlPacket(void)
{
USB_HID_ProcessControlPacket(&Keyboard_HID_Interface);
USB_HID_ProcessControlPacket(&Mouse_HID_Interface);
HID_Device_ProcessControlPacket(&Keyboard_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. */
@ -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
*/
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 ButtonStatus_LCL = Buttons_GetStatus();
@ -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 ReportSize Size in bytes of the received HID report
*/
void CALLBACK_USB_HID_ProcessReceivedHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t ReportID,
void* ReportData, uint16_t ReportSize)
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t ReportID,
void* ReportData, uint16_t ReportSize)
{
if (HIDInterfaceInfo == &Keyboard_HID_Interface)
{

@ -90,8 +90,8 @@
void EVENT_USB_ConfigurationChanged(void);
void EVENT_USB_UnhandledControlPacket(void);
uint16_t CALLBACK_USB_HID_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* ReportData, uint16_t ReportSize);
uint16_t CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t* ReportID, void* ReportData);
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t ReportID,
void* ReportData, uint16_t ReportSize);
#endif

@ -65,9 +65,9 @@ int main(void)
CheckJoystickMovement();
USB_MIDI_EventPacket_t DummyMIDIEvent;
USB_MIDI_ReceiveEventPacket(&Keyboard_MIDI_Interface, &DummyMIDIEvent);
MIDI_Device_ReceiveEventPacket(&Keyboard_MIDI_Interface, &DummyMIDIEvent);
USB_MIDI_USBTask(&Keyboard_MIDI_Interface);
MIDI_Device_USBTask(&Keyboard_MIDI_Interface);
USB_USBTask();
}
}
@ -146,7 +146,7 @@ void CheckJoystickMovement(void)
.Data3 = MIDI_STANDARD_VELOCITY,
};
USB_MIDI_SendEventPacket(&Keyboard_MIDI_Interface, &MIDIEvent);
MIDI_Device_SendEventPacket(&Keyboard_MIDI_Interface, &MIDIEvent);
}
PrevJoystickStatus = JoystickStatus;
@ -169,12 +169,12 @@ void EVENT_USB_ConfigurationChanged(void)
{
LEDs_SetAllLEDs(LEDMASK_USB_READY);
if (!(USB_MIDI_ConfigureEndpoints(&Keyboard_MIDI_Interface)))
if (!(MIDI_Device_ConfigureEndpoints(&Keyboard_MIDI_Interface)))
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
}
/** Event handler for the library USB Unhandled Control Packet event. */
void EVENT_USB_UnhandledControlPacket(void)
{
USB_MIDI_ProcessControlPacket(&Keyboard_MIDI_Interface);
MIDI_Device_ProcessControlPacket(&Keyboard_MIDI_Interface);
}

@ -64,7 +64,7 @@ int main(void)
for (;;)
{
USB_MS_USBTask(&Disk_MS_Interface);
MS_Device_USBTask(&Disk_MS_Interface);
USB_USBTask();
}
}
@ -105,21 +105,21 @@ void EVENT_USB_ConfigurationChanged(void)
{
LEDs_SetAllLEDs(LEDMASK_USB_READY);
if (!(USB_MS_ConfigureEndpoints(&Disk_MS_Interface)))
if (!(MS_Device_ConfigureEndpoints(&Disk_MS_Interface)))
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
}
/** Event handler for the library USB Unhandled Control Packet event. */
void EVENT_USB_UnhandledControlPacket(void)
{
USB_MS_ProcessControlPacket(&Disk_MS_Interface);
MS_Device_ProcessControlPacket(&Disk_MS_Interface);
}
/** Mass Storage class driver callback function the reception of SCSI commands from the host, which must be processed.
*
* \param MSInterfaceInfo Pointer to the Mass Storage class interface configuration structure being referenced
*/
bool CALLBACK_USB_MS_SCSICommandReceived(USB_ClassInfo_MS_t* MSInterfaceInfo)
bool CALLBACK_MS_Device_SCSICommandReceived(USB_ClassInfo_MS_t* MSInterfaceInfo)
{
bool CommandSuccess;

@ -83,6 +83,6 @@
void EVENT_USB_ConfigurationChanged(void);
void EVENT_USB_UnhandledControlPacket(void);
bool CALLBACK_USB_MS_SCSICommandReceived(USB_ClassInfo_MS_t* MSInterfaceInfo);
bool CALLBACK_MS_Device_SCSICommandReceived(USB_ClassInfo_MS_t* MSInterfaceInfo);
#endif

@ -61,7 +61,7 @@ int main(void)
for (;;)
{
USB_HID_USBTask(&Mouse_HID_Interface);
HID_Device_USBTask(&Mouse_HID_Interface);
USB_USBTask();
}
}
@ -106,14 +106,14 @@ void EVENT_USB_ConfigurationChanged(void)
{
LEDs_SetAllLEDs(LEDMASK_USB_READY);
if (!(USB_HID_ConfigureEndpoints(&Mouse_HID_Interface)))
if (!(HID_Device_ConfigureEndpoints(&Mouse_HID_Interface)))
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
}
/** Event handler for the library USB Unhandled Control Packet event. */
void EVENT_USB_UnhandledControlPacket(void)
{
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. */
@ -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
*/
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_MouseReport_Data_t* MouseReport = (USB_MouseReport_Data_t*)ReportData;
@ -162,8 +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
* \param ReportSize Size in bytes of the received HID report
*/
void CALLBACK_USB_HID_ProcessReceivedHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t ReportID,
void* ReportData, uint16_t ReportSize)
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t ReportID,
void* ReportData, uint16_t ReportSize)
{
// Unused (but mandatory for the HID class driver) in this demo, since there are no Host->Device reports
}

@ -85,8 +85,8 @@
void EVENT_USB_ConfigurationChanged(void);
void EVENT_USB_UnhandledControlPacket(void);
uint16_t CALLBACK_USB_HID_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* ReportData, uint16_t ReportSize);
uint16_t CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t* ReportID, void* ReportData);
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t ReportID,
void* ReportData, uint16_t ReportSize);
#endif

@ -82,7 +82,7 @@ int main(void)
TCP_TCPTask(&Ethernet_RNDIS_Interface);
USB_RNDIS_USBTask(&Ethernet_RNDIS_Interface);
RNDIS_Device_USBTask(&Ethernet_RNDIS_Interface);
USB_USBTask();
}
}
@ -120,12 +120,12 @@ void EVENT_USB_ConfigurationChanged(void)
{
LEDs_SetAllLEDs(LEDMASK_USB_READY);
if (!(USB_RNDIS_ConfigureEndpoints(&Ethernet_RNDIS_Interface)))
if (!(RNDIS_Device_ConfigureEndpoints(&Ethernet_RNDIS_Interface)))
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
}
/** Event handler for the library USB Unhandled Control Packet event. */
void EVENT_USB_UnhandledControlPacket(void)
{
USB_RNDIS_ProcessControlPacket(&Ethernet_RNDIS_Interface);
RNDIS_Device_ProcessControlPacket(&Ethernet_RNDIS_Interface);
}

@ -81,6 +81,4 @@
void EVENT_USB_ConfigurationChanged(void);
void EVENT_USB_UnhandledControlPacket(void);
void CALLBACK_USB_RNDIS_ProcessRNDISControlMessage(USB_ClassInfo_RNDIS_t* RNDISInterfaceInfo);
#endif

@ -74,21 +74,24 @@ int main(void)
for (;;)
{
for (uint8_t DataBytesRem = USB_CDC_BytesReceived(&VirtualSerial_CDC_Interface); DataBytesRem != 0; DataBytesRem--)
/* Read bytes from the USB OUT endpoint into the USART transmit buffer */
for (uint8_t DataBytesRem = CDC_Device_BytesReceived(&VirtualSerial_CDC_Interface); DataBytesRem != 0; DataBytesRem--)
{
if (!(BUFF_STATICSIZE - Rx_Buffer.Elements))
break;
Buffer_StoreElement(&Rx_Buffer, USB_CDC_ReceiveByte(&VirtualSerial_CDC_Interface));
Buffer_StoreElement(&Rx_Buffer, CDC_Device_ReceiveByte(&VirtualSerial_CDC_Interface));
}
/* Read bytes from the USART receive buffer into the USB IN endpoint */
if (Tx_Buffer.Elements)
USB_CDC_SendByte(&VirtualSerial_CDC_Interface, Buffer_GetElement(&Rx_Buffer));
CDC_Device_SendByte(&VirtualSerial_CDC_Interface, Buffer_GetElement(&Tx_Buffer));
/* Read bytes from the USART transmit buffer into the USART */
if (Rx_Buffer.Elements)
Serial_TxByte(Buffer_GetElement(&Rx_Buffer));
USB_CDC_USBTask(&VirtualSerial_CDC_Interface);
CDC_Device_USBTask(&VirtualSerial_CDC_Interface);
USB_USBTask();
}
}
@ -126,14 +129,14 @@ void EVENT_USB_ConfigurationChanged(void)
{
LEDs_SetAllLEDs(LEDMASK_USB_READY);
if (!(USB_CDC_ConfigureEndpoints(&VirtualSerial_CDC_Interface)))
if (!(CDC_Device_ConfigureEndpoints(&VirtualSerial_CDC_Interface)))
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
}
/** Event handler for the library USB Unhandled Control Packet event. */
void EVENT_USB_UnhandledControlPacket(void)
{
USB_CDC_ProcessControlPacket(&VirtualSerial_CDC_Interface);
CDC_Device_ProcessControlPacket(&VirtualSerial_CDC_Interface);
}
/** ISR to manage the reception of data from the serial port, placing received bytes into a circular buffer
@ -149,7 +152,7 @@ ISR(USART1_RX_vect, ISR_BLOCK)
*
* \param CDCInterfaceInfo Pointer to the CDC class interface configuration structure being referenced
*/
void EVENT_USB_CDC_LineEncodingChanged(USB_ClassInfo_CDC_t* CDCInterfaceInfo)
void EVENT_CDC_Device_LineEncodingChanged(USB_ClassInfo_CDC_t* CDCInterfaceInfo)
{
uint8_t ConfigMask = 0;

@ -74,6 +74,6 @@
void EVENT_USB_ConfigurationChanged(void);
void EVENT_USB_UnhandledControlPacket(void);
void EVENT_USB_CDC_LineEncodingChanged(USB_ClassInfo_CDC_t* CDCInterfaceInfo);
void EVENT_CDC_Device_LineEncodingChanged(USB_ClassInfo_CDC_t* CDCInterfaceInfo);
#endif

File diff suppressed because one or more lines are too long

@ -30,7 +30,7 @@
#include "Audio.h"
void USB_Audio_ProcessControlPacket(USB_ClassInfo_Audio_t* AudioInterfaceInfo)
void Audio_Device_ProcessControlPacket(USB_ClassInfo_Audio_t* AudioInterfaceInfo)
{
if (!(Endpoint_IsSETUPReceived()))
return;
@ -55,7 +55,7 @@ void USB_Audio_ProcessControlPacket(USB_ClassInfo_Audio_t* AudioInterfaceInfo)
}
}
bool USB_Audio_ConfigureEndpoints(USB_ClassInfo_Audio_t* AudioInterfaceInfo)
bool Audio_Device_ConfigureEndpoints(USB_ClassInfo_Audio_t* AudioInterfaceInfo)
{
if (AudioInterfaceInfo->DataINEndpointNumber)
{
@ -80,12 +80,12 @@ bool USB_Audio_ConfigureEndpoints(USB_ClassInfo_Audio_t* AudioInterfaceInfo)
return true;
}
void USB_Audio_USBTask(USB_ClassInfo_Audio_t* AudioInterfaceInfo)
void Audio_Device_USBTask(USB_ClassInfo_Audio_t* AudioInterfaceInfo)
{
}
int8_t USB_Audio_ReadSample8(void)
int8_t Audio_Device_ReadSample8(void)
{
int8_t Sample;
@ -97,7 +97,7 @@ int8_t USB_Audio_ReadSample8(void)
return Sample;
}
int16_t USB_Audio_ReadSample16(void)
int16_t Audio_Device_ReadSample16(void)
{
int16_t Sample;
@ -109,7 +109,7 @@ int16_t USB_Audio_ReadSample16(void)
return Sample;
}
int32_t USB_Audio_ReadSample24(void)
int32_t Audio_Device_ReadSample24(void)
{
int32_t Sample;
@ -121,7 +121,7 @@ int32_t USB_Audio_ReadSample24(void)
return Sample;
}
void USB_Audio_WriteSample8(int8_t Sample)
void Audio_Device_WriteSample8(int8_t Sample)
{
Endpoint_Write_Byte(Sample);
@ -129,7 +129,7 @@ void USB_Audio_WriteSample8(int8_t Sample)
Endpoint_ClearIN();
}
void USB_Audio_WriteSample16(int16_t Sample)
void Audio_Device_WriteSample16(int16_t Sample)
{
Endpoint_Write_Word_LE(Sample);
@ -137,7 +137,7 @@ void USB_Audio_WriteSample16(int16_t Sample)
Endpoint_ClearIN();
}
void USB_Audio_WriteSample24(int32_t Sample)
void Audio_Device_WriteSample24(int32_t Sample)
{
Endpoint_Write_Byte(Sample >> 16);
Endpoint_Write_Word_LE(Sample);
@ -146,13 +146,13 @@ void USB_Audio_WriteSample24(int32_t Sample)
Endpoint_ClearIN();
}
bool USB_Audio_IsSampleReceived(USB_ClassInfo_Audio_t* AudioInterfaceInfo)
bool Audio_Device_IsSampleReceived(USB_ClassInfo_Audio_t* AudioInterfaceInfo)
{
Endpoint_SelectEndpoint(AudioInterfaceInfo->DataOUTEndpointNumber);
return Endpoint_IsOUTReceived();
}
bool USB_Audio_IsReadyForNextSample(USB_ClassInfo_Audio_t* AudioInterfaceInfo)
bool Audio_Device_IsReadyForNextSample(USB_ClassInfo_Audio_t* AudioInterfaceInfo)
{
Endpoint_SelectEndpoint(AudioInterfaceInfo->DataINEndpointNumber);
return Endpoint_IsINReady();

@ -390,21 +390,21 @@
*
* \return Boolean true if the endpoints were sucessfully configured, false otherwise
*/
bool USB_Audio_ConfigureEndpoints(USB_ClassInfo_Audio_t* AudioInterfaceInfo);
bool Audio_Device_ConfigureEndpoints(USB_ClassInfo_Audio_t* AudioInterfaceInfo);
/** Processes incomming control requests from the host, that are directed to the given Audio class interface. This should be
* linked to the library \ref EVENT_USB_UnhandledControlPacket() event.
*
* \param AudioInterfaceInfo Pointer to a structure containing an Audio Class configuration and state.
*/
void USB_Audio_ProcessControlPacket(USB_ClassInfo_Audio_t* AudioInterfaceInfo);
void Audio_Device_ProcessControlPacket(USB_ClassInfo_Audio_t* AudioInterfaceInfo);
/** General management task for a given Audio class interface, required for the correct operation of the interface. This should
* be called frequently in the main program loop, before the master USB management task \ref USB_USBTask().
*
* \param AudioInterfaceInfo Pointer to a structure containing an Audio Class configuration and state.
*/
void USB_Audio_USBTask(USB_ClassInfo_Audio_t* AudioInterfaceInfo);
void Audio_Device_USBTask(USB_ClassInfo_Audio_t* AudioInterfaceInfo);
/** Reads the next 8-bit audio sample from the current audio interface.
*
@ -413,7 +413,7 @@
*
* \return Signed 8-bit audio sample from the audio interface
*/
int8_t USB_Audio_ReadSample8(void);
int8_t Audio_Device_ReadSample8(void);
/** Reads the next 16-bit audio sample from the current audio interface.
*
@ -422,7 +422,7 @@
*
* \return Signed 16-bit audio sample from the audio interface
*/
int16_t USB_Audio_ReadSample16(void);
int16_t Audio_Device_ReadSample16(void);
/** Reads the next 24-bit audio sample from the current audio interface.
*
@ -431,7 +431,7 @@
*
* \return Signed 24-bit audio sample from the audio interface
*/
int32_t USB_Audio_ReadSample24(void);
int32_t Audio_Device_ReadSample24(void);
/** Writes the next 8-bit audio sample to the current audio interface.
*
@ -440,7 +440,7 @@
*
* \param Sample Signed 8-bit audio sample
*/
void USB_Audio_WriteSample8(int8_t Sample);
void Audio_Device_WriteSample8(int8_t Sample);
/** Writes the next 16-bit audio sample to the current audio interface.
*
@ -449,7 +449,7 @@
*
* \param Sample Signed 16-bit audio sample
*/
void USB_Audio_WriteSample16(int16_t Sample);
void Audio_Device_WriteSample16(int16_t Sample);
/** Writes the next 24-bit audio sample to the current audio interface.
*
@ -458,7 +458,7 @@
*
* \param Sample Signed 24-bit audio sample
*/
void USB_Audio_WriteSample24(int32_t Sample);
void Audio_Device_WriteSample24(int32_t Sample);
/** Determines if the given audio interface is ready for a sample to be read from it.
*
@ -466,7 +466,7 @@
*
* \return Boolean true if the given Audio interface has a sample to be read, false otherwise
*/
bool USB_Audio_IsSampleReceived(USB_ClassInfo_Audio_t* AudioInterfaceInfo);
bool Audio_Device_IsSampleReceived(USB_ClassInfo_Audio_t* AudioInterfaceInfo);
/** Determines if the given audio interface is ready to accept the next sample to be written to it.
*
@ -474,7 +474,7 @@
*
* \return Boolean true if the given Audio interface is ready to accept the next sample, false otherwise
*/
bool USB_Audio_IsReadyForNextSample(USB_ClassInfo_Audio_t* AudioInterfaceInfo);
bool Audio_Device_IsReadyForNextSample(USB_ClassInfo_Audio_t* AudioInterfaceInfo);
/* Disable C linkage for C++ Compilers: */
#if defined(__cplusplus)

@ -31,12 +31,12 @@
#define INCLUDE_FROM_CDC_CLASS_C
#include "CDC.h"
void USB_CDC_Event_Stub(void)
void CDC_Device_Event_Stub(void)
{
}
void USB_CDC_ProcessControlPacket(USB_ClassInfo_CDC_t* CDCInterfaceInfo)
void CDC_Device_ProcessControlPacket(USB_ClassInfo_CDC_t* CDCInterfaceInfo)
{
if (!(Endpoint_IsSETUPReceived()))
return;
@ -62,7 +62,7 @@ void USB_CDC_ProcessControlPacket(USB_ClassInfo_CDC_t* CDCInterfaceInfo)
Endpoint_Read_Control_Stream_LE(&CDCInterfaceInfo->LineEncoding, sizeof(CDCInterfaceInfo->LineEncoding));
Endpoint_ClearIN();
EVENT_USB_CDC_LineEncodingChanged(CDCInterfaceInfo);
EVENT_CDC_Device_LineEncodingChanged(CDCInterfaceInfo);
}
break;
@ -73,7 +73,7 @@ void USB_CDC_ProcessControlPacket(USB_ClassInfo_CDC_t* CDCInterfaceInfo)
CDCInterfaceInfo->ControlLineState = USB_ControlRequest.wValue;
EVENT_USB_CDC_ControLineStateChanged(CDCInterfaceInfo);
EVENT_CDC_Device_ControLineStateChanged(CDCInterfaceInfo);
while (!(Endpoint_IsINReady()));
Endpoint_ClearIN();
@ -83,7 +83,7 @@ void USB_CDC_ProcessControlPacket(USB_ClassInfo_CDC_t* CDCInterfaceInfo)
}
}
bool USB_CDC_ConfigureEndpoints(USB_ClassInfo_CDC_t* CDCInterfaceInfo)
bool CDC_Device_ConfigureEndpoints(USB_ClassInfo_CDC_t* CDCInterfaceInfo)
{
if (!(Endpoint_ConfigureEndpoint(CDCInterfaceInfo->DataINEndpointNumber, EP_TYPE_BULK,
ENDPOINT_DIR_IN, CDCInterfaceInfo->DataINEndpointSize,
@ -109,7 +109,7 @@ bool USB_CDC_ConfigureEndpoints(USB_ClassInfo_CDC_t* CDCInterfaceInfo)
return true;
}
void USB_CDC_USBTask(USB_ClassInfo_CDC_t* CDCInterfaceInfo)
void CDC_Device_USBTask(USB_ClassInfo_CDC_t* CDCInterfaceInfo)
{
if (!(USB_IsConnected))
return;
@ -128,7 +128,7 @@ void USB_CDC_USBTask(USB_ClassInfo_CDC_t* CDCInterfaceInfo)
Endpoint_ClearIN();
}
void USB_CDC_SendString(USB_ClassInfo_CDC_t* CDCInterfaceInfo, char* Data, uint16_t Length)
void CDC_Device_SendString(USB_ClassInfo_CDC_t* CDCInterfaceInfo, char* Data, uint16_t Length)
{
if (!(USB_IsConnected))
return;
@ -137,7 +137,7 @@ void USB_CDC_SendString(USB_ClassInfo_CDC_t* CDCInterfaceInfo, char* Data, uint1
Endpoint_Write_Stream_LE(Data, Length, NO_STREAM_CALLBACK);
}
void USB_CDC_SendByte(USB_ClassInfo_CDC_t* CDCInterfaceInfo, uint8_t Data)
void CDC_Device_SendByte(USB_ClassInfo_CDC_t* CDCInterfaceInfo, uint8_t Data)
{
if (!(USB_IsConnected))
return;
@ -153,14 +153,14 @@ void USB_CDC_SendByte(USB_ClassInfo_CDC_t* CDCInterfaceInfo, uint8_t Data)
Endpoint_Write_Byte(Data);
}
uint16_t USB_CDC_BytesReceived(USB_ClassInfo_CDC_t* CDCInterfaceInfo)
uint16_t CDC_Device_BytesReceived(USB_ClassInfo_CDC_t* CDCInterfaceInfo)
{
Endpoint_SelectEndpoint(CDCInterfaceInfo->DataOUTEndpointNumber);
return Endpoint_BytesInEndpoint();
}
uint8_t USB_CDC_ReceiveByte(USB_ClassInfo_CDC_t* CDCInterfaceInfo)
uint8_t CDC_Device_ReceiveByte(USB_ClassInfo_CDC_t* CDCInterfaceInfo)
{
if (!(USB_IsConnected))
return 0;
@ -175,7 +175,7 @@ uint8_t USB_CDC_ReceiveByte(USB_ClassInfo_CDC_t* CDCInterfaceInfo)
return DataByte;
}
void USB_CDC_SendSerialLineStateChange(USB_ClassInfo_CDC_t* CDCInterfaceInfo, uint16_t LineStateMask)
void CDC_Device_SendControlLineStateChange(USB_ClassInfo_CDC_t* CDCInterfaceInfo, uint16_t LineStateMask)
{
if (!(USB_IsConnected))
return;

@ -186,11 +186,11 @@
/* Function Prototypes: */
#if defined(INCLUDE_FROM_CDC_CLASS_C)
void USB_CDC_Event_Stub(void);
void EVENT_USB_CDC_LineEncodingChanged(USB_ClassInfo_CDC_t* CDCInterfaceInfo)
ATTR_WEAK ATTR_ALIAS(USB_CDC_Event_Stub);
void EVENT_USB_CDC_ControLineStateChanged(USB_ClassInfo_CDC_t* CDCInterfaceInfo)
ATTR_WEAK ATTR_ALIAS(USB_CDC_Event_Stub);
void CDC_Device_Event_Stub(void);
void EVENT_CDC_Device_LineEncodingChanged(USB_ClassInfo_CDC_t* CDCInterfaceInfo)
ATTR_WEAK ATTR_ALIAS(CDC_Device_Event_Stub);
void EVENT_CDC_Device_ControLineStateChanged(USB_ClassInfo_CDC_t* CDCInterfaceInfo)
ATTR_WEAK ATTR_ALIAS(CDC_Device_Event_Stub);
#endif
/** Configures the endpoints of a given CDC interface, ready for use. This should be linked to the library
@ -201,21 +201,21 @@
*
* \return Boolean true if the endpoints were sucessfully configured, false otherwise
*/
bool USB_CDC_ConfigureEndpoints(USB_ClassInfo_CDC_t* CDCInterfaceInfo);
bool CDC_Device_ConfigureEndpoints(USB_ClassInfo_CDC_t* CDCInterfaceInfo);
/** Processes incomming control requests from the host, that are directed to the given CDC class interface. This should be
* linked to the library \ref EVENT_USB_UnhandledControlPacket() event.
*
* \param CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state.
*/
void USB_CDC_ProcessControlPacket(USB_ClassInfo_CDC_t* CDCInterfaceInfo);
void CDC_Device_ProcessControlPacket(USB_ClassInfo_CDC_t* CDCInterfaceInfo);
/** General management task for a given CDC class interface, required for the correct operation of the interface. This should
* be called frequently in the main program loop, before the master USB management task \ref USB_USBTask().
*
* \param CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state.
*/
void USB_CDC_USBTask(USB_ClassInfo_CDC_t* CDCInterfaceInfo);
void CDC_Device_USBTask(USB_ClassInfo_CDC_t* CDCInterfaceInfo);
/** CDC class driver event for a line encoding change on a CDC interface. This event fires each time the host requests a
* line encoding change (containing the serial parity, baud and other configuration information) and may be hooked in the
@ -224,7 +224,7 @@
*
* \param CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state.
*/
void EVENT_USB_CDC_LineEncodingChanged(USB_ClassInfo_CDC_t* CDCInterfaceInfo);
void EVENT_CDC_Device_LineEncodingChanged(USB_ClassInfo_CDC_t* CDCInterfaceInfo);
/** CDC class driver event for a control line state change on a CDC interface. This event fires each time the host requests a
* control line state change (containing the virtual serial control line states, such as DTR) and may be hooked in the
@ -234,7 +234,7 @@
*
* \param CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state.
*/
void EVENT_USB_CDC_ControLineStateChanged(USB_ClassInfo_CDC_t* CDCInterfaceInfo);
void EVENT_CDC_Device_ControLineStateChanged(USB_ClassInfo_CDC_t* CDCInterfaceInfo);
/** Sends a given string to the attached USB host, if connected. If a host is not connected when the function is called, the
* string is discarded.
@ -243,7 +243,7 @@
* \param Data Pointer to the string to send to the host
* \param Length Size in bytes of the string to send to the host
*/
void USB_CDC_SendString(USB_ClassInfo_CDC_t* CDCInterfaceInfo, char* Data, uint16_t Length);
void CDC_Device_SendString(USB_ClassInfo_CDC_t* CDCInterfaceInfo, char* Data, uint16_t Length);
/** Sends a given byte to the attached USB host, if connected. If a host is not connected when the function is called, the
* byte is discarded.
@ -251,7 +251,7 @@
* \param CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state.
* \param Data Byte of data to send to the host
*/
void USB_CDC_SendByte(USB_ClassInfo_CDC_t* CDCInterfaceInfo, uint8_t Data);
void CDC_Device_SendByte(USB_ClassInfo_CDC_t* CDCInterfaceInfo, uint8_t Data);
/** Determines the number of bytes received by the CDC interface from the host, waiting to be read.
*
@ -259,7 +259,7 @@
*
* \return Total number of buffered bytes received from the host
*/
uint16_t USB_CDC_BytesReceived(USB_ClassInfo_CDC_t* CDCInterfaceInfo);
uint16_t CDC_Device_BytesReceived(USB_ClassInfo_CDC_t* CDCInterfaceInfo);
/** Reads a byte of data from the host. If no data is waiting to be read of if a USB host is not connected, the function
* returns 0. The USB_CDC_BytesReceived() function should be queried before data is recieved to ensure that no data
@ -269,7 +269,7 @@
*
* \return Next received byte from the host, or 0 if no data received
*/
uint8_t USB_CDC_ReceiveByte(USB_ClassInfo_CDC_t* CDCInterfaceInfo);
uint8_t CDC_Device_ReceiveByte(USB_ClassInfo_CDC_t* CDCInterfaceInfo);
/** Sends a Serial Control Line State Change notification to the host. This should be called when the virtual serial control
* lines (DCD, DSR, etc.) have changed states, or to give BREAK notfications to the host. Line states persist until they are
@ -278,7 +278,7 @@
* \param CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state.
* \param LineStateMask Mask of CDC_CONTROL_LINE_IN_* masks giving the current control line states
*/
void USB_CDC_SendSerialLineStateChange(USB_ClassInfo_CDC_t* CDCInterfaceInfo, uint16_t LineStateMask);
void CDC_Device_SendControlLineStateChange(USB_ClassInfo_CDC_t* CDCInterfaceInfo, uint16_t LineStateMask);
/* Disable C linkage for C++ Compilers: */
#if defined(__cplusplus)

@ -30,7 +30,7 @@
#include "HID.h"
void USB_HID_ProcessControlPacket(USB_ClassInfo_HID_t* HIDInterfaceInfo)
void HID_Device_ProcessControlPacket(USB_ClassInfo_HID_t* HIDInterfaceInfo)
{
if (!(Endpoint_IsSETUPReceived()))
return;
@ -51,7 +51,7 @@ void USB_HID_ProcessControlPacket(USB_ClassInfo_HID_t* HIDInterfaceInfo)
memset(ReportINData, 0, sizeof(ReportINData));
ReportINSize = CALLBACK_USB_HID_CreateNextHIDReport(HIDInterfaceInfo, &ReportID, ReportINData);
ReportINSize = CALLBACK_HID_Device_CreateHIDReport(HIDInterfaceInfo, &ReportID, ReportINData);
Endpoint_Write_Control_Stream_LE(ReportINData, ReportINSize);
Endpoint_ClearOUT();
@ -70,7 +70,7 @@ void USB_HID_ProcessControlPacket(USB_ClassInfo_HID_t* HIDInterfaceInfo)
Endpoint_Read_Control_Stream_LE(ReportOUTData, ReportOUTSize);
Endpoint_ClearIN();
CALLBACK_USB_HID_ProcessReceivedHIDReport(HIDInterfaceInfo, ReportID, ReportOUTData, ReportOUTSize);
CALLBACK_HID_Device_ProcessHIDReport(HIDInterfaceInfo, ReportID, ReportOUTData, ReportOUTSize);
}
break;
@ -127,7 +127,7 @@ void USB_HID_ProcessControlPacket(USB_ClassInfo_HID_t* HIDInterfaceInfo)
}
}
bool USB_HID_ConfigureEndpoints(USB_ClassInfo_HID_t* HIDInterfaceInfo)
bool HID_Device_ConfigureEndpoints(USB_ClassInfo_HID_t* HIDInterfaceInfo)
{
HIDInterfaceInfo->UsingReportProtocol = true;
@ -140,7 +140,7 @@ bool USB_HID_ConfigureEndpoints(USB_ClassInfo_HID_t* HIDInterfaceInfo)
return true;
}
void USB_HID_USBTask(USB_ClassInfo_HID_t* HIDInterfaceInfo)
void HID_Device_USBTask(USB_ClassInfo_HID_t* HIDInterfaceInfo)
{
if (!(USB_IsConnected))
return;
@ -159,7 +159,7 @@ void USB_HID_USBTask(USB_ClassInfo_HID_t* HIDInterfaceInfo)
memset(ReportINData, 0, sizeof(ReportINData));
ReportINSize = CALLBACK_USB_HID_CreateNextHIDReport(HIDInterfaceInfo, &ReportID, ReportINData);
ReportINSize = CALLBACK_HID_Device_CreateHIDReport(HIDInterfaceInfo, &ReportID, ReportINData);
if (ReportINSize)
{

@ -131,21 +131,21 @@
*
* \return Boolean true if the endpoints were sucessfully configured, false otherwise
*/
bool USB_HID_ConfigureEndpoints(USB_ClassInfo_HID_t* HIDInterfaceInfo);
bool HID_Device_ConfigureEndpoints(USB_ClassInfo_HID_t* HIDInterfaceInfo);
/** Processes incomming control requests from the host, that are directed to the given HID class interface. This should be
* linked to the library \ref EVENT_USB_UnhandledControlPacket() event.
*
* \param HIDInterfaceInfo Pointer to a structure containing a HID Class configuration and state.
*/
void USB_HID_ProcessControlPacket(USB_ClassInfo_HID_t* HIDInterfaceInfo);
void HID_Device_ProcessControlPacket(USB_ClassInfo_HID_t* HIDInterfaceInfo);
/** General management task for a given HID class interface, required for the correct operation of the interface. This should
* be called frequently in the main program loop, before the master USB management task \ref USB_USBTask().
*
* \param HIDInterfaceInfo Pointer to a structure containing a HID Class configuration and state.
*/
void USB_HID_USBTask(USB_ClassInfo_HID_t* HIDInterfaceInfo);
void HID_Device_USBTask(USB_ClassInfo_HID_t* HIDInterfaceInfo);
/** HID class driver callback for the user creation of a HID input report. This callback may fire in response to either
* HID class control requests from the host, or by the normal HID endpoint polling procedure. Inside this callback the
@ -159,7 +159,7 @@
*
* \return Number of bytes in the generated input 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);
/** HID class driver callback for the user processing of a received HID input report. This callback may fire in response to
* either HID class control requests from the host, or by the normal HID endpoint polling procedure. Inside this callback
@ -171,7 +171,8 @@
* \param ReportData Pointer to a buffer where the received HID report is stored.
* \param ReportSize Size in bytes of the received report from the host.
*/
void CALLBACK_USB_HID_ProcessReceivedHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t ReportID, void* ReportData, uint16_t ReportSize);
void CALLBACK_HID_Device_ProcessHIDReport(USB_ClassInfo_HID_t* HIDInterfaceInfo, uint8_t ReportID, void* ReportData,
uint16_t ReportSize);
/* Disable C linkage for C++ Compilers: */
#if defined(__cplusplus)

@ -30,12 +30,12 @@
#include "MIDI.h"
void USB_MIDI_ProcessControlPacket(USB_ClassInfo_MIDI_t* MIDIInterfaceInfo)
void MIDI_Device_ProcessControlPacket(USB_ClassInfo_MIDI_t* MIDIInterfaceInfo)
{
}
bool USB_MIDI_ConfigureEndpoints(USB_ClassInfo_MIDI_t* MIDIInterfaceInfo)
bool MIDI_Device_ConfigureEndpoints(USB_ClassInfo_MIDI_t* MIDIInterfaceInfo)
{
if (MIDIInterfaceInfo->DataINEndpointNumber)
{
@ -60,12 +60,12 @@ bool USB_MIDI_ConfigureEndpoints(USB_ClassInfo_MIDI_t* MIDIInterfaceInfo)
return true;
}
void USB_MIDI_USBTask(USB_ClassInfo_MIDI_t* MIDIInterfaceInfo)
void MIDI_Device_USBTask(USB_ClassInfo_MIDI_t* MIDIInterfaceInfo)
{
}
void USB_MIDI_SendEventPacket(USB_ClassInfo_MIDI_t* MIDIInterfaceInfo, USB_MIDI_EventPacket_t* Event)
void MIDI_Device_SendEventPacket(USB_ClassInfo_MIDI_t* MIDIInterfaceInfo, USB_MIDI_EventPacket_t* Event)
{
if (!(USB_IsConnected))
return;
@ -79,7 +79,7 @@ void USB_MIDI_SendEventPacket(USB_ClassInfo_MIDI_t* MIDIInterfaceInfo, USB_MIDI_
}
}
bool USB_MIDI_ReceiveEventPacket(USB_ClassInfo_MIDI_t* MIDIInterfaceInfo, USB_MIDI_EventPacket_t* Event)
bool MIDI_Device_ReceiveEventPacket(USB_ClassInfo_MIDI_t* MIDIInterfaceInfo, USB_MIDI_EventPacket_t* Event)
{
if (!(USB_IsConnected))
return false;

@ -181,28 +181,28 @@
*
* \return Boolean true if the endpoints were sucessfully configured, false otherwise
*/
bool USB_MIDI_ConfigureEndpoints(USB_ClassInfo_MIDI_t* MIDIInterfaceInfo);
bool MIDI_Device_ConfigureEndpoints(USB_ClassInfo_MIDI_t* MIDIInterfaceInfo);
/** Processes incomming control requests from the host, that are directed to the given MIDI class interface. This should be
* linked to the library \ref EVENT_USB_UnhandledControlPacket() event.
*
* \param MIDIInterfaceInfo Pointer to a structure containing a MIDI Class configuration and state.
*/
void USB_MIDI_ProcessControlPacket(USB_ClassInfo_MIDI_t* MIDIInterfaceInfo);
void MIDI_Device_ProcessControlPacket(USB_ClassInfo_MIDI_t* MIDIInterfaceInfo);
/** General management task for a given MIDI class interface, required for the correct operation of the interface. This should
* be called frequently in the main program loop, before the master USB management task \ref USB_USBTask().
*
* \param MIDIInterfaceInfo Pointer to a structure containing a MIDI Class configuration and state.
*/
void USB_MIDI_USBTask(USB_ClassInfo_MIDI_t* MIDIInterfaceInfo);
void MIDI_Device_USBTask(USB_ClassInfo_MIDI_t* MIDIInterfaceInfo);
/** Sends a MIDI event packet to the host. If no host is connected, the event packet is discarded.
*
* \param MIDIInterfaceInfo Pointer to a structure containing a MIDI Class configuration and state.
* \param Event Pointer to a populated USB_MIDI_EventPacket_t structure containing the MIDI event to send
*/
void USB_MIDI_SendEventPacket(USB_ClassInfo_MIDI_t* MIDIInterfaceInfo, USB_MIDI_EventPacket_t* Event);
void MIDI_Device_SendEventPacket(USB_ClassInfo_MIDI_t* MIDIInterfaceInfo, USB_MIDI_EventPacket_t* Event);
/** Receives a MIDI event packet from the host.
*
@ -211,7 +211,7 @@
*
* \return Boolean true if a MIDI event packet was received, false otherwise
*/
bool USB_MIDI_ReceiveEventPacket(USB_ClassInfo_MIDI_t* MIDIInterfaceInfo, USB_MIDI_EventPacket_t* Event);
bool MIDI_Device_ReceiveEventPacket(USB_ClassInfo_MIDI_t* MIDIInterfaceInfo, USB_MIDI_EventPacket_t* Event);
/* Disable C linkage for C++ Compilers: */
#if defined(__cplusplus)

@ -33,7 +33,7 @@
static USB_ClassInfo_MS_t* CallbackMSInterfaceInfo;
void USB_MS_ProcessControlPacket(USB_ClassInfo_MS_t* MSInterfaceInfo)
void MS_Device_ProcessControlPacket(USB_ClassInfo_MS_t* MSInterfaceInfo)
{
if (!(Endpoint_IsSETUPReceived()))
return;
@ -72,7 +72,7 @@ void USB_MS_ProcessControlPacket(USB_ClassInfo_MS_t* MSInterfaceInfo)
}
}
bool USB_MS_ConfigureEndpoints(USB_ClassInfo_MS_t* MSInterfaceInfo)
bool MS_Device_ConfigureEndpoints(USB_ClassInfo_MS_t* MSInterfaceInfo)
{
if (!(Endpoint_ConfigureEndpoint(MSInterfaceInfo->DataINEndpointNumber, EP_TYPE_BULK,
ENDPOINT_DIR_IN, MSInterfaceInfo->DataINEndpointSize,
@ -91,7 +91,7 @@ bool USB_MS_ConfigureEndpoints(USB_ClassInfo_MS_t* MSInterfaceInfo)
return true;
}
void USB_MS_USBTask(USB_ClassInfo_MS_t* MSInterfaceInfo)
void MS_Device_USBTask(USB_ClassInfo_MS_t* MSInterfaceInfo)
{
if (!(USB_IsConnected))
return;
@ -100,12 +100,12 @@ void USB_MS_USBTask(USB_ClassInfo_MS_t* MSInterfaceInfo)
if (Endpoint_IsReadWriteAllowed())
{
if (USB_MS_ReadInCommandBlock(MSInterfaceInfo))
if (MS_Device_ReadInCommandBlock(MSInterfaceInfo))
{
if (MSInterfaceInfo->CommandBlock.Flags & MS_COMMAND_DIR_DATA_IN)
Endpoint_SelectEndpoint(MSInterfaceInfo->DataINEndpointNumber);
MSInterfaceInfo->CommandStatus.Status = CALLBACK_USB_MS_SCSICommandReceived(MSInterfaceInfo) ?
MSInterfaceInfo->CommandStatus.Status = CALLBACK_MS_Device_SCSICommandReceived(MSInterfaceInfo) ?
SCSI_Command_Pass : SCSI_Command_Fail;
MSInterfaceInfo->CommandStatus.Signature = MS_CSW_SIGNATURE;
MSInterfaceInfo->CommandStatus.Tag = MSInterfaceInfo->CommandBlock.Tag;
@ -114,7 +114,7 @@ void USB_MS_USBTask(USB_ClassInfo_MS_t* MSInterfaceInfo)
if ((MSInterfaceInfo->CommandStatus.Status == SCSI_Command_Fail) && (MSInterfaceInfo->CommandStatus.DataTransferResidue))
Endpoint_StallTransaction();
USB_MS_ReturnCommandStatus(MSInterfaceInfo);
MS_Device_ReturnCommandStatus(MSInterfaceInfo);
if (MSInterfaceInfo->IsMassStoreReset)
{
@ -132,14 +132,14 @@ void USB_MS_USBTask(USB_ClassInfo_MS_t* MSInterfaceInfo)
}
}
static bool USB_MS_ReadInCommandBlock(USB_ClassInfo_MS_t* MSInterfaceInfo)
static bool MS_Device_ReadInCommandBlock(USB_ClassInfo_MS_t* MSInterfaceInfo)
{
Endpoint_SelectEndpoint(MSInterfaceInfo->DataOUTEndpointNumber);
CallbackMSInterfaceInfo = MSInterfaceInfo;
Endpoint_Read_Stream_LE(&MSInterfaceInfo->CommandBlock,
(sizeof(CommandBlockWrapper_t) - 16),
StreamCallback_AbortOnMassStoreReset);
StreamCallback_MS_Device_AbortOnMassStoreReset);
if ((MSInterfaceInfo->CommandBlock.Signature != MS_CBW_SIGNATURE) ||
(MSInterfaceInfo->CommandBlock.LUN >= MSInterfaceInfo->TotalLUNs) ||
@ -155,7 +155,7 @@ static bool USB_MS_ReadInCommandBlock(USB_ClassInfo_MS_t* MSInterfaceInfo)
CallbackMSInterfaceInfo = MSInterfaceInfo;
Endpoint_Read_Stream_LE(&MSInterfaceInfo->CommandBlock.SCSICommandData,
MSInterfaceInfo->CommandBlock.SCSICommandLength,
StreamCallback_AbortOnMassStoreReset);
StreamCallback_MS_Device_AbortOnMassStoreReset);
Endpoint_ClearOUT();
@ -165,7 +165,7 @@ static bool USB_MS_ReadInCommandBlock(USB_ClassInfo_MS_t* MSInterfaceInfo)
return true;
}
static void USB_MS_ReturnCommandStatus(USB_ClassInfo_MS_t* MSInterfaceInfo)
static void MS_Device_ReturnCommandStatus(USB_ClassInfo_MS_t* MSInterfaceInfo)
{
Endpoint_SelectEndpoint(MSInterfaceInfo->DataOUTEndpointNumber);
@ -189,7 +189,7 @@ static void USB_MS_ReturnCommandStatus(USB_ClassInfo_MS_t* MSInterfaceInfo)
CallbackMSInterfaceInfo = MSInterfaceInfo;
Endpoint_Write_Stream_LE(&MSInterfaceInfo->CommandStatus, sizeof(CommandStatusWrapper_t),
StreamCallback_AbortOnMassStoreReset);
StreamCallback_MS_Device_AbortOnMassStoreReset);
Endpoint_ClearIN();
@ -197,9 +197,9 @@ static void USB_MS_ReturnCommandStatus(USB_ClassInfo_MS_t* MSInterfaceInfo)
return;
}
static uint8_t StreamCallback_AbortOnMassStoreReset(void)
static uint8_t StreamCallback_MS_Device_AbortOnMassStoreReset(void)
{
USB_MS_USBTask(CallbackMSInterfaceInfo);
MS_Device_USBTask(CallbackMSInterfaceInfo);
if (CallbackMSInterfaceInfo->IsMassStoreReset)
return STREAMCALLBACK_Abort;

@ -137,9 +137,9 @@
/* Function Prototypes: */
#if defined(INCLUDE_FROM_MS_CLASS_C)
static void USB_MS_ReturnCommandStatus(USB_ClassInfo_MS_t* MSInterfaceInfo);
static bool USB_MS_ReadInCommandBlock(USB_ClassInfo_MS_t* MSInterfaceInfo);
static uint8_t StreamCallback_AbortOnMassStoreReset(void);
static void MS_Device_ReturnCommandStatus(USB_ClassInfo_MS_t* MSInterfaceInfo);
static bool MS_Device_ReadInCommandBlock(USB_ClassInfo_MS_t* MSInterfaceInfo);
static uint8_t StreamCallback_MS_Device_AbortOnMassStoreReset(void);
#endif
/** Configures the endpoints of a given Mass Storage interface, ready for use. This should be linked to the library
@ -150,21 +150,21 @@
*
* \return Boolean true if the endpoints were sucessfully configured, false otherwise
*/
bool USB_MS_ConfigureEndpoints(USB_ClassInfo_MS_t* MSInterfaceInfo);
bool MS_Device_ConfigureEndpoints(USB_ClassInfo_MS_t* MSInterfaceInfo);
/** Processes incomming control requests from the host, that are directed to the given Mass Storage class interface. This should be
* linked to the library \ref EVENT_USB_UnhandledControlPacket() event.
*
* \param MSInterfaceInfo Pointer to a structure containing a Mass Storage Class configuration and state.
*/
void USB_MS_ProcessControlPacket(USB_ClassInfo_MS_t* MSInterfaceInfo);
void MS_Device_ProcessControlPacket(USB_ClassInfo_MS_t* MSInterfaceInfo);
/** General management task for a given Mass Storage class interface, required for the correct operation of the interface. This should
* be called frequently in the main program loop, before the master USB management task \ref USB_USBTask().
*
* \param MSInterfaceInfo Pointer to a structure containing a Mass Storage configuration and state.
*/
void USB_MS_USBTask(USB_ClassInfo_MS_t* MSInterfaceInfo);
void MS_Device_USBTask(USB_ClassInfo_MS_t* MSInterfaceInfo);
/** Mass Storage class driver callback for the user processing of a received SCSI command. This callback will fire each time the
* host sends a SCSI command which requires processing by the user application. Inside this callback the user is responsible
@ -175,7 +175,7 @@
*
* \return Boolean true if the SCSI command was successfully processed, false otherwise
*/
bool CALLBACK_USB_MS_SCSICommandReceived(USB_ClassInfo_MS_t* MSInterfaceInfo);
bool CALLBACK_MS_Device_SCSICommandReceived(USB_ClassInfo_MS_t* MSInterfaceInfo);
/* Disable C linkage for C++ Compilers: */
#if defined(__cplusplus)

@ -62,7 +62,7 @@ static const uint32_t PROGMEM AdapterSupportedOIDList[] =
OID_802_3_XMIT_MORE_COLLISIONS,
};
void USB_RNDIS_ProcessControlPacket(USB_ClassInfo_RNDIS_t* RNDISInterfaceInfo)
void RNDIS_Device_ProcessControlPacket(USB_ClassInfo_RNDIS_t* RNDISInterfaceInfo)
{
if (!(Endpoint_IsSETUPReceived()))
return;
@ -80,7 +80,7 @@ void USB_RNDIS_ProcessControlPacket(USB_ClassInfo_RNDIS_t* RNDISInterfaceInfo)
Endpoint_Read_Control_Stream_LE(RNDISInterfaceInfo->RNDISMessageBuffer, USB_ControlRequest.wLength);
Endpoint_ClearIN();
USB_RNDIS_ProcessRNDISControlMessage(RNDISInterfaceInfo);
RNDIS_Device_ProcessRNDISControlMessage(RNDISInterfaceInfo);
}
break;
@ -107,7 +107,7 @@ void USB_RNDIS_ProcessControlPacket(USB_ClassInfo_RNDIS_t* RNDISInterfaceInfo)
}
}
bool USB_RNDIS_ConfigureEndpoints(USB_ClassInfo_RNDIS_t* RNDISInterfaceInfo)
bool RNDIS_Device_ConfigureEndpoints(USB_ClassInfo_RNDIS_t* RNDISInterfaceInfo)
{
if (!(Endpoint_ConfigureEndpoint(RNDISInterfaceInfo->DataINEndpointNumber, EP_TYPE_BULK,
ENDPOINT_DIR_IN, RNDISInterfaceInfo->DataINEndpointSize,
@ -133,7 +133,7 @@ bool USB_RNDIS_ConfigureEndpoints(USB_ClassInfo_RNDIS_t* RNDISInterfaceInfo)
return true;
}
void USB_RNDIS_USBTask(USB_ClassInfo_RNDIS_t* RNDISInterfaceInfo)
void RNDIS_Device_USBTask(USB_ClassInfo_RNDIS_t* RNDISInterfaceInfo)
{
if (!(USB_IsConnected))
return;
@ -205,7 +205,7 @@ void USB_RNDIS_USBTask(USB_ClassInfo_RNDIS_t* RNDISInterfaceInfo)
}
}
void USB_RNDIS_ProcessRNDISControlMessage(USB_ClassInfo_RNDIS_t* RNDISInterfaceInfo)
void RNDIS_Device_ProcessRNDISControlMessage(USB_ClassInfo_RNDIS_t* RNDISInterfaceInfo)
{
/* Note: Only a single buffer is used for both the received message and its response to save SRAM. Because of
this, response bytes should be filled in order so that they do not clobber unread data in the buffer. */
@ -260,8 +260,8 @@ void USB_RNDIS_ProcessRNDISControlMessage(USB_ClassInfo_RNDIS_t* RNDISInterfaceI
QUERY_Response->MessageType = REMOTE_NDIS_QUERY_CMPLT;
QUERY_Response->MessageLength = sizeof(RNDIS_QUERY_CMPLT_t);
if (USB_RNDIS_ProcessNDISQuery(RNDISInterfaceInfo, Query_Oid, QueryData, QUERY_Message->InformationBufferLength,
ResponseData, &ResponseSize))
if (RNDIS_Device_ProcessNDISQuery(RNDISInterfaceInfo, Query_Oid, QueryData, QUERY_Message->InformationBufferLength,
ResponseData, &ResponseSize))
{
QUERY_Response->Status = REMOTE_NDIS_STATUS_SUCCESS;
QUERY_Response->MessageLength += ResponseSize;
@ -292,7 +292,7 @@ void USB_RNDIS_ProcessRNDISControlMessage(USB_ClassInfo_RNDIS_t* RNDISInterfaceI
void* SetData = &RNDISInterfaceInfo->RNDISMessageBuffer[sizeof(RNDIS_Message_Header_t) +
SET_Message->InformationBufferOffset];
if (USB_RNDIS_ProcessNDISSet(RNDISInterfaceInfo, SET_Oid, SetData, SET_Message->InformationBufferLength))
if (RNDIS_Device_ProcessNDISSet(RNDISInterfaceInfo, SET_Oid, SetData, SET_Message->InformationBufferLength))
SET_Response->Status = REMOTE_NDIS_STATUS_SUCCESS;
else
SET_Response->Status = REMOTE_NDIS_STATUS_NOT_SUPPORTED;
@ -324,9 +324,9 @@ void USB_RNDIS_ProcessRNDISControlMessage(USB_ClassInfo_RNDIS_t* RNDISInterfaceI
}
}
static bool USB_RNDIS_ProcessNDISQuery(USB_ClassInfo_RNDIS_t* RNDISInterfaceInfo,
uint32_t OId, void* QueryData, uint16_t QuerySize,
void* ResponseData, uint16_t* ResponseSize)
static bool RNDIS_Device_ProcessNDISQuery(USB_ClassInfo_RNDIS_t* RNDISInterfaceInfo,
uint32_t OId, void* QueryData, uint16_t QuerySize,
void* ResponseData, uint16_t* ResponseSize)
{
switch (OId)
{
@ -436,7 +436,7 @@ static bool USB_RNDIS_ProcessNDISQuery(USB_ClassInfo_RNDIS_t* RNDISInterfaceInfo
}
}
static bool USB_RNDIS_ProcessNDISSet(USB_ClassInfo_RNDIS_t* RNDISInterfaceInfo, uint32_t OId, void* SetData, uint16_t SetSize)
static bool RNDIS_Device_ProcessNDISSet(USB_ClassInfo_RNDIS_t* RNDISInterfaceInfo, uint32_t OId, void* SetData, uint16_t SetSize)
{
switch (OId)
{

@ -277,12 +277,12 @@
/* Function Prototypes: */
#if defined(INCLUDE_FROM_RNDIS_CLASS_C)
static void USB_RNDIS_ProcessRNDISControlMessage(USB_ClassInfo_RNDIS_t* RNDISInterfaceInfo);
static bool USB_RNDIS_ProcessNDISQuery(USB_ClassInfo_RNDIS_t* RNDISInterfaceInfo,
uint32_t OId, void* QueryData, uint16_t QuerySize,
void* ResponseData, uint16_t* ResponseSize);
static bool USB_RNDIS_ProcessNDISSet(USB_ClassInfo_RNDIS_t* RNDISInterfaceInfo, uint32_t OId,
void* SetData, uint16_t SetSize);
static void RNDIS_Device_ProcessRNDISControlMessage(USB_ClassInfo_RNDIS_t* RNDISInterfaceInfo);
static bool RNDIS_Device_ProcessNDISQuery(USB_ClassInfo_RNDIS_t* RNDISInterfaceInfo,
uint32_t OId, void* QueryData, uint16_t QuerySize,
void* ResponseData, uint16_t* ResponseSize);
static bool RNDIS_Device_ProcessNDISSet(USB_ClassInfo_RNDIS_t* RNDISInterfaceInfo, uint32_t OId,
void* SetData, uint16_t SetSize);
#endif
/** Configures the endpoints of a given RNDIS interface, ready for use. This should be linked to the library
@ -293,21 +293,21 @@
*
* \return Boolean true if the endpoints were sucessfully configured, false otherwise
*/
bool USB_RNDIS_ConfigureEndpoints(USB_ClassInfo_RNDIS_t* RNDISInterfaceInfo);
bool RNDIS_Device_ConfigureEndpoints(USB_ClassInfo_RNDIS_t* RNDISInterfaceInfo);
/** Processes incomming control requests from the host, that are directed to the given RNDIS class interface. This should be
* linked to the library \ref EVENT_USB_UnhandledControlPacket() event.
*
* \param RNDISInterfaceInfo Pointer to a structure containing a RNDIS Class configuration and state.
*/
void USB_RNDIS_ProcessControlPacket(USB_ClassInfo_RNDIS_t* RNDISInterfaceInfo);
void RNDIS_Device_ProcessControlPacket(USB_ClassInfo_RNDIS_t* RNDISInterfaceInfo);
/** General management task for a given HID class interface, required for the correct operation of the interface. This should
* be called frequently in the main program loop, before the master USB management task \ref USB_USBTask().
*
* \param RNDISInterfaceInfo Pointer to a structure containing a RNDIS Class configuration and state.
*/
void USB_RNDIS_USBTask(USB_ClassInfo_RNDIS_t* RNDISInterfaceInfo);
void RNDIS_Device_USBTask(USB_ClassInfo_RNDIS_t* RNDISInterfaceInfo);
/* Disable C linkage for C++ Compilers: */
#if defined(__cplusplus)

Loading…
Cancel
Save