Remove VBUS events - not needed as the library takes care of VBUS detection and feedback on supported AVRs via the USB_Device_Connected and USB_Device_Disconnected events.
Fixed incorrect Host state assignment in the incomplete BluetoothHost demo.
/** Event handler for the USB_Disconnect event. This indicates that the bootloader should exit and the user\r
* application started.\r
*/\r
-void EVENT_USB_Disconnect(void)\r
+void EVENT_USB_Device_Disconnect(void)\r
{\r
/* Upon disconnection, run user application */\r
RunBootloader = false;\r
/** Event handler for the USB_ConfigurationChanged event. This configures the device's endpoints ready\r
* to relay data to and from the attached USB host.\r
*/\r
-void EVENT_USB_ConfigurationChanged(void)\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
{\r
/* Setup CDC Notification, Rx and Tx Endpoints */\r
Endpoint_ConfigureEndpoint(CDC_NOTIFICATION_EPNUM, EP_TYPE_INTERRUPT,\r
ENDPOINT_BANK_SINGLE);\r
}\r
\r
-/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific\r
+/** Event handler for the USB_UnhandledControlRequest event. This is used to catch standard and class specific\r
* control requests that are not handled internally by the USB library, so that they can be handled appropriately\r
* for the application.\r
*/\r
-void EVENT_USB_UnhandledControlPacket(void)\r
+void EVENT_USB_Device_UnhandledControlRequest(void)\r
{\r
uint8_t* LineCodingData = (uint8_t*)&LineCoding;\r
\r
void SetupHardware(void);\r
void ResetHardware(void);\r
\r
- void EVENT_USB_Disconnect(void);\r
- void EVENT_USB_ConfigurationChanged(void);\r
- void EVENT_USB_UnhandledControlPacket(void);\r
+ void EVENT_USB_Device_Disconnect(void);\r
+ void EVENT_USB_Device_ConfigurationChanged(void);\r
+ void EVENT_USB_Device_UnhandledControlRequest(void);\r
\r
#if defined(INCLUDE_FROM_BOOTLOADERCDC_C) || defined(__DOXYGEN__)\r
static void ReadWriteMemoryBlock(const uint8_t Command);\r
/** Event handler for the USB_Disconnect event. This indicates that the bootloader should exit and the user\r
* application started.\r
*/\r
-void EVENT_USB_Disconnect(void)\r
+void EVENT_USB_Device_Disconnect(void)\r
{\r
/* Upon disconnection, run user application */\r
RunBootloader = false;\r
}\r
\r
-/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific\r
+/** Event handler for the USB_UnhandledControlRequest event. This is used to catch standard and class specific\r
* control requests that are not handled internally by the USB library (including the DFU commands, which are\r
* all issued via the control endpoint), so that they can be handled appropriately for the application.\r
*/\r
-void EVENT_USB_UnhandledControlPacket(void)\r
+void EVENT_USB_Device_UnhandledControlRequest(void)\r
{\r
/* Get the size of the command and data from the wLength value */\r
SentCommand.DataSize = USB_ControlRequest.wLength;\r
void SetupHardware(void);\r
void ResetHardware(void);\r
\r
- void EVENT_USB_Disconnect(void);\r
- void EVENT_USB_UnhandledControlPacket(void);\r
+ void EVENT_USB_Device_Disconnect(void);\r
+ void EVENT_USB_Device_UnhandledControlRequest(void);\r
\r
#if defined(INCLUDE_FROM_BOOTLOADER_C)\r
static void DiscardFillerBytes(uint8_t NumberOfBytes);\r
/** Event handler for the USB_ConfigurationChanged event. This configures the device's endpoints ready\r
* to relay data to and from the attached USB host.\r
*/\r
-void EVENT_USB_ConfigurationChanged(void)\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
{\r
/* Setup HID Report Endpoint */\r
Endpoint_ConfigureEndpoint(HID_EPNUM, EP_TYPE_INTERRUPT,\r
ENDPOINT_BANK_SINGLE);\r
}\r
\r
-/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific\r
+/** Event handler for the USB_UnhandledControlRequest event. This is used to catch standard and class specific\r
* control requests that are not handled internally by the USB library (including the HID commands, which are\r
* all issued via the control endpoint), so that they can be handled appropriately for the application.\r
*/\r
-void EVENT_USB_UnhandledControlPacket(void)\r
+void EVENT_USB_Device_UnhandledControlRequest(void)\r
{\r
/* Handle HID Class specific requests */\r
switch (USB_ControlRequest.bRequest)\r
/* Function Prototypes: */\r
void SetupHardware(void);\r
\r
- void EVENT_USB_ConfigurationChanged(void);\r
- void EVENT_USB_UnhandledControlPacket(void);\r
+ void EVENT_USB_Device_ConfigurationChanged(void);\r
+ void EVENT_USB_Device_UnhandledControlRequest(void);\r
\r
#endif\r
* This bootloader enumerates to the host as a HID Class device, allowing for Teensy compatible programming\r
* software to load firmware onto the AVR, such as the official software at http://www.pjrc.com/teensy/.\r
* \r
- * Out of the box this bootloader builds for the USB162, and will fit into 2KB of bootloader space.\r
+ * Out of the box this bootloader builds for the AT90USB162, and will fit into 4KB of bootloader space.\r
*\r
* This spoofs (with permission) the official Teensy bootloader's VID and PID, so that the software remains\r
* compatible with no changes.\r
}\r
\r
/** Event handler for the library USB Connection event. */\r
-void EVENT_USB_Connect(void)\r
+void EVENT_USB_Device_Connect(void)\r
{\r
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
\r
}\r
\r
/** Event handler for the library USB Disconnection event. */\r
-void EVENT_USB_Disconnect(void)\r
+void EVENT_USB_Device_Disconnect(void)\r
{\r
/* Stop the sample reload timer */\r
TCCR0B = 0;\r
}\r
\r
/** Event handler for the library USB Configuration Changed event. */\r
-void EVENT_USB_ConfigurationChanged(void)\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
{\r
LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
\r
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
}\r
\r
-/** Event handler for the library USB Unhandled Control Packet event. */\r
-void EVENT_USB_UnhandledControlPacket(void)\r
+/** Event handler for the library USB Unhandled Control Request event. */\r
+void EVENT_USB_Device_UnhandledControlRequest(void)\r
{\r
- Audio_Device_ProcessControlPacket(&Microphone_Audio_Interface);\r
+ Audio_Device_ProcessControlRequest(&Microphone_Audio_Interface);\r
}\r
void SetupHardware(void);\r
void ProcessNextSample(void);\r
\r
- void EVENT_USB_Connect(void);\r
- void EVENT_USB_Disconnect(void);\r
- void EVENT_USB_ConfigurationChanged(void);\r
- void EVENT_USB_UnhandledControlPacket(void);\r
+ void EVENT_USB_Device_Connect(void);\r
+ void EVENT_USB_Device_Disconnect(void);\r
+ void EVENT_USB_Device_ConfigurationChanged(void);\r
+ void EVENT_USB_Device_UnhandledControlRequest(void);\r
\r
#endif\r
}\r
\r
/** Event handler for the library USB Connection event. */\r
-void EVENT_USB_Connect(void)\r
+void EVENT_USB_Device_Connect(void)\r
{\r
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
\r
}\r
\r
/** Event handler for the library USB Disconnection event. */\r
-void EVENT_USB_Disconnect(void)\r
+void EVENT_USB_Device_Disconnect(void)\r
{\r
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
\r
}\r
\r
/** Event handler for the library USB Configuration Changed event. */\r
-void EVENT_USB_ConfigurationChanged(void)\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
{\r
LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
\r
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
}\r
\r
-/** Event handler for the library USB Unhandled Control Packet event. */\r
-void EVENT_USB_UnhandledControlPacket(void)\r
+/** Event handler for the library USB Unhandled Control Request event. */\r
+void EVENT_USB_Device_UnhandledControlRequest(void)\r
{\r
- Audio_Device_ProcessControlPacket(&Speaker_Audio_Interface);\r
+ Audio_Device_ProcessControlRequest(&Speaker_Audio_Interface);\r
}\r
void SetupHardware(void);\r
void ProcessNextSample(void);\r
\r
- void EVENT_USB_Connect(void);\r
- void EVENT_USB_Disconnect(void);\r
- void EVENT_USB_ConfigurationChanged(void);\r
- void EVENT_USB_UnhandledControlPacket(void);\r
+ void EVENT_USB_Device_Connect(void);\r
+ void EVENT_USB_Device_Disconnect(void);\r
+ void EVENT_USB_Device_ConfigurationChanged(void);\r
+ void EVENT_USB_Device_UnhandledControlRequest(void);\r
\r
#endif\r
}\r
\r
/** Event handler for the library USB Connection event. */\r
-void EVENT_USB_Connect(void)\r
+void EVENT_USB_Device_Connect(void)\r
{\r
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
}\r
\r
/** Event handler for the library USB Disconnection event. */\r
-void EVENT_USB_Disconnect(void)\r
+void EVENT_USB_Device_Disconnect(void)\r
{\r
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
}\r
\r
/** Event handler for the library USB Configuration Changed event. */\r
-void EVENT_USB_ConfigurationChanged(void)\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
{\r
LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
\r
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
}\r
\r
-/** Event handler for the library USB Unhandled Control Packet event. */\r
-void EVENT_USB_UnhandledControlPacket(void)\r
+/** Event handler for the library USB Unhandled Control Request event. */\r
+void EVENT_USB_Device_UnhandledControlRequest(void)\r
{\r
- CDC_Device_ProcessControlPacket(&VirtualSerial_CDC_Interface);\r
+ CDC_Device_ProcessControlRequest(&VirtualSerial_CDC_Interface);\r
}\r
void SetupHardware(void);\r
void CheckJoystickMovement(void);\r
\r
- void EVENT_USB_Connect(void);\r
- void EVENT_USB_Disconnect(void);\r
- void EVENT_USB_ConfigurationChanged(void);\r
- void EVENT_USB_UnhandledControlPacket(void);\r
+ void EVENT_USB_Device_Connect(void);\r
+ void EVENT_USB_Device_Disconnect(void);\r
+ void EVENT_USB_Device_ConfigurationChanged(void);\r
+ void EVENT_USB_Device_UnhandledControlRequest(void);\r
\r
#endif\r
}\r
\r
/** Event handler for the library USB Connection event. */\r
-void EVENT_USB_Connect(void)\r
+void EVENT_USB_Device_Connect(void)\r
{\r
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
}\r
\r
/** Event handler for the library USB Disconnection event. */\r
-void EVENT_USB_Disconnect(void)\r
+void EVENT_USB_Device_Disconnect(void)\r
{\r
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
}\r
\r
/** Event handler for the library USB Configuration Changed event. */\r
-void EVENT_USB_ConfigurationChanged(void)\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
{\r
LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
\r
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
}\r
\r
-/** Event handler for the library USB Unhandled Control Packet event. */\r
-void EVENT_USB_UnhandledControlPacket(void)\r
+/** Event handler for the library USB Unhandled Control Request event. */\r
+void EVENT_USB_Device_UnhandledControlRequest(void)\r
{\r
- CDC_Device_ProcessControlPacket(&VirtualSerial1_CDC_Interface);\r
- CDC_Device_ProcessControlPacket(&VirtualSerial2_CDC_Interface);\r
+ CDC_Device_ProcessControlRequest(&VirtualSerial1_CDC_Interface);\r
+ CDC_Device_ProcessControlRequest(&VirtualSerial2_CDC_Interface);\r
}\r
void SetupHardware(void);\r
void CheckJoystickMovement(void);\r
\r
- void EVENT_USB_Connect(void);\r
- void EVENT_USB_Disconnect(void);\r
- void EVENT_USB_ConfigurationChanged(void);\r
- void EVENT_USB_UnhandledControlPacket(void);\r
+ void EVENT_USB_Device_Connect(void);\r
+ void EVENT_USB_Device_Disconnect(void);\r
+ void EVENT_USB_Device_ConfigurationChanged(void);\r
+ void EVENT_USB_Device_UnhandledControlRequest(void);\r
\r
#endif\r
}\r
\r
/** Event handler for the library USB Connection event. */\r
-void EVENT_USB_Connect(void)\r
+void EVENT_USB_Device_Connect(void)\r
{\r
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
}\r
\r
/** Event handler for the library USB Disconnection event. */\r
-void EVENT_USB_Disconnect(void)\r
+void EVENT_USB_Device_Disconnect(void)\r
{\r
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
}\r
\r
/** Event handler for the library USB Configuration Changed event. */\r
-void EVENT_USB_ConfigurationChanged(void)\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
{\r
LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
\r
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
}\r
\r
-/** Event handler for the library USB Unhandled Control Packet event. */\r
-void EVENT_USB_UnhandledControlPacket(void)\r
+/** Event handler for the library USB Unhandled Control Request event. */\r
+void EVENT_USB_Device_UnhandledControlRequest(void)\r
{\r
- HID_Device_ProcessControlPacket(&Generic_HID_Interface);\r
+ HID_Device_ProcessControlRequest(&Generic_HID_Interface);\r
}\r
\r
/** ISR to keep track of each millisecond interrupt, for determining the HID class idle period remaining when set. */\r
/* Function Prototypes: */\r
void SetupHardware(void);\r
\r
- void EVENT_USB_Connect(void);\r
- void EVENT_USB_Disconnect(void);\r
- void EVENT_USB_ConfigurationChanged(void);\r
- void EVENT_USB_UnhandledControlPacket(void);\r
+ void EVENT_USB_Device_Connect(void);\r
+ void EVENT_USB_Device_Disconnect(void);\r
+ void EVENT_USB_Device_ConfigurationChanged(void);\r
+ void EVENT_USB_Device_UnhandledControlRequest(void);\r
\r
bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, uint8_t* const ReportID,\r
void* ReportData, uint16_t* ReportSize);\r
}\r
\r
/** Event handler for the library USB Connection event. */\r
-void EVENT_USB_Connect(void)\r
+void EVENT_USB_Device_Connect(void)\r
{\r
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
}\r
\r
/** Event handler for the library USB Disconnection event. */\r
-void EVENT_USB_Disconnect(void)\r
+void EVENT_USB_Device_Disconnect(void)\r
{\r
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
}\r
\r
/** Event handler for the library USB Configuration Changed event. */\r
-void EVENT_USB_ConfigurationChanged(void)\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
{\r
LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
\r
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
}\r
\r
-/** Event handler for the library USB Unhandled Control Packet event. */\r
-void EVENT_USB_UnhandledControlPacket(void)\r
+/** Event handler for the library USB Unhandled Control Request event. */\r
+void EVENT_USB_Device_UnhandledControlRequest(void)\r
{\r
- HID_Device_ProcessControlPacket(&Joystick_HID_Interface);\r
+ HID_Device_ProcessControlRequest(&Joystick_HID_Interface);\r
}\r
\r
/** ISR to keep track of each millisecond interrupt, for determining the HID class idle period remaining when set. */\r
/* Function Prototypes: */\r
void SetupHardware(void);\r
\r
- void EVENT_USB_Connect(void);\r
- void EVENT_USB_Disconnect(void);\r
- void EVENT_USB_ConfigurationChanged(void);\r
- void EVENT_USB_UnhandledControlPacket(void);\r
+ void EVENT_USB_Device_Connect(void);\r
+ void EVENT_USB_Device_Disconnect(void);\r
+ void EVENT_USB_Device_ConfigurationChanged(void);\r
+ void EVENT_USB_Device_UnhandledControlRequest(void);\r
\r
bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, uint8_t* const ReportID,\r
void* ReportData, uint16_t* ReportSize);\r
}\r
\r
/** Event handler for the library USB Connection event. */\r
-void EVENT_USB_Connect(void)\r
+void EVENT_USB_Device_Connect(void)\r
{\r
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
}\r
\r
/** Event handler for the library USB Disconnection event. */\r
-void EVENT_USB_Disconnect(void)\r
+void EVENT_USB_Device_Disconnect(void)\r
{\r
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
}\r
\r
/** Event handler for the library USB Configuration Changed event. */\r
-void EVENT_USB_ConfigurationChanged(void)\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
{\r
LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
\r
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
}\r
\r
-/** Event handler for the library USB Unhandled Control Packet event. */\r
-void EVENT_USB_UnhandledControlPacket(void)\r
+/** Event handler for the library USB Unhandled Control Request event. */\r
+void EVENT_USB_Device_UnhandledControlRequest(void)\r
{\r
- HID_Device_ProcessControlPacket(&Keyboard_HID_Interface);\r
+ HID_Device_ProcessControlRequest(&Keyboard_HID_Interface);\r
}\r
\r
/** ISR to keep track of each millisecond interrupt, for determining the HID class idle period remaining when set. */\r
/* Function Prototypes: */\r
void SetupHardware(void);\r
\r
- void EVENT_USB_Connect(void);\r
- void EVENT_USB_Disconnect(void);\r
- void EVENT_USB_ConfigurationChanged(void);\r
- void EVENT_USB_UnhandledControlPacket(void);\r
+ void EVENT_USB_Device_Connect(void);\r
+ void EVENT_USB_Device_Disconnect(void);\r
+ void EVENT_USB_Device_ConfigurationChanged(void);\r
+ void EVENT_USB_Device_UnhandledControlRequest(void);\r
\r
bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, uint8_t* const ReportID,\r
void* ReportData, uint16_t* ReportSize);\r
}\r
\r
/** Event handler for the library USB Connection event. */\r
-void EVENT_USB_Connect(void)\r
+void EVENT_USB_Device_Connect(void)\r
{\r
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
}\r
\r
/** Event handler for the library USB Disconnection event. */\r
-void EVENT_USB_Disconnect(void)\r
+void EVENT_USB_Device_Disconnect(void)\r
{\r
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
}\r
\r
/** Event handler for the library USB Configuration Changed event. */\r
-void EVENT_USB_ConfigurationChanged(void)\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
{\r
LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
\r
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
}\r
\r
-/** Event handler for the library USB Unhandled Control Packet event. */\r
-void EVENT_USB_UnhandledControlPacket(void)\r
+/** Event handler for the library USB Unhandled Control Request event. */\r
+void EVENT_USB_Device_UnhandledControlRequest(void)\r
{\r
- HID_Device_ProcessControlPacket(&Keyboard_HID_Interface);\r
- HID_Device_ProcessControlPacket(&Mouse_HID_Interface);\r
+ HID_Device_ProcessControlRequest(&Keyboard_HID_Interface);\r
+ HID_Device_ProcessControlRequest(&Mouse_HID_Interface);\r
}\r
\r
/** ISR to keep track of each millisecond interrupt, for determining the HID class idle period remaining when set. */\r
/* Function Prototypes: */\r
void SetupHardware(void);\r
\r
- void EVENT_USB_Connect(void);\r
- void EVENT_USB_Disconnect(void);\r
- void EVENT_USB_ConfigurationChanged(void);\r
- void EVENT_USB_UnhandledControlPacket(void);\r
+ void EVENT_USB_Device_Connect(void);\r
+ void EVENT_USB_Device_Disconnect(void);\r
+ void EVENT_USB_Device_ConfigurationChanged(void);\r
+ void EVENT_USB_Device_UnhandledControlRequest(void);\r
\r
bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, uint8_t* const ReportID,\r
void* ReportData, uint16_t* ReportSize);\r
}\r
\r
/** Event handler for the library USB Connection event. */\r
-void EVENT_USB_Connect(void)\r
+void EVENT_USB_Device_Connect(void)\r
{\r
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
}\r
\r
/** Event handler for the library USB Disconnection event. */\r
-void EVENT_USB_Disconnect(void)\r
+void EVENT_USB_Device_Disconnect(void)\r
{\r
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
}\r
\r
/** Event handler for the library USB Configuration Changed event. */\r
-void EVENT_USB_ConfigurationChanged(void)\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
{\r
LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
\r
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
}\r
\r
-/** Event handler for the library USB Unhandled Control Packet event. */\r
-void EVENT_USB_UnhandledControlPacket(void)\r
+/** Event handler for the library USB Unhandled Control Request event. */\r
+void EVENT_USB_Device_UnhandledControlRequest(void)\r
{\r
- MIDI_Device_ProcessControlPacket(&Keyboard_MIDI_Interface);\r
+ MIDI_Device_ProcessControlRequest(&Keyboard_MIDI_Interface);\r
}\r
void SetupHardware(void);\r
void CheckJoystickMovement(void);\r
\r
- void EVENT_USB_Connect(void);\r
- void EVENT_USB_Disconnect(void);\r
- void EVENT_USB_ConfigurationChanged(void);\r
- void EVENT_USB_UnhandledControlPacket(void);\r
+ void EVENT_USB_Device_Connect(void);\r
+ void EVENT_USB_Device_Disconnect(void);\r
+ void EVENT_USB_Device_ConfigurationChanged(void);\r
+ void EVENT_USB_Device_UnhandledControlRequest(void);\r
\r
#endif\r
}\r
\r
/** Event handler for the library USB Connection event. */\r
-void EVENT_USB_Connect(void)\r
+void EVENT_USB_Device_Connect(void)\r
{\r
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
}\r
\r
/** Event handler for the library USB Disconnection event. */\r
-void EVENT_USB_Disconnect(void)\r
+void EVENT_USB_Device_Disconnect(void)\r
{\r
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
}\r
\r
/** Event handler for the library USB Configuration Changed event. */\r
-void EVENT_USB_ConfigurationChanged(void)\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
{\r
LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
\r
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
}\r
\r
-/** Event handler for the library USB Unhandled Control Packet event. */\r
-void EVENT_USB_UnhandledControlPacket(void)\r
+/** Event handler for the library USB Unhandled Control Request event. */\r
+void EVENT_USB_Device_UnhandledControlRequest(void)\r
{\r
- MS_Device_ProcessControlPacket(&Disk_MS_Interface);\r
+ MS_Device_ProcessControlRequest(&Disk_MS_Interface);\r
}\r
\r
/** Mass Storage class driver callback function the reception of SCSI commands from the host, which must be processed.\r
/* Function Prototypes: */\r
void SetupHardware(void);\r
\r
- void EVENT_USB_Connect(void);\r
- void EVENT_USB_Disconnect(void);\r
- void EVENT_USB_ConfigurationChanged(void);\r
- void EVENT_USB_UnhandledControlPacket(void);\r
+ void EVENT_USB_Device_Connect(void);\r
+ void EVENT_USB_Device_Disconnect(void);\r
+ void EVENT_USB_Device_ConfigurationChanged(void);\r
+ void EVENT_USB_Device_UnhandledControlRequest(void);\r
\r
bool CALLBACK_MS_Device_SCSICommandReceived(USB_ClassInfo_MS_Device_t* MSInterfaceInfo);\r
\r
TIMSK0 = (1 << OCIE0A);\r
}\r
\r
-/** Event handler for the library USB Connection event. */\r
-void EVENT_USB_Connect(void)\r
+/** Event handler for the library USB WakeUp event. */\r
+void EVENT_USB_Device_Connect(void)\r
{\r
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
}\r
\r
-/** Event handler for the library USB Disconnection event. */\r
-void EVENT_USB_Disconnect(void)\r
+/** Event handler for the library USB Suspend event. */\r
+void EVENT_USB_Device_Disconnect(void)\r
{\r
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
}\r
\r
/** Event handler for the library USB Configuration Changed event. */\r
-void EVENT_USB_ConfigurationChanged(void)\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
{\r
LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
\r
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
}\r
\r
-/** Event handler for the library USB Unhandled Control Packet event. */\r
-void EVENT_USB_UnhandledControlPacket(void)\r
+/** Event handler for the library USB Unhandled Control Request event. */\r
+void EVENT_USB_Device_Device_UnhandledControlRequest(void)\r
{\r
- HID_Device_ProcessControlPacket(&Mouse_HID_Interface);\r
+ HID_Device_ProcessControlRequest(&Mouse_HID_Interface);\r
}\r
\r
/** ISR to keep track of each millisecond interrupt, for determining the HID class idle period remaining when set. */\r
/* Function Prototypes: */\r
void SetupHardware(void);\r
\r
- void EVENT_USB_Connect(void);\r
- void EVENT_USB_Disconnect(void);\r
- void EVENT_USB_ConfigurationChanged(void);\r
- void EVENT_USB_UnhandledControlPacket(void);\r
+ void EVENT_USB_Device_Device_Connect(void);\r
+ void EVENT_USB_Device_Device_Disconnect(void);\r
+ void EVENT_USB_Device_Device_ConfigurationChanged(void);\r
+ void EVENT_USB_Device_Device_UnhandledControlRequest(void);\r
\r
bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, uint8_t* const ReportID,\r
void* ReportData, uint16_t* ReportSize);\r
}\r
\r
/** Event handler for the library USB Connection event. */\r
-void EVENT_USB_Connect(void)\r
+void EVENT_USB_Device_Connect(void)\r
{\r
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
}\r
\r
/** Event handler for the library USB Disconnection event. */\r
-void EVENT_USB_Disconnect(void)\r
+void EVENT_USB_Device_Disconnect(void)\r
{\r
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
}\r
\r
/** Event handler for the library USB Configuration Changed event. */\r
-void EVENT_USB_ConfigurationChanged(void)\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
{\r
LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
\r
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
}\r
\r
-/** Event handler for the library USB Unhandled Control Packet event. */\r
-void EVENT_USB_UnhandledControlPacket(void)\r
+/** Event handler for the library USB Unhandled Control Request event. */\r
+void EVENT_USB_Device_UnhandledControlRequest(void)\r
{\r
- RNDIS_Device_ProcessControlPacket(&Ethernet_RNDIS_Interface);\r
+ RNDIS_Device_ProcessControlRequest(&Ethernet_RNDIS_Interface);\r
}\r
/* Function Prototypes: */\r
void SetupHardware(void);\r
\r
- void EVENT_USB_Connect(void);\r
- void EVENT_USB_Disconnect(void);\r
- void EVENT_USB_ConfigurationChanged(void);\r
- void EVENT_USB_UnhandledControlPacket(void);\r
+ void EVENT_USB_Device_Connect(void);\r
+ void EVENT_USB_Device_Disconnect(void);\r
+ void EVENT_USB_Device_ConfigurationChanged(void);\r
+ void EVENT_USB_Device_UnhandledControlRequest(void);\r
\r
#endif\r
}\r
\r
/** Event handler for the library USB Connection event. */\r
-void EVENT_USB_Connect(void)\r
+void EVENT_USB_Device_Connect(void)\r
{\r
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
}\r
\r
/** Event handler for the library USB Disconnection event. */\r
-void EVENT_USB_Disconnect(void)\r
+void EVENT_USB_Device_Disconnect(void)\r
{\r
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
}\r
\r
/** Event handler for the library USB Configuration Changed event. */\r
-void EVENT_USB_ConfigurationChanged(void)\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
{\r
LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
\r
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
}\r
\r
-/** Event handler for the library USB Unhandled Control Packet event. */\r
-void EVENT_USB_UnhandledControlPacket(void)\r
+/** Event handler for the library USB Unhandled Control Request event. */\r
+void EVENT_USB_Device_UnhandledControlPacket(void)\r
{\r
- CDC_Device_ProcessControlPacket(&VirtualSerial_CDC_Interface);\r
+ CDC_Device_ProcessControlRequest(&VirtualSerial_CDC_Interface);\r
}\r
\r
/** ISR to manage the reception of data from the serial port, placing received bytes into a circular buffer\r
/* Function Prototypes: */\r
void SetupHardware(void);\r
\r
- void EVENT_USB_Connect(void);\r
- void EVENT_USB_Disconnect(void);\r
- void EVENT_USB_ConfigurationChanged(void);\r
- void EVENT_USB_UnhandledControlPacket(void);\r
+ void EVENT_USB_Device_Connect(void);\r
+ void EVENT_USB_Device_Disconnect(void);\r
+ void EVENT_USB_Device_ConfigurationChanged(void);\r
+ void EVENT_USB_Device_UnhandledControlRequest(void);\r
\r
void EVENT_CDC_Device_LineEncodingChanged(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo);\r
\r
SerialStream_Init(9600, false);\r
}\r
\r
-void EVENT_USB_Connect(void)\r
+void EVENT_USB_Device_Connect(void)\r
{\r
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
}\r
\r
-void EVENT_USB_Disconnect(void)\r
+void EVENT_USB_Device_Disconnect(void)\r
{\r
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
}\r
\r
-void EVENT_USB_ConfigurationChanged(void)\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
{\r
LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
\r
}\r
}\r
\r
-void EVENT_USB_UnhandledControlPacket(void)\r
+void EVENT_USB_Device_UnhandledControlRequest(void)\r
{\r
/* Process UFI specific control requests */\r
switch (USB_ControlRequest.bRequest)\r
void SetupHardware(void);\r
void SideShow_Task(void);\r
\r
- void EVENT_USB_Connect(void);\r
- void EVENT_USB_Disconnect(void);\r
- void EVENT_USB_ConfigurationChanged(void);\r
- void EVENT_USB_UnhandledControlPacket(void);\r
+ void EVENT_USB_Device_Connect(void);\r
+ void EVENT_USB_Device_Disconnect(void);\r
+ void EVENT_USB_Device_ConfigurationChanged(void);\r
+ void EVENT_USB_Device_UnhandledControlRequest(void);\r
\r
#endif\r
/** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs, and\r
* configures the sample update and PWM timers.\r
*/\r
-void EVENT_USB_Connect(void)\r
+void EVENT_USB_Device_Connect(void)\r
{\r
/* Indicate USB enumerating */\r
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
/** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via\r
* the status LEDs, disables the sample update and PWM output timers and stops the USB and Audio management tasks.\r
*/\r
-void EVENT_USB_Disconnect(void)\r
+void EVENT_USB_Device_Disconnect(void)\r
{\r
/* Stop the sample reload timer */\r
TCCR0B = 0;\r
/** Event handler for the USB_ConfigurationChanged event. This is fired when the host set the current configuration\r
* of the USB device after enumeration - the device endpoints are configured.\r
*/\r
-void EVENT_USB_ConfigurationChanged(void)\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
{\r
/* Indicate USB connected and ready */\r
LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
}\r
}\r
\r
-/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific\r
+/** Event handler for the USB_UnhandledControlRequest event. This is used to catch standard and class specific\r
* control requests that are not handled internally by the USB library (including the Audio class-specific\r
* requests) so that they can be handled appropriately for the application.\r
*/\r
-void EVENT_USB_UnhandledControlPacket(void)\r
+void EVENT_USB_Device_UnhandledControlRequest(void)\r
{\r
/* Process General and Audio specific control requests */\r
switch (USB_ControlRequest.bRequest)\r
void SetupHardware(void);\r
void USB_Audio_Task(void);\r
\r
- void EVENT_USB_Connect(void);\r
- void EVENT_USB_Disconnect(void);\r
- void EVENT_USB_ConfigurationChanged(void);\r
- void EVENT_USB_UnhandledControlPacket(void);\r
+ void EVENT_USB_Device_Connect(void);\r
+ void EVENT_USB_Device_Disconnect(void);\r
+ void EVENT_USB_Device_ConfigurationChanged(void);\r
+ void EVENT_USB_Device_UnhandledControlRequest(void);\r
\r
#endif\r
/** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs, and\r
* configures the sample update and PWM timers.\r
*/\r
-void EVENT_USB_Connect(void)\r
+void EVENT_USB_Device_Connect(void)\r
{\r
/* Indicate USB enumerating */\r
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
/** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via\r
* the status LEDs, disables the sample update and PWM output timers and stops the USB and Audio management tasks.\r
*/\r
-void EVENT_USB_Disconnect(void)\r
+void EVENT_USB_Device_Disconnect(void)\r
{\r
/* Stop the timers */\r
TCCR0B = 0;\r
/** Event handler for the USB_ConfigurationChanged event. This is fired when the host set the current configuration\r
* of the USB device after enumeration - the device endpoints are configured.\r
*/\r
-void EVENT_USB_ConfigurationChanged(void)\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
{\r
/* Indicate USB connected and ready */\r
LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
}\r
}\r
\r
-/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific\r
+/** Event handler for the USB_UnhandledControlRequest event. This is used to catch standard and class specific\r
* control requests that are not handled internally by the USB library (including the Audio class-specific\r
* requests) so that they can be handled appropriately for the application.\r
*/\r
-void EVENT_USB_UnhandledControlPacket(void)\r
+void EVENT_USB_Device_UnhandledControlRequest(void)\r
{\r
/* Process General and Audio specific control requests */\r
switch (USB_ControlRequest.bRequest)\r
void SetupHardware(void);\r
void USB_Audio_Task(void);\r
\r
- void EVENT_USB_Connect(void);\r
- void EVENT_USB_Disconnect(void);\r
- void EVENT_USB_ConfigurationChanged(void);\r
- void EVENT_USB_UnhandledControlPacket(void);\r
+ void EVENT_USB_Device_Connect(void);\r
+ void EVENT_USB_Device_Disconnect(void);\r
+ void EVENT_USB_Device_ConfigurationChanged(void);\r
+ void EVENT_USB_Device_UnhandledControlRequest(void);\r
\r
#endif\r
/** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs and\r
* starts the library USB task to begin the enumeration and USB management process.\r
*/\r
-void EVENT_USB_Connect(void)\r
+void EVENT_USB_Device_Connect(void)\r
{\r
/* Indicate USB enumerating */\r
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
/** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via\r
* the status LEDs and stops the USB management and CDC management tasks.\r
*/\r
-void EVENT_USB_Disconnect(void)\r
+void EVENT_USB_Device_Disconnect(void)\r
{\r
/* Indicate USB not ready */\r
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
/** Event handler for the USB_ConfigurationChanged event. This is fired when the host set the current configuration\r
* of the USB device after enumeration - the device endpoints are configured and the CDC management task started.\r
*/\r
-void EVENT_USB_ConfigurationChanged(void)\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
{\r
/* Indicate USB connected and ready */\r
LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
{\r
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
}\r
+ \r
+ /* Reset line encoding baud rate so that the host knows to send new values */\r
+ LineEncoding.BaudRateBPS = 0;\r
}\r
\r
-/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific\r
+/** Event handler for the USB_UnhandledControlRequest event. This is used to catch standard and class specific\r
* control requests that are not handled internally by the USB library (including the CDC control commands,\r
* which are all issued via the control endpoint), so that they can be handled appropriately for the application.\r
*/\r
-void EVENT_USB_UnhandledControlPacket(void)\r
+void EVENT_USB_Device_UnhandledControlRequest(void)\r
{\r
/* Process CDC specific control requests */\r
switch (USB_ControlRequest.bRequest)\r
void SetupHardware(void);\r
void CDC_Task(void);\r
\r
- void EVENT_USB_Connect(void);\r
- void EVENT_USB_Disconnect(void);\r
- void EVENT_USB_ConfigurationChanged(void);\r
- void EVENT_USB_UnhandledControlPacket(void);\r
+ void EVENT_USB_Device_Connect(void);\r
+ void EVENT_USB_Device_Disconnect(void);\r
+ void EVENT_USB_Device_ConfigurationChanged(void);\r
+ void EVENT_USB_Device_UnhandledControlRequest(void);\r
\r
#endif\r
/** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs and\r
* starts the library USB task to begin the enumeration and USB management process.\r
*/\r
-void EVENT_USB_Connect(void)\r
+void EVENT_USB_Device_Connect(void)\r
{\r
/* Indicate USB enumerating */\r
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
/** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via\r
* the status LEDs and stops the USB management and CDC management tasks.\r
*/\r
-void EVENT_USB_Disconnect(void)\r
+void EVENT_USB_Device_Disconnect(void)\r
{\r
/* Indicate USB not ready */\r
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
/** Event handler for the USB_ConfigurationChanged event. This is fired when the host set the current configuration\r
* of the USB device after enumeration - the device endpoints are configured and the CDC management tasks are started.\r
*/\r
-void EVENT_USB_ConfigurationChanged(void)\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
{ \r
/* Indicate USB connected and ready */\r
LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
{\r
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
}\r
+ \r
+ /* Reset line encoding baud rates so that the host knows to send new values */\r
+ LineEncoding1.BaudRateBPS = 0;\r
+ LineEncoding2.BaudRateBPS = 0;\r
}\r
\r
-/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific\r
+/** Event handler for the USB_UnhandledControlRequest event. This is used to catch standard and class specific\r
* control requests that are not handled internally by the USB library (including the CDC control commands,\r
* which are all issued via the control endpoint), so that they can be handled appropriately for the application.\r
*/\r
-void EVENT_USB_UnhandledControlPacket(void)\r
+void EVENT_USB_Device_UnhandledControlRequest(void)\r
{\r
/* Determine which interface's Line Coding data is being set from the wIndex parameter */\r
uint8_t* LineEncodingData = (USB_ControlRequest.wIndex == 0) ? (uint8_t*)&LineEncoding1 : (uint8_t*)&LineEncoding2;\r
void CDC2_Task(void);\r
void SetupHardware(void);\r
\r
- void EVENT_USB_Connect(void);\r
- void EVENT_USB_Disconnect(void);\r
- void EVENT_USB_ConfigurationChanged(void);\r
- void EVENT_USB_UnhandledControlPacket(void);\r
+ void EVENT_USB_Device_Connect(void);\r
+ void EVENT_USB_Device_Disconnect(void);\r
+ void EVENT_USB_Device_ConfigurationChanged(void);\r
+ void EVENT_USB_Device_UnhandledControlRequest(void);\r
\r
#endif\r
/** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs and\r
* starts the library USB task to begin the enumeration and USB management process.\r
*/\r
-void EVENT_USB_Connect(void)\r
+void EVENT_USB_Device_Connect(void)\r
{\r
/* Indicate USB enumerating */\r
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
/** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via\r
* the status LEDs and stops the USB management task.\r
*/\r
-void EVENT_USB_Disconnect(void)\r
+void EVENT_USB_Device_Disconnect(void)\r
{\r
/* Indicate USB not ready */\r
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
/** Event handler for the USB_ConfigurationChanged event. This is fired when the host sets the current configuration\r
* of the USB device after enumeration, and configures the generic HID device endpoints.\r
*/\r
-void EVENT_USB_ConfigurationChanged(void)\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
{\r
/* Indicate USB connected and ready */\r
LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
}\r
}\r
\r
-/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific\r
+/** Event handler for the USB_UnhandledControlRequest event. This is used to catch standard and class specific\r
* control requests that are not handled internally by the USB library (including the HID commands, which are\r
* all issued via the control endpoint), so that they can be handled appropriately for the application.\r
*/\r
-void EVENT_USB_UnhandledControlPacket(void)\r
+void EVENT_USB_Device_UnhandledControlRequest(void)\r
{\r
/* Handle HID Class specific requests */\r
switch (USB_ControlRequest.bRequest)\r
void SetupHardware(void);\r
void HID_Task(void);\r
\r
- void EVENT_USB_Connect(void);\r
- void EVENT_USB_Disconnect(void);\r
- void EVENT_USB_ConfigurationChanged(void);\r
- void EVENT_USB_UnhandledControlPacket(void);\r
+ void EVENT_USB_Device_Connect(void);\r
+ void EVENT_USB_Device_Disconnect(void);\r
+ void EVENT_USB_Device_ConfigurationChanged(void);\r
+ void EVENT_USB_Device_UnhandledControlRequest(void);\r
\r
void ProcessGenericHIDReport(uint8_t* DataArray);\r
void CreateGenericHIDReport(uint8_t* DataArray);\r
/** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs and\r
* starts the library USB task to begin the enumeration and USB management process.\r
*/\r
-void EVENT_USB_Connect(void)\r
+void EVENT_USB_Device_Connect(void)\r
{\r
/* Indicate USB enumerating */\r
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
/** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via\r
* the status LEDs and stops the USB management and joystick reporting tasks.\r
*/\r
-void EVENT_USB_Disconnect(void)\r
+void EVENT_USB_Device_Disconnect(void)\r
{\r
/* Indicate USB not ready */\r
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
/** Event handler for the USB_ConfigurationChanged event. This is fired when the host set the current configuration\r
* of the USB device after enumeration - the device endpoints are configured and the joystick reporting task started.\r
*/ \r
-void EVENT_USB_ConfigurationChanged(void)\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
{\r
/* Indicate USB connected and ready */\r
LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
}\r
}\r
\r
-/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific\r
+/** Event handler for the USB_UnhandledControlRequest event. This is used to catch standard and class specific\r
* control requests that are not handled internally by the USB library (including the HID commands, which are\r
* all issued via the control endpoint), so that they can be handled appropriately for the application.\r
*/\r
-void EVENT_USB_UnhandledControlPacket(void)\r
+void EVENT_USB_Device_UnhandledControlRequest(void)\r
{\r
/* Handle HID Class specific requests */\r
switch (USB_ControlRequest.bRequest)\r
void SetupHardware(void);\r
void HID_Task(void);\r
\r
- void EVENT_USB_Connect(void);\r
- void EVENT_USB_Disconnect(void);\r
- void EVENT_USB_ConfigurationChanged(void);\r
- void EVENT_USB_UnhandledControlPacket(void);\r
+ void EVENT_USB_Device_Connect(void);\r
+ void EVENT_USB_Device_Disconnect(void);\r
+ void EVENT_USB_Device_ConfigurationChanged(void);\r
+ void EVENT_USB_Device_UnhandledControlRequest(void);\r
\r
bool GetNextReport(USB_JoystickReport_Data_t* ReportData);\r
\r
/** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs and\r
* starts the library USB task to begin the enumeration and USB management process.\r
*/\r
-void EVENT_USB_Connect(void)\r
+void EVENT_USB_Device_Connect(void)\r
{\r
/* Indicate USB enumerating */\r
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
/** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via\r
* the status LEDs.\r
*/\r
-void EVENT_USB_Disconnect(void)\r
+void EVENT_USB_Device_Disconnect(void)\r
{\r
/* Indicate USB not ready */\r
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
/** Event handler for the USB_ConfigurationChanged event. This is fired when the host sets the current configuration\r
* of the USB device after enumeration, and configures the keyboard device endpoints.\r
*/\r
-void EVENT_USB_ConfigurationChanged(void)\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
{ \r
/* Indicate USB connected and ready */\r
LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
}\r
}\r
\r
-/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific\r
+/** Event handler for the USB_UnhandledControlRequest event. This is used to catch standard and class specific\r
* control requests that are not handled internally by the USB library (including the HID commands, which are\r
* all issued via the control endpoint), so that they can be handled appropriately for the application.\r
*/\r
-void EVENT_USB_UnhandledControlPacket(void)\r
+void EVENT_USB_Device_UnhandledControlRequest(void)\r
{\r
/* Handle HID Class specific requests */\r
switch (USB_ControlRequest.bRequest)\r
void SetupHardware(void);\r
void HID_Task(void);\r
\r
- void EVENT_USB_Connect(void);\r
- void EVENT_USB_Disconnect(void);\r
- void EVENT_USB_ConfigurationChanged(void);\r
- void EVENT_USB_UnhandledControlPacket(void);\r
+ void EVENT_USB_Device_Connect(void);\r
+ void EVENT_USB_Device_Disconnect(void);\r
+ void EVENT_USB_Device_ConfigurationChanged(void);\r
+ void EVENT_USB_Device_UnhandledControlRequest(void);\r
\r
void CreateKeyboardReport(USB_KeyboardReport_Data_t* ReportData);\r
void ProcessLEDReport(uint8_t LEDReport);\r
/** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs and\r
* starts the library USB task to begin the enumeration and USB management process.\r
*/\r
-void EVENT_USB_Connect(void)\r
+void EVENT_USB_Device_Connect(void)\r
{\r
/* Indicate USB enumerating */\r
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
/** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via\r
* the status LEDs and stops the USB management task.\r
*/\r
-void EVENT_USB_Disconnect(void)\r
+void EVENT_USB_Device_Disconnect(void)\r
{\r
/* Indicate USB not ready */\r
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
/** Event handler for the USB_ConfigurationChanged event. This is fired when the host sets the current configuration\r
* of the USB device after enumeration, and configures the keyboard and mouse device endpoints.\r
*/\r
-void EVENT_USB_ConfigurationChanged(void)\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
{\r
/* Indicate USB connected and ready */\r
LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
* control requests that are not handled internally by the USB library (including the HID commands, which are\r
* all issued via the control endpoint), so that they can be handled appropriately for the application.\r
*/\r
-void EVENT_USB_UnhandledControlPacket(void)\r
+void EVENT_USB_Device_UnhandledControlRequest(void)\r
{\r
uint8_t* ReportData;\r
uint8_t ReportSize;\r
void Keyboard_HID_Task(void);\r
void Mouse_HID_Task(void);\r
\r
- void EVENT_USB_Connect(void);\r
- void EVENT_USB_Disconnect(void);\r
- void EVENT_USB_ConfigurationChanged(void);\r
- void EVENT_USB_UnhandledControlPacket(void);\r
+ void EVENT_USB_Device_Connect(void);\r
+ void EVENT_USB_Device_Disconnect(void);\r
+ void EVENT_USB_Device_ConfigurationChanged(void);\r
+ void EVENT_USB_Device_UnhandledControlRequest(void);\r
\r
#endif\r
}\r
\r
/** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs. */\r
-void EVENT_USB_Connect(void)\r
+void EVENT_USB_Device_Connect(void)\r
{\r
/* Indicate USB enumerating */\r
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
/** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via\r
* the status LEDs, disables the sample update and PWM output timers and stops the USB and MIDI management tasks.\r
*/\r
-void EVENT_USB_Disconnect(void)\r
+void EVENT_USB_Device_Disconnect(void)\r
{\r
/* Indicate USB not ready */\r
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
/** Event handler for the USB_ConfigurationChanged event. This is fired when the host set the current configuration\r
* of the USB device after enumeration - the device endpoints are configured and the MIDI management task started.\r
*/\r
-void EVENT_USB_ConfigurationChanged(void)\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
{\r
/* Indicate USB connected and ready */\r
LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
void SetupHardware(void);\r
void MIDI_Task(void);\r
\r
- void EVENT_USB_Connect(void);\r
- void EVENT_USB_Disconnect(void);\r
- void EVENT_USB_ConfigurationChanged(void);\r
+ void EVENT_USB_Device_Connect(void);\r
+ void EVENT_USB_Device_Disconnect(void);\r
+ void EVENT_USB_Device_ConfigurationChanged(void);\r
\r
#endif\r
}\r
\r
/** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs. */\r
-void EVENT_USB_Connect(void)\r
+void EVENT_USB_Device_Connect(void)\r
{\r
/* Indicate USB enumerating */\r
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
/** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via\r
* the status LEDs and stops the Mass Storage management task.\r
*/\r
-void EVENT_USB_Disconnect(void)\r
+void EVENT_USB_Device_Disconnect(void)\r
{\r
/* Indicate USB not ready */\r
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
/** Event handler for the USB_ConfigurationChanged event. This is fired when the host set the current configuration\r
* of the USB device after enumeration - the device endpoints are configured and the Mass Storage management task started.\r
*/\r
-void EVENT_USB_ConfigurationChanged(void)\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
{\r
/* Indicate USB connected and ready */\r
LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
* control requests that are not handled internally by the USB library (including the Mass Storage class-specific\r
* requests) so that they can be handled appropriately for the application.\r
*/\r
-void EVENT_USB_UnhandledControlPacket(void)\r
+void EVENT_USB_Device_UnhandledControlRequest(void)\r
{\r
/* Process UFI specific control requests */\r
switch (USB_ControlRequest.bRequest)\r
void SetupHardware(void);\r
void MassStorage_Task(void);\r
\r
- void EVENT_USB_Connect(void);\r
- void EVENT_USB_Disconnect(void);\r
- void EVENT_USB_ConfigurationChanged(void);\r
- void EVENT_USB_UnhandledControlPacket(void);\r
+ void EVENT_USB_Device_Connect(void);\r
+ void EVENT_USB_Device_Disconnect(void);\r
+ void EVENT_USB_Device_ConfigurationChanged(void);\r
+ void EVENT_USB_Device_UnhandledControlRequest(void);\r
\r
#if defined(INCLUDE_FROM_MASSSTORAGE_C)\r
static bool ReadInCommandBlock(void);\r
/** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs and\r
* starts the library USB task to begin the enumeration and USB management process.\r
*/\r
-void EVENT_USB_Connect(void)\r
+void EVENT_USB_Device_Connect(void)\r
{\r
/* Indicate USB enumerating */\r
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
/** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via\r
* the status LEDs and stops the USB management and Mouse reporting tasks.\r
*/\r
-void EVENT_USB_Disconnect(void)\r
+void EVENT_USB_Device_Disconnect(void)\r
{\r
/* Indicate USB not ready */\r
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
/** Event handler for the USB_ConfigurationChanged event. This is fired when the host sets the current configuration\r
* of the USB device after enumeration - the device endpoints are configured and the mouse reporting task started.\r
*/ \r
-void EVENT_USB_ConfigurationChanged(void)\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
{\r
/* Indicate USB connected and ready */\r
LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
}\r
}\r
\r
-/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific\r
+/** Event handler for the USB_UnhandledControlRequest event. This is used to catch standard and class specific\r
* control requests that are not handled internally by the USB library (including the HID commands, which are\r
* all issued via the control endpoint), so that they can be handled appropriately for the application.\r
*/\r
-void EVENT_USB_UnhandledControlPacket(void)\r
+void EVENT_USB_Device_UnhandledControlRequest(void)\r
{\r
/* Handle HID Class specific requests */\r
switch (USB_ControlRequest.bRequest)\r
void SetupHardware(void);\r
void Mouse_Task(void);\r
\r
- void EVENT_USB_Connect(void);\r
- void EVENT_USB_Disconnect(void);\r
- void EVENT_USB_ConfigurationChanged(void);\r
- void EVENT_USB_UnhandledControlPacket(void);\r
+ void EVENT_USB_Device_Connect(void);\r
+ void EVENT_USB_Device_Disconnect(void);\r
+ void EVENT_USB_Device_ConfigurationChanged(void);\r
+ void EVENT_USB_Device_UnhandledControlRequest(void);\r
\r
void CreateMouseReport(USB_MouseReport_Data_t* ReportData);\r
\r
/** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs and\r
* starts the library USB task to begin the enumeration and USB management process.\r
*/\r
-void EVENT_USB_Connect(void)\r
+void EVENT_USB_Device_Connect(void)\r
{\r
/* Indicate USB enumerating */\r
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
/** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via\r
* the status LEDs and stops all the relevant tasks.\r
*/\r
-void EVENT_USB_Disconnect(void)\r
+void EVENT_USB_Device_Disconnect(void)\r
{\r
/* Indicate USB not ready */\r
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
/** Event handler for the USB_ConfigurationChanged event. This is fired when the host sets the current configuration\r
* of the USB device after enumeration, and configures the RNDIS device endpoints and starts the relevant tasks.\r
*/\r
-void EVENT_USB_ConfigurationChanged(void)\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
{\r
/* Indicate USB connected and ready */\r
LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
}\r
}\r
\r
-/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific\r
+/** Event handler for the USB_UnhandledControlRequest event. This is used to catch standard and class specific\r
* control requests that are not handled internally by the USB library (including the RNDIS control commands,\r
* which set up the USB RNDIS network adapter), so that they can be handled appropriately for the application.\r
*/\r
-void EVENT_USB_UnhandledControlPacket(void)\r
+void EVENT_USB_Device_UnhandledControlRequest(void)\r
{\r
/* Process RNDIS class commands */\r
switch (USB_ControlRequest.bRequest)\r
void RNDIS_Task(void);\r
void Ethernet_Task(void);\r
\r
- void EVENT_USB_Connect(void);\r
- void EVENT_USB_Disconnect(void);\r
- void EVENT_USB_ConfigurationChanged(void);\r
- void EVENT_USB_UnhandledControlPacket(void);\r
+ void EVENT_USB_Device_Connect(void);\r
+ void EVENT_USB_Device_Disconnect(void);\r
+ void EVENT_USB_Device_ConfigurationChanged(void);\r
+ void EVENT_USB_Device_UnhandledControlRequest(void);\r
\r
#endif\r
/** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs and\r
* starts the library USB task to begin the enumeration and USB management process.\r
*/\r
-void EVENT_USB_Connect(void)\r
+void EVENT_USB_Device_Connect(void)\r
{\r
/* Indicate USB enumerating */\r
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
/** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via\r
* the status LEDs and stops the USB management and CDC management tasks.\r
*/\r
-void EVENT_USB_Disconnect(void)\r
+void EVENT_USB_Device_Disconnect(void)\r
{ \r
/* Reset Tx and Rx buffers, device disconnected */\r
Buffer_Initialize(&Rx_Buffer);\r
/** Event handler for the USB_ConfigurationChanged event. This is fired when the host set the current configuration\r
* of the USB device after enumeration - the device endpoints are configured and the CDC management task started.\r
*/\r
-void EVENT_USB_ConfigurationChanged(void)\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
{\r
/* Indicate USB connected and ready */\r
LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
{\r
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
}\r
+\r
+ /* Reset line encoding baud rate so that the host knows to send new values */\r
+ LineEncoding.BaudRateBPS = 0;\r
}\r
\r
-/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific\r
+/** Event handler for the USB_UnhandledControlRequest event. This is used to catch standard and class specific\r
* control requests that are not handled internally by the USB library (including the CDC control commands,\r
* which are all issued via the control endpoint), so that they can be handled appropriately for the application.\r
*/\r
-void EVENT_USB_UnhandledControlPacket(void)\r
+void EVENT_USB_Device_UnhandledControlRequest(void)\r
{\r
/* Process CDC specific control requests */\r
switch (USB_ControlRequest.bRequest)\r
void CDC_Task(void);\r
void ReconfigureUSART(void);\r
\r
- void EVENT_USB_Connect(void);\r
- void EVENT_USB_Disconnect(void);\r
- void EVENT_USB_ConfigurationChanged(void);\r
- void EVENT_USB_UnhandledControlPacket(void);\r
+ void EVENT_USB_Device_Connect(void);\r
+ void EVENT_USB_Device_Disconnect(void);\r
+ void EVENT_USB_Device_ConfigurationChanged(void);\r
+ void EVENT_USB_Device_UnhandledControlRequest(void);\r
\r
#endif\r
/** Event handler for the USB_DeviceAttached event. This indicates that a device has been attached to the host, and\r
* starts the library USB task to begin the enumeration and USB management process.\r
*/\r
-void EVENT_USB_DeviceAttached(void)\r
+void EVENT_USB_Host_DeviceAttached(void)\r
{\r
puts_P(PSTR("Device Attached.\r\n"));\r
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
/** Event handler for the USB_DeviceUnattached event. This indicates that a device has been removed from the host, and\r
* stops the library USB task management process.\r
*/\r
-void EVENT_USB_DeviceUnattached(void)\r
+void EVENT_USB_Host_DeviceUnattached(void)\r
{\r
puts_P(PSTR("\r\nDevice Unattached.\r\n"));\r
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
/** Event handler for the USB_DeviceEnumerationComplete event. This indicates that a device has been successfully\r
* enumerated by the host and is now ready to be used by the application.\r
*/\r
-void EVENT_USB_DeviceEnumerationComplete(void)\r
+void EVENT_USB_Host_DeviceEnumerationComplete(void)\r
{\r
LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
}\r
\r
/** Event handler for the USB_HostError event. This indicates that a hardware error occurred while in host mode. */\r
-void EVENT_USB_HostError(const uint8_t ErrorCode)\r
+void EVENT_USB_Host_HostError(const uint8_t ErrorCode)\r
{\r
USB_ShutDown();\r
\r
/** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while\r
* enumerating an attached USB device.\r
*/\r
-void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
+void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
{\r
puts_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n"));\r
printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);\r
/* Function Prototypes: */\r
void SetupHardware(void);\r
\r
- void EVENT_USB_HostError(const uint8_t ErrorCode);\r
- void EVENT_USB_DeviceAttached(void);\r
- void EVENT_USB_DeviceUnattached(void);\r
- void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);\r
- void EVENT_USB_DeviceEnumerationComplete(void);\r
+ void EVENT_USB_Host_HostError(const uint8_t ErrorCode);\r
+ void EVENT_USB_Host_DeviceAttached(void);\r
+ void EVENT_USB_Host_DeviceUnattached(void);\r
+ void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);\r
+ void EVENT_USB_Host_DeviceEnumerationComplete(void);\r
\r
#endif\r
/** Event handler for the USB_DeviceAttached event. This indicates that a device has been attached to the host, and\r
* starts the library USB task to begin the enumeration and USB management process.\r
*/\r
-void EVENT_USB_DeviceAttached(void)\r
+void EVENT_USB_Host_DeviceAttached(void)\r
{\r
puts_P(PSTR("Device Attached.\r\n"));\r
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
/** Event handler for the USB_DeviceUnattached event. This indicates that a device has been removed from the host, and\r
* stops the library USB task management process.\r
*/\r
-void EVENT_USB_DeviceUnattached(void)\r
+void EVENT_USB_Host_DeviceUnattached(void)\r
{\r
puts_P(PSTR("\r\nDevice Unattached.\r\n"));\r
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
/** Event handler for the USB_DeviceEnumerationComplete event. This indicates that a device has been successfully\r
* enumerated by the host and is now ready to be used by the application.\r
*/\r
-void EVENT_USB_DeviceEnumerationComplete(void)\r
+void EVENT_USB_Host_DeviceEnumerationComplete(void)\r
{\r
LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
}\r
\r
/** Event handler for the USB_HostError event. This indicates that a hardware error occurred while in host mode. */\r
-void EVENT_USB_HostError(const uint8_t ErrorCode)\r
+void EVENT_USB_Host_HostError(const uint8_t ErrorCode)\r
{\r
USB_ShutDown();\r
\r
/** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while\r
* enumerating an attached USB device.\r
*/\r
-void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
+void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
{\r
puts_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n"));\r
printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);\r
/* Function Prototypes: */\r
void SetupHardware(void);\r
\r
- void EVENT_USB_HostError(const uint8_t ErrorCode);\r
- void EVENT_USB_DeviceAttached(void);\r
- void EVENT_USB_DeviceUnattached(void);\r
- void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);\r
- void EVENT_USB_DeviceEnumerationComplete(void);\r
+ void EVENT_USB_Host_HostError(const uint8_t ErrorCode);\r
+ void EVENT_USB_Host_DeviceAttached(void);\r
+ void EVENT_USB_Host_DeviceUnattached(void);\r
+ void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);\r
+ void EVENT_USB_Host_DeviceEnumerationComplete(void);\r
\r
#endif\r
USB_Init();\r
}\r
\r
-void EVENT_USB_DeviceAttached(void)\r
+void EVENT_USB_Host_DeviceAttached(void)\r
{\r
puts_P(PSTR(ESC_FG_GREEN "Device Attached.\r\n" ESC_FG_WHITE));\r
\r
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
}\r
\r
-void EVENT_USB_DeviceUnattached(void)\r
+void EVENT_USB_Host_DeviceUnattached(void)\r
{\r
puts_P(PSTR(ESC_FG_GREEN "\r\nDevice Unattached.\r\n" ESC_FG_WHITE));\r
\r
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
}\r
\r
-void EVENT_USB_DeviceEnumerationComplete(void)\r
+void EVENT_USB_Host_DeviceEnumerationComplete(void)\r
{\r
LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
}\r
\r
-void EVENT_USB_HostError(uint8_t ErrorCode)\r
+void EVENT_USB_Host_HostError(uint8_t ErrorCode)\r
{\r
USB_ShutDown();\r
\r
for(;;);\r
}\r
\r
-void EVENT_USB_DeviceEnumerationFailed(uint8_t ErrorCode, uint8_t SubErrorCode)\r
+void EVENT_USB_Host_DeviceEnumerationFailed(uint8_t ErrorCode, uint8_t SubErrorCode)\r
{\r
puts_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n"));\r
printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);\r
break;\r
}\r
\r
- USB_HostState = HOST_STATE_Configured;\r
- break;\r
- case HOST_STATE_Configured:\r
puts_P(PSTR("Getting Config Data.\r\n"));\r
\r
/* Get and process the configuration descriptor data */\r
\r
puts_P(PSTR("Bluetooth Dongle Enumerated.\r\n"));\r
\r
- USB_HostState = HOST_STATE_Ready;\r
+ USB_HostState = HOST_STATE_Configured;\r
break;\r
}\r
}\r
void Bluetooth_Management_Task(void);\r
\r
/* Event Handlers: */\r
- void EVENT_USB_DeviceAttached(void);\r
- void EVENT_USB_DeviceUnattached(void);\r
- void EVENT_USB_DeviceEnumerationComplete(void);\r
- void EVENT_USB_HostError(uint8_t ErrorCode);\r
- void EVENT_USB_DeviceEnumerationFailed(uint8_t ErrorCode, uint8_t SubErrorCode);\r
+ void EVENT_USB_Host_DeviceAttached(void);\r
+ void EVENT_USB_Host_DeviceUnattached(void);\r
+ void EVENT_USB_Host_DeviceEnumerationComplete(void);\r
+ void EVENT_USB_Host_HostError(uint8_t ErrorCode);\r
+ void EVENT_USB_Host_DeviceEnumerationFailed(uint8_t ErrorCode, uint8_t SubErrorCode);\r
\r
/* Function Prototypes: */\r
void SetupHardware(void);\r
{\r
while (!(Bluetooth_GetNextHCIEventHeader()))\r
{ \r
- if (USB_DeviceState == DEVICE_STATE_Unattached)\r
+ if (USB_HostState == HOST_STATE_Unattached)\r
return;\r
}\r
\r
/** Event handler for the USB_DeviceAttached event. This indicates that a device has been attached to the host, and\r
* starts the library USB task to begin the enumeration and USB management process.\r
*/\r
-void EVENT_USB_DeviceAttached(void)\r
+void EVENT_USB_Host_DeviceAttached(void)\r
{\r
puts_P(PSTR(ESC_FG_GREEN "Device Attached.\r\n" ESC_FG_WHITE));\r
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
/** Event handler for the USB_DeviceUnattached event. This indicates that a device has been removed from the host, and\r
* stops the library USB task management process.\r
*/\r
-void EVENT_USB_DeviceUnattached(void)\r
+void EVENT_USB_Host_DeviceUnattached(void)\r
{\r
puts_P(PSTR(ESC_FG_GREEN "\r\nDevice Unattached.\r\n" ESC_FG_WHITE));\r
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
/** Event handler for the USB_DeviceEnumerationComplete event. This indicates that a device has been successfully\r
* enumerated by the host and is now ready to be used by the application.\r
*/\r
-void EVENT_USB_DeviceEnumerationComplete(void)\r
+void EVENT_USB_Host_DeviceEnumerationComplete(void)\r
{\r
LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
}\r
\r
/** Event handler for the USB_HostError event. This indicates that a hardware error occurred while in host mode. */\r
-void EVENT_USB_HostError(const uint8_t ErrorCode)\r
+void EVENT_USB_Host_HostError(const uint8_t ErrorCode)\r
{\r
USB_ShutDown();\r
\r
/** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while\r
* enumerating an attached USB device.\r
*/\r
-void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
+void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
{\r
puts_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n"));\r
printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);\r
void SetupHardware(void);\r
void CDC_Host_Task(void);\r
\r
- void EVENT_USB_HostError(const uint8_t ErrorCode);\r
- void EVENT_USB_DeviceAttached(void);\r
- void EVENT_USB_DeviceUnattached(void);\r
- void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);\r
- void EVENT_USB_DeviceEnumerationComplete(void);\r
+ void EVENT_USB_Host_HostError(const uint8_t ErrorCode);\r
+ void EVENT_USB_Host_DeviceAttached(void);\r
+ void EVENT_USB_Host_DeviceUnattached(void);\r
+ void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);\r
+ void EVENT_USB_Host_DeviceEnumerationComplete(void);\r
\r
#endif\r
/** Event handler for the USB_DeviceAttached event. This indicates that a device has been attached to the host, and\r
* starts the library USB task to begin the enumeration and USB management process.\r
*/\r
-void EVENT_USB_DeviceAttached(void)\r
+void EVENT_USB_Host_DeviceAttached(void)\r
{\r
puts_P(PSTR(ESC_FG_GREEN "Device Attached.\r\n" ESC_FG_WHITE));\r
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
/** Event handler for the USB_DeviceUnattached event. This indicates that a device has been removed from the host, and\r
* stops the library USB task management process.\r
*/\r
-void EVENT_USB_DeviceUnattached(void)\r
+void EVENT_USB_Host_DeviceUnattached(void)\r
{\r
puts_P(PSTR(ESC_FG_GREEN "Device Unattached.\r\n" ESC_FG_WHITE));\r
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
/** Event handler for the USB_DeviceEnumerationComplete event. This indicates that a device has been successfully\r
* enumerated by the host and is now ready to be used by the application.\r
*/\r
-void EVENT_USB_DeviceEnumerationComplete(void)\r
+void EVENT_USB_Host_DeviceEnumerationComplete(void)\r
{\r
LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
}\r
\r
/** Event handler for the USB_HostError event. This indicates that a hardware error occurred while in host mode. */\r
-void EVENT_USB_HostError(const uint8_t ErrorCode)\r
+void EVENT_USB_Host_HostError(const uint8_t ErrorCode)\r
{\r
USB_ShutDown();\r
\r
/** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while\r
* enumerating an attached USB device.\r
*/\r
-void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
+void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
{\r
puts_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n"));\r
printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);\r
void SetupHardware(void);\r
void HID_Host_Task(void);\r
\r
- void EVENT_USB_HostError(const uint8_t ErrorCode);\r
- void EVENT_USB_DeviceAttached(void);\r
- void EVENT_USB_DeviceUnattached(void);\r
- void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);\r
- void EVENT_USB_DeviceEnumerationComplete(void);\r
+ void EVENT_USB_Host_HostError(const uint8_t ErrorCode);\r
+ void EVENT_USB_Host_DeviceAttached(void);\r
+ void EVENT_USB_Host_DeviceUnattached(void);\r
+ void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);\r
+ void EVENT_USB_Host_DeviceEnumerationComplete(void);\r
\r
void ReadNextReport(void);\r
void WriteNextReport(uint8_t* ReportOUTData, uint8_t ReportIndex, uint8_t ReportType, uint16_t ReportLength);\r
/** Event handler for the USB_DeviceAttached event. This indicates that a device has been attached to the host, and\r
* starts the library USB task to begin the enumeration and USB management process.\r
*/\r
-void EVENT_USB_DeviceAttached(void)\r
+void EVENT_USB_Host_DeviceAttached(void)\r
{\r
puts_P(PSTR(ESC_FG_GREEN "Device Attached.\r\n" ESC_FG_WHITE));\r
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
/** Event handler for the USB_DeviceUnattached event. This indicates that a device has been removed from the host, and\r
* stops the library USB task management process.\r
*/\r
-void EVENT_USB_DeviceUnattached(void)\r
+void EVENT_USB_Host_DeviceUnattached(void)\r
{\r
puts_P(PSTR(ESC_FG_GREEN "Device Unattached.\r\n" ESC_FG_WHITE));\r
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
/** Event handler for the USB_DeviceEnumerationComplete event. This indicates that a device has been successfully\r
* enumerated by the host and is now ready to be used by the application.\r
*/\r
-void EVENT_USB_DeviceEnumerationComplete(void)\r
+void EVENT_USB_Host_DeviceEnumerationComplete(void)\r
{\r
LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
}\r
\r
/** Event handler for the USB_HostError event. This indicates that a hardware error occurred while in host mode. */\r
-void EVENT_USB_HostError(const uint8_t ErrorCode)\r
+void EVENT_USB_Host_HostError(const uint8_t ErrorCode)\r
{\r
USB_ShutDown();\r
\r
/** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while\r
* enumerating an attached USB device.\r
*/\r
-void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
+void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
{\r
puts_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n"));\r
printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);\r
void Keyboard_HID_Task(void);\r
void SetupHardware(void);\r
\r
- void EVENT_USB_HostError(const uint8_t ErrorCode);\r
- void EVENT_USB_DeviceAttached(void);\r
- void EVENT_USB_DeviceUnattached(void);\r
- void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);\r
- void EVENT_USB_DeviceEnumerationComplete(void);\r
+ void EVENT_USB_Host_HostError(const uint8_t ErrorCode);\r
+ void EVENT_USB_Host_DeviceAttached(void);\r
+ void EVENT_USB_Host_DeviceUnattached(void);\r
+ void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);\r
+ void EVENT_USB_Host_DeviceEnumerationComplete(void);\r
\r
void ReadNextReport(void);\r
\r
/** Event handler for the USB_DeviceAttached event. This indicates that a device has been attached to the host, and\r
* starts the library USB task to begin the enumeration and USB management process.\r
*/\r
-void EVENT_USB_DeviceAttached(void)\r
+void EVENT_USB_Host_DeviceAttached(void)\r
{\r
puts_P(PSTR(ESC_FG_GREEN "Device Attached.\r\n" ESC_FG_WHITE));\r
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
/** Event handler for the USB_DeviceUnattached event. This indicates that a device has been removed from the host, and\r
* stops the library USB task management process.\r
*/\r
-void EVENT_USB_DeviceUnattached(void)\r
+void EVENT_USB_Host_DeviceUnattached(void)\r
{\r
puts_P(PSTR(ESC_FG_GREEN "\r\nDevice Unattached.\r\n" ESC_FG_WHITE));\r
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
/** Event handler for the USB_DeviceEnumerationComplete event. This indicates that a device has been successfully\r
* enumerated by the host and is now ready to be used by the application.\r
*/\r
-void EVENT_USB_DeviceEnumerationComplete(void)\r
+void EVENT_USB_Host_DeviceEnumerationComplete(void)\r
{\r
LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
}\r
\r
/** Event handler for the USB_HostError event. This indicates that a hardware error occurred while in host mode. */\r
-void EVENT_USB_HostError(const uint8_t ErrorCode)\r
+void EVENT_USB_Host_HostError(const uint8_t ErrorCode)\r
{\r
USB_ShutDown();\r
\r
/** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while\r
* enumerating an attached USB device.\r
*/\r
-void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
+void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
{\r
puts_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n"));\r
printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);\r
void Keyboard_HID_Task(void);\r
void SetupHardware(void);\r
\r
- void EVENT_USB_HostError(const uint8_t ErrorCode);\r
- void EVENT_USB_DeviceAttached(void);\r
- void EVENT_USB_DeviceUnattached(void);\r
- void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);\r
- void EVENT_USB_DeviceEnumerationComplete(void);\r
+ void EVENT_USB_Host_HostError(const uint8_t ErrorCode);\r
+ void EVENT_USB_Host_DeviceAttached(void);\r
+ void EVENT_USB_Host_DeviceUnattached(void);\r
+ void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);\r
+ void EVENT_USB_Host_DeviceEnumerationComplete(void);\r
\r
void ProcessKeyboardReport(uint8_t* KeyboardReport);\r
\r
/** Event handler for the USB_DeviceAttached event. This indicates that a device has been attached to the host, and\r
* starts the library USB task to begin the enumeration and USB management process.\r
*/\r
-void EVENT_USB_DeviceAttached(void)\r
+void EVENT_USB_Host_DeviceAttached(void)\r
{\r
puts_P(PSTR(ESC_FG_GREEN "Device Attached.\r\n" ESC_FG_WHITE));\r
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
/** Event handler for the USB_DeviceUnattached event. This indicates that a device has been removed from the host, and\r
* stops the library USB task management process.\r
*/\r
-void EVENT_USB_DeviceUnattached(void)\r
+void EVENT_USB_Host_DeviceUnattached(void)\r
{\r
puts_P(PSTR(ESC_FG_GREEN "\r\nDevice Unattached.\r\n" ESC_FG_WHITE));\r
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
/** Event handler for the USB_DeviceEnumerationComplete event. This indicates that a device has been successfully\r
* enumerated by the host and is now ready to be used by the application.\r
*/\r
-void EVENT_USB_DeviceEnumerationComplete(void)\r
+void EVENT_USB_Host_DeviceEnumerationComplete(void)\r
{\r
LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
}\r
/** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while\r
* enumerating an attached USB device.\r
*/\r
-void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
+void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
{\r
puts_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n"));\r
printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);\r
void MassStorage_Task(void);\r
void SetupHardware(void);\r
\r
- void EVENT_USB_HostError(const uint8_t ErrorCode);\r
- void EVENT_USB_DeviceAttached(void);\r
- void EVENT_USB_DeviceUnattached(void);\r
- void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);\r
- void EVENT_USB_DeviceEnumerationComplete(void);\r
+ void EVENT_USB_Host_HostError(const uint8_t ErrorCode);\r
+ void EVENT_USB_Host_DeviceAttached(void);\r
+ void EVENT_USB_Host_DeviceUnattached(void);\r
+ void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);\r
+ void EVENT_USB_Host_DeviceEnumerationComplete(void);\r
\r
void ShowDiskReadError(char* CommandString, bool FailedAtSCSILayer, uint8_t ErrorCode);\r
\r
/** Event handler for the USB_DeviceAttached event. This indicates that a device has been attached to the host, and\r
* starts the library USB task to begin the enumeration and USB management process.\r
*/\r
-void EVENT_USB_DeviceAttached(void)\r
+void EVENT_USB_Host_DeviceAttached(void)\r
{\r
puts_P(PSTR(ESC_FG_GREEN "Device Attached.\r\n" ESC_FG_WHITE));\r
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
/** Event handler for the USB_DeviceUnattached event. This indicates that a device has been removed from the host, and\r
* stops the library USB task management process.\r
*/\r
-void EVENT_USB_DeviceUnattached(void)\r
+void EVENT_USB_Host_DeviceUnattached(void)\r
{\r
puts_P(PSTR(ESC_FG_GREEN "Device Unattached.\r\n" ESC_FG_WHITE));\r
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
/** Event handler for the USB_DeviceEnumerationComplete event. This indicates that a device has been successfully\r
* enumerated by the host and is now ready to be used by the application.\r
*/\r
-void EVENT_USB_DeviceEnumerationComplete(void)\r
+void EVENT_USB_Host_DeviceEnumerationComplete(void)\r
{\r
LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
}\r
\r
/** Event handler for the USB_HostError event. This indicates that a hardware error occurred while in host mode. */\r
-void EVENT_USB_HostError(const uint8_t ErrorCode)\r
+void EVENT_USB_Host_HostError(const uint8_t ErrorCode)\r
{\r
USB_ShutDown();\r
\r
/** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while\r
* enumerating an attached USB device.\r
*/\r
-void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
+void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
{\r
puts_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n"));\r
printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);\r
void Mouse_HID_Task(void);\r
void SetupHardware(void);\r
\r
- void EVENT_USB_HostError(const uint8_t ErrorCode);\r
- void EVENT_USB_DeviceAttached(void);\r
- void EVENT_USB_DeviceUnattached(void);\r
- void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);\r
- void EVENT_USB_DeviceEnumerationComplete(void);\r
+ void EVENT_USB_Host_HostError(const uint8_t ErrorCode);\r
+ void EVENT_USB_Host_DeviceAttached(void);\r
+ void EVENT_USB_Host_DeviceUnattached(void);\r
+ void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);\r
+ void EVENT_USB_Host_DeviceEnumerationComplete(void);\r
\r
void ReadNextReport(void);\r
\r
/** Event handler for the USB_DeviceAttached event. This indicates that a device has been attached to the host, and\r
* starts the library USB task to begin the enumeration and USB management process.\r
*/\r
-void EVENT_USB_DeviceAttached(void)\r
+void EVENT_USB_Host_DeviceAttached(void)\r
{\r
puts_P(PSTR(ESC_FG_GREEN "Device Attached.\r\n" ESC_FG_WHITE));\r
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
/** Event handler for the USB_DeviceUnattached event. This indicates that a device has been removed from the host, and\r
* stops the library USB task management process.\r
*/\r
-void EVENT_USB_DeviceUnattached(void)\r
+void EVENT_USB_Host_DeviceUnattached(void)\r
{\r
puts_P(PSTR(ESC_FG_GREEN "Device Unattached.\r\n" ESC_FG_WHITE));\r
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
/** Event handler for the USB_DeviceEnumerationComplete event. This indicates that a device has been successfully\r
* enumerated by the host and is now ready to be used by the application.\r
*/\r
-void EVENT_USB_DeviceEnumerationComplete(void)\r
+void EVENT_USB_Host_DeviceEnumerationComplete(void)\r
{\r
LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
}\r
\r
/** Event handler for the USB_HostError event. This indicates that a hardware error occurred while in host mode. */\r
-void EVENT_USB_HostError(const uint8_t ErrorCode)\r
+void EVENT_USB_Host_HostError(const uint8_t ErrorCode)\r
{\r
USB_ShutDown();\r
\r
/** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while\r
* enumerating an attached USB device.\r
*/\r
-void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
+void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
{\r
puts_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n"));\r
printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);\r
void Mouse_HID_Task(void);\r
void SetupHardware(void);\r
\r
- void EVENT_USB_HostError(const uint8_t ErrorCode);\r
- void EVENT_USB_DeviceAttached(void);\r
- void EVENT_USB_DeviceUnattached(void);\r
- void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);\r
- void EVENT_USB_DeviceEnumerationComplete(void);\r
+ void EVENT_USB_Host_HostError(const uint8_t ErrorCode);\r
+ void EVENT_USB_Host_DeviceAttached(void);\r
+ void EVENT_USB_Host_DeviceUnattached(void);\r
+ void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);\r
+ void EVENT_USB_Host_DeviceEnumerationComplete(void);\r
\r
void ProcessMouseReport(uint8_t* MouseReport);\r
\r
/** Event handler for the USB_DeviceAttached event. This indicates that a device has been attached to the host, and\r
* starts the library USB task to begin the enumeration and USB management process.\r
*/\r
-void EVENT_USB_DeviceAttached(void)\r
+void EVENT_USB_Host_DeviceAttached(void)\r
{\r
puts_P(PSTR(ESC_FG_GREEN "Device Attached.\r\n" ESC_FG_WHITE));\r
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
/** Event handler for the USB_DeviceUnattached event. This indicates that a device has been removed from the host, and\r
* stops the library USB task management process.\r
*/\r
-void EVENT_USB_DeviceUnattached(void)\r
+void EVENT_USB_Host_DeviceUnattached(void)\r
{\r
puts_P(PSTR(ESC_FG_GREEN "\r\nDevice Unattached.\r\n" ESC_FG_WHITE));\r
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
/** Event handler for the USB_DeviceEnumerationComplete event. This indicates that a device has been successfully\r
* enumerated by the host and is now ready to be used by the application.\r
*/\r
-void EVENT_USB_DeviceEnumerationComplete(void)\r
+void EVENT_USB_Host_DeviceEnumerationComplete(void)\r
{\r
LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
}\r
\r
/** Event handler for the USB_HostError event. This indicates that a hardware error occurred while in host mode. */\r
-void EVENT_USB_HostError(uint8_t ErrorCode)\r
+void EVENT_USB_Host_HostError(uint8_t ErrorCode)\r
{\r
USB_ShutDown();\r
\r
/** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while\r
* enumerating an attached USB device.\r
*/\r
-void EVENT_USB_DeviceEnumerationFailed(uint8_t ErrorCode, uint8_t SubErrorCode)\r
+void EVENT_USB_Host_DeviceEnumerationFailed(uint8_t ErrorCode, uint8_t SubErrorCode)\r
{\r
puts_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n"));\r
printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);\r
#define LEDMASK_USB_BUSY (LEDS_LED2)\r
\r
/* Function Prototypes: */\r
- void EVENT_USB_DeviceAttached(void);\r
- void EVENT_USB_DeviceUnattached(void);\r
- void EVENT_USB_DeviceEnumerationComplete(void);\r
- void EVENT_USB_HostError(uint8_t ErrorCode);\r
- void EVENT_USB_DeviceEnumerationFailed(uint8_t ErrorCode, uint8_t SubErrorCode);\r
+ void EVENT_USB_Host_DeviceAttached(void);\r
+ void EVENT_USB_Host_DeviceUnattached(void);\r
+ void EVENT_USB_Host_DeviceEnumerationComplete(void);\r
+ void EVENT_USB_Host_HostError(uint8_t ErrorCode);\r
+ void EVENT_USB_Host_DeviceEnumerationFailed(uint8_t ErrorCode, uint8_t SubErrorCode);\r
\r
void SetupHardware(void);\r
\r
/** Event handler for the USB_DeviceAttached event. This indicates that a device has been attached to the host, and\r
* starts the library USB task to begin the enumeration and USB management process.\r
*/\r
-void EVENT_USB_DeviceAttached(void)\r
+void EVENT_USB_Host_DeviceAttached(void)\r
{\r
puts_P(PSTR(ESC_FG_GREEN "Device Attached.\r\n" ESC_FG_WHITE));\r
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
/** Event handler for the USB_DeviceUnattached event. This indicates that a device has been removed from the host, and\r
* stops the library USB task management process.\r
*/\r
-void EVENT_USB_DeviceUnattached(void)\r
+void EVENT_USB_Host_DeviceUnattached(void)\r
{\r
puts_P(PSTR(ESC_FG_GREEN "\r\nDevice Unattached.\r\n" ESC_FG_WHITE));\r
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
/** Event handler for the USB_DeviceEnumerationComplete event. This indicates that a device has been successfully\r
* enumerated by the host and is now ready to be used by the application.\r
*/\r
-void EVENT_USB_DeviceEnumerationComplete(void)\r
+void EVENT_USB_Host_DeviceEnumerationComplete(void)\r
{\r
LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
}\r
\r
/** Event handler for the USB_HostError event. This indicates that a hardware error occurred while in host mode. */\r
-void EVENT_USB_HostError(const uint8_t ErrorCode)\r
+void EVENT_USB_Host_HostError(const uint8_t ErrorCode)\r
{\r
USB_ShutDown();\r
\r
/** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while\r
* enumerating an attached USB device.\r
*/\r
-void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
+void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
{\r
puts_P(PSTR(ESC_FG_RED "Dev Enum Error\r\n"));\r
printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);\r
void StillImage_Task(void);\r
void SetupHardware(void);\r
\r
- void EVENT_USB_HostError(const uint8_t ErrorCode);\r
- void EVENT_USB_DeviceAttached(void);\r
- void EVENT_USB_DeviceUnattached(void);\r
- void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);\r
- void EVENT_USB_DeviceEnumerationComplete(void);\r
+ void EVENT_USB_Host_HostError(const uint8_t ErrorCode);\r
+ void EVENT_USB_Host_DeviceAttached(void);\r
+ void EVENT_USB_Host_DeviceUnattached(void);\r
+ void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);\r
+ void EVENT_USB_Host_DeviceEnumerationComplete(void);\r
\r
void UnicodeToASCII(uint8_t* restrict UnicodeString, char* restrict Buffer);\r
void ShowCommandError(uint8_t ErrorCode, bool ResponseCodeError);\r
for (;;);\r
}\r
\r
-/** Event handler for the USB_VBUSChange event. When fired, the event is logged to the USART. */\r
-void EVENT_USB_VBUSChange(void)\r
-{\r
- puts_P(PSTR(ESC_FG_YELLOW EVENT_PREFIX "VBUS Change\r\n" ESC_FG_WHITE));\r
-}\r
-\r
-/** Event handler for the USB_VBUSConnect event. When fired, the event is logged to the USART. */\r
-void EVENT_USB_VBUSConnect(void)\r
-{\r
- puts_P(PSTR(ESC_FG_YELLOW EVENT_PREFIX "VBUS +\r\n" ESC_FG_WHITE));\r
-}\r
-\r
-/** Event handler for the USB_VBUSDisconnect event. When fired, the event is logged to the USART. */\r
-void EVENT_USB_VBUSDisconnect(void)\r
-{\r
- puts_P(PSTR(ESC_FG_YELLOW EVENT_PREFIX "VBUS -\r\n" ESC_FG_WHITE));\r
-}\r
-\r
-/**\r
- * Event handler for the USB_Connect event. When fired, the event is logged to the USART and the\r
- * USB task started.\r
- */\r
-void EVENT_USB_Connect(void)\r
-{\r
- puts_P(PSTR(ESC_FG_YELLOW EVENT_PREFIX "USB +\r\n" ESC_FG_WHITE));\r
-}\r
-\r
-/**\r
- * Event handler for the USB_Disconnect event. When fired, the event is logged to the USART and the\r
- * USB task stopped.\r
- */\r
-void EVENT_USB_Disconnect(void)\r
-{\r
- puts_P(PSTR(ESC_FG_YELLOW EVENT_PREFIX "USB -\r\n" ESC_FG_WHITE));\r
-}\r
-\r
-/** Event handler for the USB_Suspend event. When fired, the event is logged to the USART. */\r
-void EVENT_USB_Suspend(void)\r
-{\r
- puts_P(PSTR(ESC_FG_YELLOW EVENT_PREFIX "USB Sleep\r\n" ESC_FG_WHITE));\r
-}\r
-\r
-/** Event handler for the USB_WakeUp event. When fired, the event is logged to the USART. */\r
-void EVENT_USB_WakeUp(void)\r
-{\r
- puts_P(PSTR(ESC_FG_YELLOW EVENT_PREFIX "USB Wakeup\r\n" ESC_FG_WHITE));\r
-}\r
-\r
-/** Event handler for the USB_Reset event. When fired, the event is logged to the USART. */\r
-void EVENT_USB_Reset(void)\r
-{\r
- puts_P(PSTR(ESC_FG_YELLOW EVENT_PREFIX "USB Reset\r\n" ESC_FG_WHITE));\r
-}\r
-\r
/** Event handler for the USB_UIDChange event. When fired, the event is logged to the USART. */\r
void EVENT_USB_UIDChange(void)\r
{\r
char* ModeStrPtr;\r
\r
- puts_P(PSTR(ESC_FG_YELLOW EVENT_PREFIX "UID Change\r\n"));\r
+ puts_P(PSTR(ESC_FG_RED EVENT_PREFIX "UID Change\r\n"));\r
\r
if (USB_CurrentMode == USB_MODE_DEVICE)\r
- ModeStrPtr = PSTR("HOST");\r
- else if (USB_CurrentMode == USB_MODE_HOST)\r
ModeStrPtr = PSTR("DEVICE");\r
+ else if (USB_CurrentMode == USB_MODE_HOST)\r
+ ModeStrPtr = PSTR("HOST");\r
else\r
ModeStrPtr = PSTR("N/A");\r
\r
}\r
\r
/**\r
- * Event handler for the USB_PowerOnFail event. When fired, the event is logged to the USART and the program\r
+ * Event handler for the USB_InitFailure event. When fired, the event is logged to the USART and the program\r
* execution aborted.\r
*/\r
void EVENT_USB_InitFailure(const uint8_t ErrorCode)\r
Abort_Program();\r
}\r
\r
-/**\r
- * Event handler for the USB_HostError event. When fired, the event is logged to the USART and the program\r
- * execution aborted.\r
- */\r
-void EVENT_USB_HostError(const uint8_t ErrorCode)\r
+/** Event handler for the USB_Device_Connect event. When fired, the event is logged to the USART. */\r
+void EVENT_USB_Device_Connect(void)\r
{\r
- puts_P(PSTR(ESC_FG_RED EVENT_PREFIX "Host Mode Error\r\n"));\r
- printf_P(PSTR(" -- Error Code %d\r\n" ESC_FG_WHITE), ErrorCode);\r
+ puts_P(PSTR(ESC_FG_GREEN EVENT_PREFIX "USB Connect\r\n" ESC_FG_WHITE));\r
+}\r
\r
- Abort_Program();\r
+/** Event handler for the USB_Device_Disconnect event. When fired, the event is logged to the USART. */\r
+void EVENT_USB_Device_Disconnect(void)\r
+{\r
+ puts_P(PSTR(ESC_FG_GREEN EVENT_PREFIX "USB Disconnect\r\n" ESC_FG_WHITE));\r
}\r
\r
-/** Event handler for the USB_DeviceEnumerationFailed event. When fired, the event is logged to the USART. */\r
-void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
+/** Event handler for the USB_Device_Suspend event. When fired, the event is logged to the USART. */\r
+void EVENT_USB_Device_Suspend(void)\r
{\r
- puts_P(PSTR(ESC_FG_RED EVENT_PREFIX "Dev Enum Error\r\n"));\r
- printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);\r
- printf_P(PSTR(" -- Sub Error Code %d\r\n"), SubErrorCode);\r
- printf_P(PSTR(" -- In State %d\r\n" ESC_FG_WHITE), USB_HostState);\r
+ puts_P(PSTR(ESC_FG_YELLOW EVENT_PREFIX "USB Sleep\r\n" ESC_FG_WHITE));\r
+}\r
+\r
+/** Event handler for the USB_Device_WakeUp event. When fired, the event is logged to the USART. */\r
+void EVENT_USB_Device_WakeUp(void)\r
+{\r
+ puts_P(PSTR(ESC_FG_YELLOW EVENT_PREFIX "USB Wakeup\r\n" ESC_FG_WHITE));\r
+}\r
+\r
+/** Event handler for the USB_Device_Reset event. When fired, the event is logged to the USART. */\r
+void EVENT_USB_Device_Reset(void)\r
+{\r
+ puts_P(PSTR(ESC_FG_YELLOW EVENT_PREFIX "USB Reset\r\n" ESC_FG_WHITE));\r
}\r
\r
-/** Event handler for the USB_UnhandledControlPacket event. When fired, the event is logged to the USART. */\r
-void EVENT_USB_UnhandledControlPacket(void)\r
+/** Event handler for the USB_Device_UnhandledControlRequest event. When fired, the event is logged to the USART. */\r
+void EVENT_USB_Device_UnhandledControlRequest(void)\r
{\r
puts_P(PSTR(ESC_FG_YELLOW EVENT_PREFIX "Ctrl Request\r\n"));\r
printf_P(PSTR(" -- Req Data %d\r\n"), USB_ControlRequest.bRequest);\r
printf_P(PSTR(" -- Req Length %d\r\n" ESC_FG_WHITE), USB_ControlRequest.wLength);\r
}\r
\r
-/** Event handler for the USB_ConfigurationChanged event. When fired, the event is logged to the USART. */\r
-void EVENT_USB_ConfigurationChanged(void)\r
+/** Event handler for the USB_Device_ConfigurationChanged event. When fired, the event is logged to the USART. */\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
{\r
puts_P(PSTR(ESC_FG_YELLOW EVENT_PREFIX "Configuration Number Changed\r\n" ESC_FG_WHITE));\r
}\r
\r
-/** Event handler for the USB_DeviceAttached event. When fired, the event is logged to the USART. */\r
-void EVENT_USB_DeviceAttached(void)\r
+/**\r
+ * Event handler for the USB_Host_HostError event. When fired, the event is logged to the USART and the program\r
+ * execution aborted.\r
+ */\r
+void EVENT_USB_Host_HostError(const uint8_t ErrorCode)\r
{\r
- puts_P(PSTR(ESC_FG_GREEN EVENT_PREFIX "Device +\r\n" ESC_FG_WHITE));\r
+ puts_P(PSTR(ESC_FG_RED EVENT_PREFIX "Host Mode Error\r\n"));\r
+ printf_P(PSTR(" -- Error Code %d\r\n" ESC_FG_WHITE), ErrorCode);\r
+\r
+ Abort_Program();\r
}\r
\r
-/** Event handler for the USB_DeviceUnattached event. When fired, the event is logged to the USART. */\r
-void EVENT_USB_DeviceUnattached(void)\r
+/** Event handler for the USB_Host_DeviceEnumerationFailed event. When fired, the event is logged to the USART. */\r
+void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
{\r
- puts_P(PSTR(ESC_FG_GREEN EVENT_PREFIX "Device -\r\n" ESC_FG_WHITE));\r
+ puts_P(PSTR(ESC_FG_RED EVENT_PREFIX "Dev Enum Error\r\n"));\r
+ printf_P(PSTR(" -- Error Code %d\r\n"), ErrorCode);\r
+ printf_P(PSTR(" -- Sub Error Code %d\r\n"), SubErrorCode);\r
+ printf_P(PSTR(" -- In State %d\r\n" ESC_FG_WHITE), USB_HostState);\r
}\r
\r
-/** Event handler for the USB_DeviceEnumerationComplete event. When fired, the event is logged to the USART. */\r
-void EVENT_USB_DeviceEnumerationComplete(void)\r
+/** Event handler for the USB_Host_DeviceEnumerationComplete event. When fired, the event is logged to the USART. */\r
+void EVENT_USB_Host_DeviceEnumerationComplete(void)\r
{\r
puts_P(PSTR(ESC_FG_YELLOW EVENT_PREFIX "Device Enumeration Complete\r\n" ESC_FG_WHITE));\r
}\r
+\r
+/** Event handler for the USB_Host_DeviceAttached event. When fired, the event is logged to the USART. */\r
+void EVENT_USB_Host_DeviceAttached(void)\r
+{\r
+ puts_P(PSTR(ESC_FG_GREEN EVENT_PREFIX "Device Attached\r\n" ESC_FG_WHITE));\r
+}\r
+\r
+/** Event handler for the USB_Host_DeviceUnattached event. When fired, the event is logged to the USART. */\r
+void EVENT_USB_Host_DeviceUnattached(void)\r
+{\r
+ puts_P(PSTR(ESC_FG_GREEN EVENT_PREFIX "Device Unattached\r\n" ESC_FG_WHITE));\r
+}\r
static void Abort_Program(void) ATTR_NO_RETURN;\r
#endif\r
\r
- void EVENT_USB_VBUSChange(void);\r
- void EVENT_USB_VBUSConnect(void);\r
- void EVENT_USB_VBUSDisconnect(void);\r
- void EVENT_USB_Connect(void);\r
- void EVENT_USB_Disconnect(void);\r
void EVENT_USB_InitFailure(const uint8_t ErrorCode);\r
void EVENT_USB_UIDChange(void);\r
- void EVENT_USB_HostError(const uint8_t ErrorCode);\r
- void EVENT_USB_DeviceAttached(void);\r
- void EVENT_USB_DeviceUnattached(void);\r
- void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);\r
- void EVENT_USB_DeviceEnumerationComplete(void);\r
- void EVENT_USB_UnhandledControlPacket(void);\r
- void EVENT_USB_ConfigurationChanged(void);\r
- void EVENT_USB_Suspend(void);\r
- void EVENT_USB_WakeUp(void);\r
- void EVENT_USB_Reset(void); \r
+ void EVENT_USB_Host_HostError(const uint8_t ErrorCode);\r
+ void EVENT_USB_Host_DeviceAttached(void);\r
+ void EVENT_USB_Host_DeviceUnattached(void);\r
+ void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);\r
+ void EVENT_USB_Host_DeviceEnumerationComplete(void);\r
+ void EVENT_USB_Device_Connect(void);\r
+ void EVENT_USB_Device_Disconnect(void);\r
+ void EVENT_USB_Device_ConfigurationChanged(void);\r
+ void EVENT_USB_Device_ConfigurationChanged(void);\r
+ void EVENT_USB_Device_Suspend(void);\r
+ void EVENT_USB_Device_WakeUp(void);\r
+ void EVENT_USB_Device_Reset(void); \r
\r
#endif\r
\r
#include "Audio.h"\r
\r
-void Audio_Device_ProcessControlPacket(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo)\r
+void Audio_Device_ProcessControlRequest(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo)\r
{\r
if (!(Endpoint_IsSETUPReceived()))\r
return;\r
\r
/* Function Prototypes: */\r
/** Configures the endpoints of a given Audio interface, ready for use. This should be linked to the library\r
- * \ref EVENT_USB_ConfigurationChanged() event so that the endpoints are configured when the configuration containing the\r
+ * \ref EVENT_USB_Device_ConfigurationChanged() event so that the endpoints are configured when the configuration containing the\r
* given Audio interface is selected.\r
*\r
* \param[in,out] AudioInterfaceInfo Pointer to a structure containing an Audio Class configuration and state.\r
bool Audio_Device_ConfigureEndpoints(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo);\r
\r
/** Processes incomming control requests from the host, that are directed to the given Audio class interface. This should be\r
- * linked to the library \ref EVENT_USB_UnhandledControlPacket() event.\r
+ * linked to the library \ref EVENT_USB_Device_UnhandledControlRequest() event.\r
*\r
* \param[in,out] AudioInterfaceInfo Pointer to a structure containing an Audio Class configuration and state.\r
*/\r
- void Audio_Device_ProcessControlPacket(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo);\r
+ void Audio_Device_ProcessControlRequest(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo);\r
\r
/** General management task for a given Audio 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
\r
-void CDC_Device_ProcessControlPacket(USB_ClassInfo_CDC_Device_t* CDCInterfaceInfo)\r
+void CDC_Device_ProcessControlRequest(USB_ClassInfo_CDC_Device_t* CDCInterfaceInfo)\r
{\r
if (!(Endpoint_IsSETUPReceived()))\r
return;\r
\r
/* Function Prototypes: */ \r
/** Configures the endpoints of a given CDC interface, ready for use. This should be linked to the library\r
- * \ref EVENT_USB_ConfigurationChanged() event so that the endpoints are configured when the configuration containing the\r
- * given CDC interface is selected.\r
+ * \ref EVENT_USB_Device_ConfigurationChanged() event so that the endpoints are configured when the configuration containing\r
+ * the given CDC interface is selected.\r
*\r
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state.\r
*\r
bool CDC_Device_ConfigureEndpoints(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo);\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
+ * linked to the library \ref EVENT_USB_Device_UnhandledControlRequest() event.\r
*\r
* \param[in,out] CDCInterfaceInfo Pointer to a structure containing a CDC Class configuration and state.\r
*/\r
- void CDC_Device_ProcessControlPacket(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo);\r
+ void CDC_Device_ProcessControlRequest(USB_ClassInfo_CDC_Device_t* const 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
#include "HID.h"\r
\r
-void HID_Device_ProcessControlPacket(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo)\r
+void HID_Device_ProcessControlRequest(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo)\r
{\r
if (!(Endpoint_IsSETUPReceived()))\r
return;\r
\r
/* Function Prototypes: */\r
/** Configures the endpoints of a given HID interface, ready for use. This should be linked to the library\r
- * \ref EVENT_USB_ConfigurationChanged() event so that the endpoints are configured when the configuration\r
+ * \ref EVENT_USB_Device_ConfigurationChanged() event so that the endpoints are configured when the configuration\r
* containing the given HID interface is selected.\r
*\r
* \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class configuration and state.\r
bool HID_Device_ConfigureEndpoints(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo);\r
\r
/** Processes incomming control requests from the host, that are directed to the given HID class interface. This should be\r
- * linked to the library \ref EVENT_USB_UnhandledControlPacket() event.\r
+ * linked to the library \ref EVENT_USB_Device_UnhandledControlRequest() event.\r
*\r
* \param[in,out] HIDInterfaceInfo Pointer to a structure containing a HID Class configuration and state.\r
*/ \r
- void HID_Device_ProcessControlPacket(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo);\r
+ void HID_Device_ProcessControlRequest(USB_ClassInfo_HID_Device_t* HIDInterfaceInfo);\r
\r
/** General management task for a given HID 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
#include "MIDI.h"\r
\r
-void MIDI_Device_ProcessControlPacket(USB_ClassInfo_MIDI_Device_t* const MIDIInterfaceInfo)\r
+void MIDI_Device_ProcessControlRequest(USB_ClassInfo_MIDI_Device_t* const MIDIInterfaceInfo)\r
{\r
\r
}\r
\r
/* Function Prototypes: */\r
/** Configures the endpoints of a given MIDI interface, ready for use. This should be linked to the library\r
- * \ref EVENT_USB_ConfigurationChanged() event so that the endpoints are configured when the configuration\r
+ * \ref EVENT_USB_Device_ConfigurationChanged() event so that the endpoints are configured when the configuration\r
* containing the given MIDI interface is selected.\r
*\r
* \param[in,out] MIDIInterfaceInfo Pointer to a structure containing a MIDI Class configuration and state.\r
bool MIDI_Device_ConfigureEndpoints(USB_ClassInfo_MIDI_Device_t* const MIDIInterfaceInfo);\r
\r
/** Processes incomming control requests from the host, that are directed to the given MIDI class interface. This should be\r
- * linked to the library \ref EVENT_USB_UnhandledControlPacket() event.\r
+ * linked to the library \ref EVENT_USB_Device_UnhandledControlRequest() event.\r
*\r
* \param[in,out] MIDIInterfaceInfo Pointer to a structure containing a MIDI Class configuration and state.\r
*/ \r
- void MIDI_Device_ProcessControlPacket(USB_ClassInfo_MIDI_Device_t* const MIDIInterfaceInfo);\r
+ void MIDI_Device_ProcessControlRequest(USB_ClassInfo_MIDI_Device_t* const MIDIInterfaceInfo);\r
\r
/** General management task for a given MIDI 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
static USB_ClassInfo_MS_Device_t* CallbackMSInterfaceInfo;\r
\r
-void MS_Device_ProcessControlPacket(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo)\r
+void MS_Device_ProcessControlRequest(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo)\r
{\r
if (!(Endpoint_IsSETUPReceived()))\r
return;\r
\r
/* Function Prototypes: */\r
/** Configures the endpoints of a given Mass Storage interface, ready for use. This should be linked to the library\r
- * \ref EVENT_USB_ConfigurationChanged() event so that the endpoints are configured when the configuration\r
+ * \ref EVENT_USB_Device_ConfigurationChanged() event so that the endpoints are configured when the configuration\r
* containing the given Mass Storage interface is selected.\r
*\r
* \param[in,out] MSInterfaceInfo Pointer to a structure containing a Mass Storage Class configuration and state.\r
bool MS_Device_ConfigureEndpoints(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo);\r
\r
/** Processes incomming control requests from the host, that are directed to the given Mass Storage class interface. This should be\r
- * linked to the library \ref EVENT_USB_UnhandledControlPacket() event.\r
+ * linked to the library \ref EVENT_USB_Device_UnhandledControlRequest() event.\r
*\r
* \param[in,out] MSInterfaceInfo Pointer to a structure containing a Mass Storage Class configuration and state.\r
*/ \r
- void MS_Device_ProcessControlPacket(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo);\r
+ void MS_Device_ProcessControlRequest(USB_ClassInfo_MS_Device_t* const MSInterfaceInfo);\r
\r
/** General management task for a given Mass Storage 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
OID_802_3_XMIT_MORE_COLLISIONS,\r
};\r
\r
-void RNDIS_Device_ProcessControlPacket(USB_ClassInfo_RNDIS_Device_t* const RNDISInterfaceInfo)\r
+void RNDIS_Device_ProcessControlRequest(USB_ClassInfo_RNDIS_Device_t* const RNDISInterfaceInfo)\r
{\r
if (!(Endpoint_IsSETUPReceived()))\r
return;\r
\r
/* Function Prototypes: */\r
/** Configures the endpoints of a given RNDIS interface, ready for use. This should be linked to the library\r
- * \ref EVENT_USB_ConfigurationChanged() event so that the endpoints are configured when the configuration\r
+ * \ref EVENT_USB_Device_ConfigurationChanged() event so that the endpoints are configured when the configuration\r
* containing the given HID interface is selected.\r
*\r
* \param[in,out] RNDISInterfaceInfo Pointer to a structure containing a RNDIS Class configuration and state.\r
bool RNDIS_Device_ConfigureEndpoints(USB_ClassInfo_RNDIS_Device_t* const RNDISInterfaceInfo);\r
\r
/** Processes incomming control requests from the host, that are directed to the given RNDIS class interface. This should be\r
- * linked to the library \ref EVENT_USB_UnhandledControlPacket() event.\r
+ * linked to the library \ref EVENT_USB_Device_UnhandledControlRequest() event.\r
*\r
* \param[in,out] RNDISInterfaceInfo Pointer to a structure containing a RNDIS Class configuration and state.\r
*/ \r
- void RNDIS_Device_ProcessControlPacket(USB_ClassInfo_RNDIS_Device_t* const RNDISInterfaceInfo);\r
+ void RNDIS_Device_ProcessControlRequest(USB_ClassInfo_RNDIS_Device_t* const RNDISInterfaceInfo);\r
\r
/** General management task for a given HID 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
/* Public Interface - May be used in end-application: */ \r
/* Pseudo-Functions for Doxygen: */\r
#if !defined(INCLUDE_FROM_EVENTS_C) || defined(__DOXYGEN__)\r
- /** Event for VBUS level change. This event fires when the VBUS line of the USB AVR changes from\r
- * high to low or vice-versa, before the new VBUS level is sampled and the appropriate action\r
- * taken.\r
- *\r
- * \note This event is only available on USB AVR models which support VBUS notification interrupts.\r
- */\r
- void EVENT_USB_VBUSChange(void);\r
-\r
- /** Event for VBUS attachment. On the AVR models with a dedicated VBUS pin, this event fires when\r
- * the VBUS line of the USB AVR changes from low to high (after the VBUS events have been handled),\r
- * signalling the attachment of the USB device to a host, before the enumeration process has begun.\r
- *\r
- * \note This event is only available on USB AVR models which support VBUS notification interrupts.\r
- */\r
- void EVENT_USB_VBUSConnect(void);\r
-\r
- /** Event for VBUS attachment. On the AVR models with a dedicated VBUS pin, this event fires when\r
- * the VBUS line of the USB AVR changes from high to low (after the VBUS events have been handled),\r
- * signalling the detatchment of the USB device from a host, regardless of its enumeration state.\r
- *\r
- * \note This event is only available on USB AVR models which support VBUS notification interrupts.\r
- */\r
- void EVENT_USB_VBUSDisconnect(void);\r
-\r
- /** Event for USB device connection. This event fires when the AVR is in USB host mode and a device\r
- * has been attached (but not yet fully enumerated), or when in device mode and the device is connected\r
- * to a host, beginning the enumeration process.\r
- *\r
- * When in device mode, this can be used to programmatically start the USB management task to reduce\r
- * CPU usage.\r
- *\r
- * \note For the smaller USB AVRs (AT90USBXX2) with limited USB controllers, VBUS is not available to the USB controller.\r
- * this means that the current connection state is derived from the bus suspension and wake up events by default,\r
- * which is not always accurate (host may suspend the bus while still connected). If the actual connection state\r
- * needs to be determined, VBUS should be routed to an external pin, and the auto-detect behaviour turned off by\r
- * passing the NO_LIMITED_CONTROLLER_CONNECT token to the compiler via the -D switch at compile time. The connection\r
- * and disconnection events may be manually fired, and the \ref USB_DeviceState global changed manually.\r
- *\r
- * \see USBTask.h for more information on the USB management task and reducing CPU usage.\r
- */\r
- void EVENT_USB_Connect(void);\r
-\r
- /** Event for USB device disconnection. This event fires when the AVR is in USB host mode and an\r
- * attached and enumerated device has been disconnected, or when in device mode and the device is\r
- * disconnected from the host.\r
- *\r
- * When in device mode, this can be used to programmatically stop the USB management task to reduce\r
- * CPU usage.\r
- *\r
- * \note For the smaller USB AVRs (AT90USBXX2) with limited USB controllers, VBUS is not available to the USB controller.\r
- * this means that the current connection state is derived from the bus suspension and wake up events by default,\r
- * which is not always accurate (host may suspend the bus while still connected). If the actual connection state\r
- * needs to be determined, VBUS should be routed to an external pin, and the auto-detect behaviour turned off by\r
- * passing the NO_LIMITED_CONTROLLER_CONNECT token to the compiler via the -D switch at compile time. The connection\r
- * and disconnection events may be manually fired, and the \ref USB_DeviceState global changed manually.\r
- *\r
- * \see USBTask.h for more information on the USB management task and reducing CPU usage.\r
- */\r
- void EVENT_USB_Disconnect(void);\r
- \r
- /** Event for USB initialization failure. This event fires when the USB interface fails to\r
+ /** Event for USB stack initialization failure. This event fires when the USB interface fails to\r
* initialize correctly due to a hardware or software fault.\r
*\r
* \note This event only exists on USB AVR models which support dual role modes.\r
\r
/** Event for USB mode pin level change. This event fires when the USB interface is set to dual role\r
* mode, and the UID pin level has changed to indicate a new mode (device or host). This event fires\r
- * before the mode is switched to the newly indicated mode but after the \ref EVENT_USB_Disconnect event\r
- * has fired (if connected before the role change).\r
+ * before the mode is switched to the newly indicated mode but after the \ref EVENT_USB_Device_Disconnect\r
+ * event has fired (if connected before the role change).\r
*\r
* \note This event only exists on USB AVR models which support dual role modes.\r
*\r
* \note This event does not exist if the USB_DEVICE_ONLY token is supplied to the compiler (see\r
* \ref Group_USBManagement documentation).\r
*/\r
- void EVENT_USB_HostError(const uint8_t ErrorCode);\r
+ void EVENT_USB_Host_HostError(const uint8_t ErrorCode);\r
\r
/** Event for USB device attachment. This event fires when a the USB interface is in host mode, and\r
* a USB device has been connected to the USB interface. This is interrupt driven, thus fires before\r
- * the standard \ref EVENT_USB_Connect event and so can be used to programmatically start the USB management\r
- * task to reduce CPU consumption.\r
+ * the standard \ref EVENT_USB_Device_Connect event and so can be used to programmatically start the USB\r
+ * management task to reduce CPU consumption.\r
*\r
* \note This event only exists on USB AVR models which supports host mode.\r
*\r
*\r
* \see \ref USB_USBTask() for more information on the USB management task and reducing CPU usage.\r
*/\r
- void EVENT_USB_DeviceAttached(void);\r
+ void EVENT_USB_Host_DeviceAttached(void);\r
\r
/** Event for USB device removal. This event fires when a the USB interface is in host mode, and\r
* a USB device has been removed the USB interface whether or not it has been enumerated. This\r
*\r
* \see \ref USB_USBTask() for more information on the USB management task and reducing CPU usage.\r
*/\r
- void EVENT_USB_DeviceUnattached(void);\r
+ void EVENT_USB_Host_DeviceUnattached(void);\r
\r
/** Event for USB device enumeration failure. This event fires when a the USB interface is\r
* in host mode, and an attached USB device has failed to enumerate completely.\r
* \note This event does not exist if the USB_DEVICE_ONLY token is supplied to the compiler (see\r
* \ref Group_USBManagement documentation).\r
*/\r
- void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);\r
+ void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);\r
\r
/** Event for USB device enumeration completion. This event fires when a the USB interface is\r
* in host mode and an attached USB device has been completely enumerated and is ready to be\r
- * controlled by the user application, or when the library is in device mode, and the Host\r
- * has finished enumerating the device.\r
+ * controlled by the user application.\r
*/\r
- void EVENT_USB_DeviceEnumerationComplete(void);\r
+ void EVENT_USB_Host_DeviceEnumerationComplete(void);\r
+\r
+ /** Event for USB device connection. This event fires when the AVR in device mode and the device is connected\r
+ * to a host, beginning the enumeration process, measured by a rising level on the AVR's VBUS pin.\r
+ *\r
+ * \note For the smaller USB AVRs (AT90USBXX2) with limited USB controllers, VBUS is not available to the USB controller.\r
+ * this means that the current connection state is derived from the bus suspension and wake up events by default,\r
+ * which is not always accurate (host may suspend the bus while still connected). If the actual connection state\r
+ * needs to be determined, VBUS should be routed to an external pin, and the auto-detect behaviour turned off by\r
+ * passing the NO_LIMITED_CONTROLLER_CONNECT token to the compiler via the -D switch at compile time. The connection\r
+ * and disconnection events may be manually fired, and the \ref USB_DeviceState global changed manually.\r
+ *\r
+ * \see USBTask.h for more information on the USB management task and reducing CPU usage.\r
+ */\r
+ void EVENT_USB_Device_Connect(void);\r
+\r
+ /** Event for USB device disconnection. This event fires when the AVR in device mode and the device is disconnected\r
+ * from a host, measured by a falling level on the AVR's VBUS pin.\r
+ *\r
+ * \note For the smaller USB AVRs (AT90USBXX2) with limited USB controllers, VBUS is not available to the USB controller.\r
+ * this means that the current connection state is derived from the bus suspension and wake up events by default,\r
+ * which is not always accurate (host may suspend the bus while still connected). If the actual connection state\r
+ * needs to be determined, VBUS should be routed to an external pin, and the auto-detect behaviour turned off by\r
+ * passing the NO_LIMITED_CONTROLLER_CONNECT token to the compiler via the -D switch at compile time. The connection\r
+ * and disconnection events may be manually fired, and the \ref USB_DeviceState global changed manually.\r
+ *\r
+ * \see USBTask.h for more information on the USB management task and reducing CPU usage.\r
+ */\r
+ void EVENT_USB_Device_Disconnect(void);\r
\r
/** Event for unhandled control requests. This event fires when a the USB host issues a control\r
* request to the control endpoint (address 0) that the library does not handle. This may either\r
* request SETUP parameters into the \ref USB_ControlRequest structure which should then be used\r
* by the application to determine how to handle the issued request.\r
*/\r
- void EVENT_USB_UnhandledControlPacket(void);\r
+ void EVENT_USB_Device_UnhandledControlRequest(void);\r
\r
/** Event for USB configuration number changed. This event fires when a the USB host changes the\r
* selected configuration number while in device mode. This event should be hooked in device\r
* \note This event does not exist if the USB_HOST_ONLY token is supplied to the compiler (see\r
* \ref Group_USBManagement documentation).\r
*/\r
- void EVENT_USB_ConfigurationChanged(void);\r
+ void EVENT_USB_Device_ConfigurationChanged(void);\r
\r
/** Event for USB suspend. This event fires when a the USB host suspends the device by halting its\r
* transmission of Start Of Frame pulses to the device. This is generally hooked in order to move\r
* \note This event does not exist if the USB_HOST_ONLY token is supplied to the compiler (see\r
* \ref Group_USBManagement documentation).\r
*\r
- * \see \ref EVENT_USB_WakeUp() event for accompanying Wake Up event.\r
+ * \see \ref EVENT_USB_Device_WakeUp() event for accompanying Wake Up event.\r
*/\r
- void EVENT_USB_Suspend(void);\r
+ void EVENT_USB_Device_Suspend(void);\r
\r
/** Event for USB wake up. This event fires when a the USB interface is suspended while in device\r
* mode, and the host wakes up the device by supplying Start Of Frame pulses. This is generally\r
* \note This event does not exist if the USB_HOST_ONLY token is supplied to the compiler (see\r
* \ref Group_USBManagement documentation).\r
*\r
- * \see \ref EVENT_USB_Suspend() event for accompanying Suspend event.\r
+ * \see \ref EVENT_USB_Device_Suspend() event for accompanying Suspend event.\r
*/\r
- void EVENT_USB_WakeUp(void);\r
+ void EVENT_USB_Device_WakeUp(void);\r
\r
/** Event for USB interface reset. This event fires when the USB interface is in device mode, and\r
* a the USB host requests that the device reset its interface. This event fires after the control\r
* \note This event does not exist if the USB_HOST_ONLY token is supplied to the compiler (see\r
* \ref Group_USBManagement documentation).\r
*/\r
- void EVENT_USB_Reset(void);\r
+ void EVENT_USB_Device_Reset(void);\r
#endif\r
\r
/* Private Interface - For use in library only: */\r
/* Function Prototypes: */\r
#if defined(INCLUDE_FROM_EVENTS_C)\r
void USB_Event_Stub(void) ATTR_CONST;\r
-\r
- #if (defined(USB_SERIES_4_AVR) || defined(USB_SERIES_6_AVR) || defined(USB_SERIES_7_AVR))\r
- void EVENT_USB_VBUSChange(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);\r
- void EVENT_USB_VBUSConnect(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);\r
- void EVENT_USB_VBUSDisconnect(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);\r
- #endif\r
\r
- void EVENT_USB_Connect(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);\r
- void EVENT_USB_Disconnect(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);\r
- void EVENT_USB_DeviceEnumerationComplete(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);\r
- \r
#if defined(USB_CAN_BE_BOTH)\r
void EVENT_USB_InitFailure(const uint8_t ErrorCode) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);\r
void EVENT_USB_UIDChange(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);\r
#endif\r
\r
#if defined(USB_CAN_BE_HOST)\r
- void EVENT_USB_HostError(const uint8_t ErrorCode) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);\r
- void EVENT_USB_DeviceAttached(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);\r
- void EVENT_USB_DeviceUnattached(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);\r
- void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
+ void EVENT_USB_Host_HostError(const uint8_t ErrorCode) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);\r
+ void EVENT_USB_Host_DeviceAttached(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);\r
+ void EVENT_USB_Host_DeviceUnattached(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);\r
+ void EVENT_USB_Host_DeviceEnumerationComplete(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);\r
+ void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);\r
#endif\r
\r
- void EVENT_USB_UnhandledControlPacket(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);\r
- void EVENT_USB_ConfigurationChanged(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);\r
- void EVENT_USB_Suspend(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);\r
- void EVENT_USB_WakeUp(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);\r
- void EVENT_USB_Reset(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);\r
+ #if defined(USB_CAN_BE_DEVICE)\r
+ void EVENT_USB_Device_Connect(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);\r
+ void EVENT_USB_Device_Disconnect(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);\r
+ void EVENT_USB_Device_UnhandledControlRequest(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);\r
+ void EVENT_USB_Device_ConfigurationChanged(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);\r
+ void EVENT_USB_Device_Suspend(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);\r
+ void EVENT_USB_Device_WakeUp(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);\r
+ void EVENT_USB_Device_Reset(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);\r
+ #endif\r
#endif\r
#endif\r
\r
{\r
REQ_GetStatus = 0, /**< Implemented in the library for device, endpoint and interface\r
* recipients. Passed to the user application for other recipients\r
- * via the \ref EVENT_USB_UnhandledControlPacket() event when received in\r
+ * via the \ref EVENT_USB_Device_UnhandledControlRequest() event when received in\r
* device mode. */\r
REQ_ClearFeature = 1, /**< Implemented in the library for device, endpoint and interface\r
* recipients. Passed to the user application for other recipients\r
- * via the \ref EVENT_USB_UnhandledControlPacket() event when received in\r
+ * via the \ref EVENT_USB_Device_UnhandledControlRequest() event when received in\r
* device mode. */\r
REQ_SetFeature = 3, /**< Implemented in the library for device, endpoint and interface\r
* recipients. Passed to the user application for other recipients\r
- * via the \ref EVENT_USB_UnhandledControlPacket() event when received in\r
+ * via the \ref EVENT_USB_Device_UnhandledControlRequest() event when received in\r
* device mode. */\r
REQ_SetAddress = 5, /**< Implemented in the library for the device recipient. Passed\r
* to the user application for other recipients via the\r
- * \ref EVENT_USB_UnhandledControlPacket() event when received in\r
+ * \ref EVENT_USB_Device_UnhandledControlRequest() event when received in\r
* device mode. */\r
REQ_GetDescriptor = 6, /**< Implemented in the library for all recipients and all request\r
* types. */\r
REQ_SetDescriptor = 7, /**< Not implemented in the library, passed to the user application\r
- * via the \ref EVENT_USB_UnhandledControlPacket() event when received in\r
+ * via the \ref EVENT_USB_Device_UnhandledControlRequest() event when received in\r
* device mode. */\r
REQ_GetConfiguration = 8, /**< Implemented in the library for the device recipient. Passed\r
* to the user application for other recipients via the\r
- * \ref EVENT_USB_UnhandledControlPacket() event when received in\r
+ * \ref EVENT_USB_Device_UnhandledControlRequest() event when received in\r
* device mode. */\r
REQ_SetConfiguration = 9, /**< Implemented in the library for the device recipient. Passed\r
* to the user application for other recipients via the\r
- * \ref EVENT_USB_UnhandledControlPacket() event when received in\r
+ * \ref EVENT_USB_Device_UnhandledControlRequest() event when received in\r
* device mode. */\r
REQ_GetInterface = 10, /**< Not implemented in the library, passed to the user application\r
- * via the \ref EVENT_USB_UnhandledControlPacket() event when received in\r
+ * via the \ref EVENT_USB_Device_UnhandledControlRequest() event when received in\r
* device mode. */\r
REQ_SetInterface = 11, /**< Not implemented in the library, passed to the user application\r
- * via the \ref EVENT_USB_UnhandledControlPacket() event when received in\r
+ * via the \ref EVENT_USB_Device_UnhandledControlRequest() event when received in\r
* device mode. */\r
REQ_SynchFrame = 12, /**< Not implemented in the library, passed to the user application\r
- * via the \ref EVENT_USB_UnhandledControlPacket() event when received in\r
+ * via the \ref EVENT_USB_Device_UnhandledControlRequest() event when received in\r
* device mode. */\r
};\r
\r
{\r
USB_INT_Clear(USB_INT_VBUS);\r
\r
- EVENT_USB_VBUSChange();\r
-\r
if (USB_VBUS_GetStatus())\r
{\r
- EVENT_USB_VBUSConnect();\r
- \r
- if (USB_DeviceState != DEVICE_STATE_Unattached)\r
- EVENT_USB_Disconnect();\r
- \r
- USB_ResetInterface();\r
-\r
USB_DeviceState = DEVICE_STATE_Powered;\r
- EVENT_USB_Connect();\r
+ EVENT_USB_Device_Connect();\r
}\r
else\r
{\r
- USB_DeviceState = DEVICE_STATE_Unattached;\r
- EVENT_USB_Disconnect();\r
- \r
- USB_Detach();\r
- USB_CLK_Freeze();\r
-\r
- if (!(USB_Options & USB_OPT_MANUAL_PLL))\r
- USB_PLL_Off();\r
-\r
- USB_REG_Off();\r
-\r
- EVENT_USB_VBUSDisconnect();\r
- \r
- USB_INT_Clear(USB_INT_VBUS);\r
+ USB_DeviceState = DEVICE_STATE_Unattached; \r
+ EVENT_USB_Device_Disconnect();\r
}\r
}\r
#endif\r
\r
#if defined(USB_SERIES_2_AVR) && !defined(NO_LIMITED_CONTROLLER_CONNECT)\r
USB_DeviceState = DEVICE_STATE_Unattached;\r
- EVENT_USB_Disconnect();\r
+ EVENT_USB_Device_Disconnect();\r
#else\r
USB_DeviceState = DEVICE_STATE_Suspended;\r
- EVENT_USB_Suspend();\r
+ EVENT_USB_Device_Suspend();\r
#endif\r
}\r
\r
USB_INT_Enable(USB_INT_SUSPEND);\r
\r
#if defined(USB_SERIES_2_AVR) && !defined(NO_LIMITED_CONTROLLER_CONNECT)\r
- USB_DeviceState = DEVICE_STATE_Powered;\r
- EVENT_USB_Connect();\r
+ USB_DeviceState = (USB_ConfigurationNumber) ? DEVICE_STATE_Configured : DEVICE_STATE_Powered;\r
+ EVENT_USB_Device_Connect();\r
#else\r
USB_DeviceState = (USB_ConfigurationNumber) ? DEVICE_STATE_Configured : DEVICE_STATE_Addressed;\r
- EVENT_USB_WakeUp(); \r
+ EVENT_USB_Device_WakeUp(); \r
#endif\r
}\r
\r
USB_INT_Enable(USB_INT_ENDPOINT_SETUP);\r
#endif\r
\r
- EVENT_USB_Reset();\r
+ EVENT_USB_Device_Reset();\r
}\r
#endif\r
\r
USB_INT_Clear(USB_INT_DCONNI);\r
USB_INT_Disable(USB_INT_DDISCI);\r
\r
- EVENT_USB_DeviceUnattached();\r
- EVENT_USB_Disconnect();\r
+ EVENT_USB_Host_DeviceUnattached();\r
\r
USB_ResetInterface();\r
}\r
USB_Host_VBUS_Manual_Off();\r
USB_Host_VBUS_Auto_Off();\r
\r
- EVENT_USB_HostError(HOST_ERROR_VBusVoltageDip);\r
- EVENT_USB_DeviceUnattached();\r
+ EVENT_USB_Host_HostError(HOST_ERROR_VBusVoltageDip);\r
+ EVENT_USB_Host_DeviceUnattached();\r
\r
USB_HostState = HOST_STATE_Unattached;\r
}\r
USB_INT_Clear(USB_INT_SRPI);\r
USB_INT_Disable(USB_INT_SRPI);\r
\r
- EVENT_USB_DeviceAttached();\r
+ EVENT_USB_Host_DeviceAttached();\r
\r
USB_INT_Enable(USB_INT_DDISCI);\r
\r
{\r
USB_INT_Clear(USB_INT_BCERRI);\r
\r
- EVENT_USB_DeviceEnumerationFailed(HOST_ENUMERROR_NoDeviceDetected, 0);\r
- EVENT_USB_DeviceUnattached();\r
- \r
- if (USB_HostState != HOST_STATE_Unattached)\r
- EVENT_USB_Disconnect();\r
+ EVENT_USB_Host_DeviceEnumerationFailed(HOST_ENUMERROR_NoDeviceDetected, 0);\r
+ EVENT_USB_Host_DeviceUnattached();\r
\r
USB_ResetInterface();\r
}\r
EVENT_USB_Disconnect();\r
\r
if (USB_HostState != HOST_STATE_Unattached)\r
- {\r
- EVENT_USB_Disconnect();\r
- EVENT_USB_DeviceUnattached();\r
- }\r
- \r
- EVENT_USB_Disconnect();\r
-\r
- EVENT_USB_UIDChange();\r
+ EVENT_USB_Host_DeviceUnattached();\r
\r
+ USB_CurrentMode = USB_GetUSBModeFromUID();\r
+ EVENT_USB_UIDChange();\r
+\r
USB_ResetInterface();\r
}\r
#endif\r
Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP);\r
\r
if (Endpoint_IsSETUPReceived())\r
- USB_Device_ProcessControlPacket();\r
+ USB_Device_ProcessControlRequest();\r
\r
Endpoint_SelectEndpoint(PrevEndpoint);\r
}\r
extern volatile bool USB_IsInitialized;\r
\r
/** Structure containing the last received Control request when in Device mode (for use in user-applications\r
- * inside of the \ref EVENT_USB_UnhandledControlPacket() event, or for filling up with a control request to issue when\r
+ * inside of the \ref EVENT_USB_Device_UnhandledControlRequest() event, or for filling up with a control request to issue when\r
* in Host mode before calling \ref USB_Host_SendControlRequest().\r
*\r
* \ingroup Group_USBManagement\r
*\r
* This value should not be altered by the user application as it is handled automatically by the\r
* library. The only exception to this rule is if the NO_LIMITED_CONTROLLER_CONNECT token is used\r
- * (see \ref EVENT_USB_Connect() and \ref EVENT_USB_Disconnect() events).\r
+ * (see \ref EVENT_USB_Device_Connect() and \ref EVENT_USB_Device_Disconnect() events).\r
*\r
* To reduce program size and speed up checks of this global, it can be placed into one of the AVR's\r
* GPIOR hardware registers instead of RAM by defining the DEVICE_STATE_AS_GPIOR token to a value \r
* The USB task must be serviced within 30ms while in device mode, or within 1ms while in host mode.\r
* The task may be serviced at all times, or (for minimum CPU consumption):\r
*\r
- * - In device mode, it may be disabled at start-up, enabled on the firing of the \ref EVENT_USB_Connect() event\r
- * and disabled again on the firing of the \ref EVENT_USB_Disconnect() event.\r
+ * - In device mode, it may be disabled at start-up, enabled on the firing of the \ref EVENT_USB_Device_Connect() \r
+ * event and disabled again on the firing of the \ref EVENT_USB_Device_Disconnect() event.\r
*\r
- * - In host mode, it may be disabled at start-up, enabled on the firing of the \ref EVENT_USB_DeviceAttached()\r
- * event and disabled again on the firing of the \ref EVENT_USB_DeviceEnumerationComplete() or\r
- * \ref EVENT_USB_DeviceEnumerationFailed() events.\r
+ * - In host mode, it may be disabled at start-up, enabled on the firing of the \ref EVENT_USB_Host_DeviceAttached()\r
+ * event and disabled again on the firing of the \ref EVENT_USB_Host_DeviceEnumerationComplete() or\r
+ * \ref EVENT_USB_Host_DeviceEnumerationFailed() events.\r
*\r
* If in device mode (only), the control endpoint can instead be managed via interrupts entirely by the library\r
* by defining the INTERRUPT_CONTROL_ENDPOINT token and passing it to the compiler via the -D switch.\r
bool USB_RemoteWakeupEnabled;\r
bool USB_CurrentlySelfPowered;\r
\r
-void USB_Device_ProcessControlPacket(void)\r
+void USB_Device_ProcessControlRequest(void)\r
{\r
bool RequestHandled = false;\r
uint8_t* RequestHeader = (uint8_t*)&USB_ControlRequest;\r
}\r
\r
if (!(RequestHandled))\r
- EVENT_USB_UnhandledControlPacket();\r
+ EVENT_USB_Device_UnhandledControlRequest();\r
\r
if (Endpoint_IsSETUPReceived())\r
{\r
\r
static void USB_Device_SetConfiguration(void)\r
{\r
- bool AlreadyConfigured = (USB_ConfigurationNumber != 0);\r
-\r
#if defined(FIXED_NUM_CONFIGURATIONS)\r
if ((uint8_t)USB_ControlRequest.wValue > FIXED_NUM_CONFIGURATIONS)\r
return;\r
Endpoint_ClearIN();\r
\r
if (USB_ConfigurationNumber)\r
- {\r
- USB_DeviceState = DEVICE_STATE_Configured;\r
-\r
- if (!(AlreadyConfigured))\r
- EVENT_USB_DeviceEnumerationComplete();\r
- }\r
+ USB_DeviceState = DEVICE_STATE_Configured;\r
else\r
- {\r
- USB_DeviceState = DEVICE_STATE_Addressed;\r
- }\r
+ USB_DeviceState = DEVICE_STATE_Addressed;\r
\r
- EVENT_USB_ConfigurationChanged();\r
+ EVENT_USB_Device_ConfigurationChanged();\r
}\r
\r
void USB_Device_GetConfiguration(void)\r
#endif\r
\r
/* Function Prototypes: */\r
- void USB_Device_ProcessControlPacket(void);\r
+ void USB_Device_ProcessControlRequest(void);\r
\r
#if defined(INCLUDE_FROM_DEVCHAPTER9_C)\r
static void USB_Device_SetAddress(void);\r
\r
USB_INT_Clear(USB_INT_VBERRI);\r
USB_INT_Enable(USB_INT_VBERRI);\r
-\r
- EVENT_USB_Connect();\r
\r
USB_Host_ResumeBus();\r
Pipe_ClearPipes();\r
case HOST_STATE_Default_PostAddressSet:\r
USB_Host_SetDeviceAddress(USB_HOST_DEVICEADDRESS);\r
\r
- EVENT_USB_DeviceEnumerationComplete();\r
+ EVENT_USB_Host_DeviceEnumerationComplete();\r
USB_HostState = HOST_STATE_Addressed;\r
break;\r
}\r
\r
if ((ErrorCode != HOST_ENUMERROR_NoError) && (USB_HostState != HOST_STATE_Unattached))\r
{\r
- EVENT_USB_DeviceEnumerationFailed(ErrorCode, SubErrorCode);\r
+ EVENT_USB_Host_DeviceEnumerationFailed(ErrorCode, SubErrorCode);\r
\r
USB_Host_VBUS_Auto_Off();\r
\r
- EVENT_USB_DeviceUnattached();\r
- EVENT_USB_Disconnect();\r
+ EVENT_USB_Host_DeviceUnattached();\r
\r
USB_ResetInterface();\r
}\r
*/\r
};\r
\r
- /** Enum for the error codes for the \ref EVENT_USB_HostError() event.\r
+ /** Enum for the error codes for the \ref EVENT_USB_Host_HostError() event.\r
*\r
* \see \ref Group_Events for more information on this event.\r
*/\r
*/\r
};\r
\r
- /** Enum for the error codes for the \ref EVENT_USB_DeviceEnumerationFailed() event.\r
+ /** Enum for the error codes for the \ref EVENT_USB_Host_DeviceEnumerationFailed() event.\r
*\r
* \see \ref Group_Events for more information on this event.\r
*/\r
enum USB_Host_EnumerationErrorCodes_t\r
{\r
HOST_ENUMERROR_NoError = 0, /**< No error occurred. Used internally, this is not a valid\r
- * ErrorCode parameter value for the \ref EVENT_USB_DeviceEnumerationFailed()\r
+ * ErrorCode parameter value for the \ref EVENT_USB_Host_DeviceEnumerationFailed()\r
* event.\r
*/\r
HOST_ENUMERROR_WaitStage = 1, /**< One of the delays between enumeration steps failed\r
\r
void USB_ShutDown(void)\r
{\r
- #if defined(USB_CAN_BE_DEVICE)\r
- if (USB_DeviceState != DEVICE_STATE_Unattached)\r
- EVENT_USB_Disconnect();\r
- #endif\r
- \r
- #if defined(USB_CAN_BE_HOST)\r
- if (USB_HostState != HOST_STATE_Unattached)\r
- EVENT_USB_Disconnect();\r
- #endif\r
-\r
USB_ResetInterface();\r
USB_Detach();\r
USB_Controller_Disable();\r
USB_Device_SetLowSpeed();\r
else\r
USB_Device_SetFullSpeed();\r
- \r
- USB_INT_Enable(USB_INT_VBUS);\r
}\r
#endif\r
\r
if (CALLBACK_USB_GetDescriptor((DTYPE_Device << 8), 0, (void*)&DeviceDescriptorPtr) != NO_DESCRIPTOR)\r
{ \r
#if defined(USE_RAM_DESCRIPTORS)\r
- USB_ControlEndpointSize = DeviceDescriptorPtr->Endpoint0Size;\r
+ USB_ControlEndpointSize = DeviceDescriptorPtr->Endpoint0Size;\r
#elif defined(USE_EEPROM_DESCRIPTORS)\r
- USB_ControlEndpointSize = eeprom_read_byte(&DeviceDescriptorPtr->Endpoint0Size);\r
+ USB_ControlEndpointSize = eeprom_read_byte(&DeviceDescriptorPtr->Endpoint0Size);\r
#else\r
- USB_ControlEndpointSize = pgm_read_byte(&DeviceDescriptorPtr->Endpoint0Size);\r
+ USB_ControlEndpointSize = pgm_read_byte(&DeviceDescriptorPtr->Endpoint0Size);\r
#endif\r
}\r
}\r
\r
USB_Attach();\r
\r
- #if defined(USB_DEVICE_ONLY) \r
+ #if defined(USB_DEVICE_ONLY)\r
+ USB_INT_Clear(USB_INT_SUSPEND);\r
USB_INT_Enable(USB_INT_SUSPEND);\r
+ USB_INT_Clear(USB_INT_EORSTI);\r
USB_INT_Enable(USB_INT_EORSTI);\r
- #if defined(CONTROL_ONLY_DEVICE)\r
- UENUM = ENDPOINT_CONTROLEP;\r
- #endif\r
- \r
+\r
+ #if defined(USB_SERIES_4_AVR) || defined(USB_SERIES_6_AVR) || defined(USB_SERIES_7_AVR)\r
+ USB_INT_Enable(USB_INT_VBUS);\r
+ #endif\r
+\r
+ #if defined(CONTROL_ONLY_DEVICE)\r
+ UENUM = ENDPOINT_CONTROLEP;\r
+ #endif\r
#elif defined(USB_HOST_ONLY)\r
USB_Host_HostMode_On();\r
\r
#else\r
if (USB_CurrentMode == USB_MODE_DEVICE)\r
{\r
+ USB_INT_Clear(USB_INT_SUSPEND);\r
USB_INT_Enable(USB_INT_SUSPEND);\r
+ USB_INT_Clear(USB_INT_EORSTI);\r
USB_INT_Enable(USB_INT_EORSTI);\r
\r
+ #if defined(USB_SERIES_4_AVR) || defined(USB_SERIES_6_AVR) || defined(USB_SERIES_7_AVR)\r
+ USB_INT_Enable(USB_INT_VBUS);\r
+ #endif\r
+\r
#if defined(CONTROL_ONLY_DEVICE)\r
UENUM = ENDPOINT_CONTROLEP;\r
#endif\r
#endif\r
\r
/** Detaches the device from the USB bus. This has the effect of removing the device from any\r
- * host if, ceasing USB communications. If no host is present, this prevents any host from\r
+ * attached host, ceasing USB communications. If no host is present, this prevents any host from\r
* enumerating the device once attached until \ref USB_Attach() is called.\r
*/\r
#define USB_Detach() MACROS{ UDCON |= (1 << DETACH); }MACROE\r
\r
#define USB_Controller_Enable() MACROS{ USBCON |= (1 << USBE); }MACROE\r
#define USB_Controller_Disable() MACROS{ USBCON &= ~(1 << USBE); }MACROE\r
- #define USB_Controller_Reset() MACROS{ uint8_t Temp = USBCON; USBCON = (Temp & ~(1 << USBE)); \\r
+ #define USB_Controller_Reset() MACROS{ const uint8_t Temp = USBCON; USBCON = (Temp & ~(1 << USBE)); \\r
USBCON = (Temp | (1 << USBE)); }MACROE\r
\r
/* Inline Functions: */\r
* - AudioOutput demos now always output to board LEDs, regardless of output mode (removed AUDIO_OUT_LEDS project option)\r
* - Removed SINGLE_DEVICE_CONFIGURATION compile time option in favour of the new FIXED_NUM_CONFIGURATIONS option so that the exact number\r
* of device configurations can be defined statically\r
+ * - Removed VBUS events, as they are already exposed to the user application via the regular device connection and disconnection events\r
+ * - Renamed and altered existing events to properly seperate out Host and Device mode events\r
*\r
* <b>Fixed:</b>\r
* - Changed bootloaders to use FLASHEND rather than the existence of RAMPZ to determine if far FLASH pointers are needed to fix\r
* VBUS events, the library attempts to determine the connection state via the bus suspension and wake up events instead. This however may be\r
* slightly inaccurate due to the possibility of the host suspending the bus while the device is still connected. If accurate connection status is\r
* required, the VBUS line of the USB connector should be routed to an AVR pin to detect its level, so that the USB_DeviceState global\r
- * can be accurately set and the USB_Connect and USB_Disconnect events manually raised by the RAISE_EVENT macro. When defined, this token disables\r
- * the library's auto-detection of the connection state by the aforementioned suspension and wake up events.\r
+ * can be accurately set and the \ref EVENT_USB_Device_Connect() and \ref EVENT_USB_Device_Disconnect() events manually raised by the RAISE_EVENT macro.\r
+ * When defined, this token disables the library's auto-detection of the connection state by the aforementioned suspension and wake up events.\r
*\r
* <b>INTERRUPT_CONTROL_ENDPOINT</b> - ( \ref Group_USBManagement ) \n\r
* Some applications prefer to not call the USB_USBTask() management task reguarly while in device mode, as it can complicate code significantly.\r
* state.\r
* - The USB_IsConnected global has been removed, as it is too vague for general use. Test \ref USB_HostState explicitly to ensure the host is\r
* in the desired state instead.\r
+ * - The USB event names have been changed and their firing conditions changed to properly seperate out Host mode events from Device mode\r
+ * events. See the \ref Group_Events page for details on the new event names and firing conditions.\r
*\r
* <b>Device Mode</b>\r
* - The \ref CALLBACK_USB_GetDescriptor() function now takes an extra parameter to specify the descriptor's memory space so that\r
* - The USB_IsSuspended global has been removed - test \ref USB_DeviceState against \ref DEVICE_STATE_Suspended instead.\r
* - The USB_IsConnected global has been removed, as it is too vague for general use. Test \ref USB_DeviceState explicitly to ensure the device\r
* is in the desired state instead.\r
- *\r
+ * - The VBUS events have been removed, as they are already exposed to the user via the USB_Connect and USB_Disconnect events.\r
+ * - The USB event names have been changed and their firing conditions changed to properly seperate out Host mode events from Device mode\r
+ * events. See the \ref Group_Events page for details on the new event names and firing conditions. *\r
*\r
* \section Sec_Migration090605 Migrating from 090510 to 090605\r
*\r
}\r
\r
/** Event handler for the library USB Connection event. */\r
-void EVENT_USB_Connect(void)\r
+void EVENT_USB_Device_Connect(void)\r
{\r
PingPongMSRemaining = PING_PONG_LED_PULSE_MS;\r
LEDs_SetAllLEDs(LEDMASK_TX);\r
}\r
\r
/** Event handler for the library USB Disconnection event. */\r
-void EVENT_USB_Disconnect(void)\r
+void EVENT_USB_Device_Disconnect(void)\r
{\r
PingPongMSRemaining = 0;\r
LEDs_TurnOffLEDs(LEDMASK_BUSY);\r
}\r
\r
/** Event handler for the library USB Configuration Changed event. */\r
-void EVENT_USB_ConfigurationChanged(void)\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
{\r
PingPongMSRemaining = 0;\r
LEDs_TurnOffLEDs(LEDMASK_BUSY);\r
LEDs_TurnOnLEDs(LEDMASK_ERROR);\r
}\r
\r
-/** Event handler for the library USB Unhandled Control Packet event. */\r
-void EVENT_USB_UnhandledControlPacket(void)\r
+/** Event handler for the library USB Unhandled Control Request event. */\r
+void EVENT_USB_Device_UnhandledControlRequest(void)\r
{\r
- CDC_Device_ProcessControlPacket(&VirtualSerial_CDC_Interface);\r
+ CDC_Device_ProcessControlRequest(&VirtualSerial_CDC_Interface);\r
}\r
\r
/** Event handler for the CDC Class driver Line Encoding Changed event.\r
/* Function Prototypes: */\r
void SetupHardware(void);\r
\r
- void EVENT_USB_Connect(void);\r
- void EVENT_USB_Disconnect(void);\r
- void EVENT_USB_ConfigurationChanged(void);\r
- void EVENT_USB_UnhandledControlPacket(void);\r
+ void EVENT_USB_Device_Connect(void);\r
+ void EVENT_USB_Device_Disconnect(void);\r
+ void EVENT_USB_Device_ConfigurationChanged(void);\r
+ void EVENT_USB_Device_UnhandledControlRequest(void);\r
\r
void EVENT_CDC_Device_LineEncodingChanged(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo);\r
void EVENT_CDC_Device_ControLineStateChanged(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo);\r
}\r
\r
/** Event handler for the library USB Configuration Changed event. */\r
-void EVENT_USB_ConfigurationChanged(void)\r
+void EVENT_USB_Device_ConfigurationChanged(void)\r
{\r
HID_Device_ConfigureEndpoints(&Keyboard_HID_Interface);\r
}\r
\r
/** Event handler for the library USB Unhandled Control Packet event. */\r
-void EVENT_USB_UnhandledControlPacket(void)\r
+void EVENT_USB_Device_UnhandledControlRequest(void)\r
{\r
- HID_Device_ProcessControlPacket(&Keyboard_HID_Interface);\r
+ HID_Device_ProcessControlRequest(&Keyboard_HID_Interface);\r
}\r
\r
/** Timer 0 CTC ISR, firing once each millisecond to keep track of elapsed idle time in the HID interface. */\r
void SetupHardware(void);\r
void ReadMagstripeData(void);\r
\r
- void EVENT_USB_ConfigurationChanged(void);\r
- void EVENT_USB_UnhandledControlPacket(void);\r
+ void EVENT_USB_Device_ConfigurationChanged(void);\r
+ void EVENT_USB_Device_UnhandledControlRequest(void);\r
\r
bool CALLBACK_HID_Device_CreateHIDReport(USB_ClassInfo_HID_Device_t* const HIDInterfaceInfo, uint8_t* const ReportID,\r
void* ReportData, uint16_t* ReportSize);\r
/** Event handler for the USB_DeviceAttached event. This indicates that a device has been attached to the host, and\r
* starts the library USB task to begin the enumeration and USB management process.\r
*/\r
-void EVENT_USB_DeviceAttached(void)\r
+void EVENT_USB_Host_DeviceAttached(void)\r
{\r
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);\r
}\r
/** Event handler for the USB_DeviceUnattached event. This indicates that a device has been removed from the host, and\r
* stops the library USB task management process.\r
*/\r
-void EVENT_USB_DeviceUnattached(void)\r
+void EVENT_USB_Host_DeviceUnattached(void)\r
{\r
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);\r
}\r
/** Event handler for the USB_DeviceEnumerationComplete event. This indicates that a device has been successfully\r
* enumerated by the host and is now ready to be used by the application.\r
*/\r
-void EVENT_USB_DeviceEnumerationComplete(void)\r
+void EVENT_USB_Host_DeviceEnumerationComplete(void)\r
{\r
LEDs_SetAllLEDs(LEDMASK_USB_READY);\r
}\r
\r
/** Event handler for the USB_HostError event. This indicates that a hardware error occurred while in host mode. */\r
-void EVENT_USB_HostError(const uint8_t ErrorCode)\r
+void EVENT_USB_Host_HostError(const uint8_t ErrorCode)\r
{\r
USB_ShutDown();\r
\r
/** Event handler for the USB_DeviceEnumerationFailed event. This indicates that a problem occurred while\r
* enumerating an attached USB device.\r
*/\r
-void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
+void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode)\r
{\r
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
}\r
\r
void HID_Host_Task(void);\r
\r
- void EVENT_USB_HostError(const uint8_t ErrorCode);\r
- void EVENT_USB_DeviceAttached(void);\r
- void EVENT_USB_DeviceUnattached(void);\r
- void EVENT_USB_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);\r
- void EVENT_USB_DeviceEnumerationComplete(void);\r
+ void EVENT_USB_Host_HostError(const uint8_t ErrorCode);\r
+ void EVENT_USB_Host_DeviceAttached(void);\r
+ void EVENT_USB_Host_DeviceUnattached(void);\r
+ void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode);\r
+ void EVENT_USB_Host_DeviceEnumerationComplete(void);\r
\r
void DiscardNextReport(void);\r
void WriteNextReport(uint8_t* ReportOUTData, uint16_t ReportLength);\r