diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2009-08-05 06:36:31 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2009-08-05 06:36:31 +0000 |
commit | c5038f1bf44aea75f1ae1ed035cb7d523ccfdacb (patch) | |
tree | 5cf62e8642cc53c49eb28f973db843df5f047ba3 /Demos/Device/LowLevel | |
parent | 357ccc577bc6f8710ff942019e16cfa6a08466b7 (diff) | |
download | lufa-c5038f1bf44aea75f1ae1ed035cb7d523ccfdacb.tar.gz lufa-c5038f1bf44aea75f1ae1ed035cb7d523ccfdacb.tar.bz2 lufa-c5038f1bf44aea75f1ae1ed035cb7d523ccfdacb.zip |
Renamed all library events to properly seperate out Device and Host mode events. Changed the firing conditions for some events to ensure that events are fired by their own USB mode only.
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.
Diffstat (limited to 'Demos/Device/LowLevel')
26 files changed, 122 insertions, 112 deletions
diff --git a/Demos/Device/LowLevel/AudioInput/AudioInput.c b/Demos/Device/LowLevel/AudioInput/AudioInput.c index bf790169d..a01c6729c 100644 --- a/Demos/Device/LowLevel/AudioInput/AudioInput.c +++ b/Demos/Device/LowLevel/AudioInput/AudioInput.c @@ -78,7 +78,7 @@ void SetupHardware(void) /** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs, and
* configures the sample update and PWM timers.
*/
-void EVENT_USB_Connect(void)
+void EVENT_USB_Device_Connect(void)
{
/* Indicate USB enumerating */
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
@@ -92,7 +92,7 @@ void EVENT_USB_Connect(void) /** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via
* the status LEDs, disables the sample update and PWM output timers and stops the USB and Audio management tasks.
*/
-void EVENT_USB_Disconnect(void)
+void EVENT_USB_Device_Disconnect(void)
{
/* Stop the sample reload timer */
TCCR0B = 0;
@@ -107,7 +107,7 @@ void EVENT_USB_Disconnect(void) /** Event handler for the USB_ConfigurationChanged event. This is fired when the host set the current configuration
* of the USB device after enumeration - the device endpoints are configured.
*/
-void EVENT_USB_ConfigurationChanged(void)
+void EVENT_USB_Device_ConfigurationChanged(void)
{
/* Indicate USB connected and ready */
LEDs_SetAllLEDs(LEDMASK_USB_READY);
@@ -121,11 +121,11 @@ void EVENT_USB_ConfigurationChanged(void) }
}
-/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific
+/** Event handler for the USB_UnhandledControlRequest event. This is used to catch standard and class specific
* control requests that are not handled internally by the USB library (including the Audio class-specific
* requests) so that they can be handled appropriately for the application.
*/
-void EVENT_USB_UnhandledControlPacket(void)
+void EVENT_USB_Device_UnhandledControlRequest(void)
{
/* Process General and Audio specific control requests */
switch (USB_ControlRequest.bRequest)
diff --git a/Demos/Device/LowLevel/AudioInput/AudioInput.h b/Demos/Device/LowLevel/AudioInput/AudioInput.h index 591d3f355..f74491dac 100644 --- a/Demos/Device/LowLevel/AudioInput/AudioInput.h +++ b/Demos/Device/LowLevel/AudioInput/AudioInput.h @@ -74,9 +74,9 @@ void SetupHardware(void);
void USB_Audio_Task(void);
- void EVENT_USB_Connect(void);
- void EVENT_USB_Disconnect(void);
- void EVENT_USB_ConfigurationChanged(void);
- void EVENT_USB_UnhandledControlPacket(void);
+ void EVENT_USB_Device_Connect(void);
+ void EVENT_USB_Device_Disconnect(void);
+ void EVENT_USB_Device_ConfigurationChanged(void);
+ void EVENT_USB_Device_UnhandledControlRequest(void);
#endif
diff --git a/Demos/Device/LowLevel/AudioOutput/AudioOutput.c b/Demos/Device/LowLevel/AudioOutput/AudioOutput.c index 7dde84bb3..1128e8f4e 100644 --- a/Demos/Device/LowLevel/AudioOutput/AudioOutput.c +++ b/Demos/Device/LowLevel/AudioOutput/AudioOutput.c @@ -73,7 +73,7 @@ void SetupHardware(void) /** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs, and
* configures the sample update and PWM timers.
*/
-void EVENT_USB_Connect(void)
+void EVENT_USB_Device_Connect(void)
{
/* Indicate USB enumerating */
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
@@ -105,7 +105,7 @@ void EVENT_USB_Connect(void) /** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via
* the status LEDs, disables the sample update and PWM output timers and stops the USB and Audio management tasks.
*/
-void EVENT_USB_Disconnect(void)
+void EVENT_USB_Device_Disconnect(void)
{
/* Stop the timers */
TCCR0B = 0;
@@ -134,7 +134,7 @@ void EVENT_USB_Disconnect(void) /** Event handler for the USB_ConfigurationChanged event. This is fired when the host set the current configuration
* of the USB device after enumeration - the device endpoints are configured.
*/
-void EVENT_USB_ConfigurationChanged(void)
+void EVENT_USB_Device_ConfigurationChanged(void)
{
/* Indicate USB connected and ready */
LEDs_SetAllLEDs(LEDMASK_USB_READY);
@@ -148,11 +148,11 @@ void EVENT_USB_ConfigurationChanged(void) }
}
-/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific
+/** Event handler for the USB_UnhandledControlRequest event. This is used to catch standard and class specific
* control requests that are not handled internally by the USB library (including the Audio class-specific
* requests) so that they can be handled appropriately for the application.
*/
-void EVENT_USB_UnhandledControlPacket(void)
+void EVENT_USB_Device_UnhandledControlRequest(void)
{
/* Process General and Audio specific control requests */
switch (USB_ControlRequest.bRequest)
diff --git a/Demos/Device/LowLevel/AudioOutput/AudioOutput.h b/Demos/Device/LowLevel/AudioOutput/AudioOutput.h index 6c8d733f3..362a5540a 100644 --- a/Demos/Device/LowLevel/AudioOutput/AudioOutput.h +++ b/Demos/Device/LowLevel/AudioOutput/AudioOutput.h @@ -65,9 +65,9 @@ void SetupHardware(void);
void USB_Audio_Task(void);
- void EVENT_USB_Connect(void);
- void EVENT_USB_Disconnect(void);
- void EVENT_USB_ConfigurationChanged(void);
- void EVENT_USB_UnhandledControlPacket(void);
+ void EVENT_USB_Device_Connect(void);
+ void EVENT_USB_Device_Disconnect(void);
+ void EVENT_USB_Device_ConfigurationChanged(void);
+ void EVENT_USB_Device_UnhandledControlRequest(void);
#endif
diff --git a/Demos/Device/LowLevel/CDC/CDC.c b/Demos/Device/LowLevel/CDC/CDC.c index 4b5409f5c..9ee744ea0 100644 --- a/Demos/Device/LowLevel/CDC/CDC.c +++ b/Demos/Device/LowLevel/CDC/CDC.c @@ -143,7 +143,7 @@ void SetupHardware(void) /** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs and
* starts the library USB task to begin the enumeration and USB management process.
*/
-void EVENT_USB_Connect(void)
+void EVENT_USB_Device_Connect(void)
{
/* Indicate USB enumerating */
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
@@ -152,7 +152,7 @@ void EVENT_USB_Connect(void) /** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via
* the status LEDs and stops the USB management and CDC management tasks.
*/
-void EVENT_USB_Disconnect(void)
+void EVENT_USB_Device_Disconnect(void)
{
/* Indicate USB not ready */
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
@@ -161,7 +161,7 @@ void EVENT_USB_Disconnect(void) /** Event handler for the USB_ConfigurationChanged event. This is fired when the host set the current configuration
* of the USB device after enumeration - the device endpoints are configured and the CDC management task started.
*/
-void EVENT_USB_ConfigurationChanged(void)
+void EVENT_USB_Device_ConfigurationChanged(void)
{
/* Indicate USB connected and ready */
LEDs_SetAllLEDs(LEDMASK_USB_READY);
@@ -187,13 +187,16 @@ void EVENT_USB_ConfigurationChanged(void) {
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
}
+
+ /* Reset line encoding baud rate so that the host knows to send new values */
+ LineEncoding.BaudRateBPS = 0;
}
-/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific
+/** Event handler for the USB_UnhandledControlRequest event. This is used to catch standard and class specific
* control requests that are not handled internally by the USB library (including the CDC control commands,
* which are all issued via the control endpoint), so that they can be handled appropriately for the application.
*/
-void EVENT_USB_UnhandledControlPacket(void)
+void EVENT_USB_Device_UnhandledControlRequest(void)
{
/* Process CDC specific control requests */
switch (USB_ControlRequest.bRequest)
diff --git a/Demos/Device/LowLevel/CDC/CDC.h b/Demos/Device/LowLevel/CDC/CDC.h index a8f7199ab..4a7b6b158 100644 --- a/Demos/Device/LowLevel/CDC/CDC.h +++ b/Demos/Device/LowLevel/CDC/CDC.h @@ -175,9 +175,9 @@ void SetupHardware(void);
void CDC_Task(void);
- void EVENT_USB_Connect(void);
- void EVENT_USB_Disconnect(void);
- void EVENT_USB_ConfigurationChanged(void);
- void EVENT_USB_UnhandledControlPacket(void);
+ void EVENT_USB_Device_Connect(void);
+ void EVENT_USB_Device_Disconnect(void);
+ void EVENT_USB_Device_ConfigurationChanged(void);
+ void EVENT_USB_Device_UnhandledControlRequest(void);
#endif
diff --git a/Demos/Device/LowLevel/DualCDC/DualCDC.c b/Demos/Device/LowLevel/DualCDC/DualCDC.c index 654ce863e..c49a1ad85 100644 --- a/Demos/Device/LowLevel/DualCDC/DualCDC.c +++ b/Demos/Device/LowLevel/DualCDC/DualCDC.c @@ -97,7 +97,7 @@ void SetupHardware(void) /** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs and
* starts the library USB task to begin the enumeration and USB management process.
*/
-void EVENT_USB_Connect(void)
+void EVENT_USB_Device_Connect(void)
{
/* Indicate USB enumerating */
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
@@ -106,7 +106,7 @@ void EVENT_USB_Connect(void) /** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via
* the status LEDs and stops the USB management and CDC management tasks.
*/
-void EVENT_USB_Disconnect(void)
+void EVENT_USB_Device_Disconnect(void)
{
/* Indicate USB not ready */
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
@@ -115,7 +115,7 @@ void EVENT_USB_Disconnect(void) /** Event handler for the USB_ConfigurationChanged event. This is fired when the host set the current configuration
* of the USB device after enumeration - the device endpoints are configured and the CDC management tasks are started.
*/
-void EVENT_USB_ConfigurationChanged(void)
+void EVENT_USB_Device_ConfigurationChanged(void)
{
/* Indicate USB connected and ready */
LEDs_SetAllLEDs(LEDMASK_USB_READY);
@@ -163,13 +163,17 @@ void EVENT_USB_ConfigurationChanged(void) {
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
}
+
+ /* Reset line encoding baud rates so that the host knows to send new values */
+ LineEncoding1.BaudRateBPS = 0;
+ LineEncoding2.BaudRateBPS = 0;
}
-/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific
+/** Event handler for the USB_UnhandledControlRequest event. This is used to catch standard and class specific
* control requests that are not handled internally by the USB library (including the CDC control commands,
* which are all issued via the control endpoint), so that they can be handled appropriately for the application.
*/
-void EVENT_USB_UnhandledControlPacket(void)
+void EVENT_USB_Device_UnhandledControlRequest(void)
{
/* Determine which interface's Line Coding data is being set from the wIndex parameter */
uint8_t* LineEncodingData = (USB_ControlRequest.wIndex == 0) ? (uint8_t*)&LineEncoding1 : (uint8_t*)&LineEncoding2;
diff --git a/Demos/Device/LowLevel/DualCDC/DualCDC.h b/Demos/Device/LowLevel/DualCDC/DualCDC.h index d6f09e643..b2085c452 100644 --- a/Demos/Device/LowLevel/DualCDC/DualCDC.h +++ b/Demos/Device/LowLevel/DualCDC/DualCDC.h @@ -111,9 +111,9 @@ void CDC2_Task(void);
void SetupHardware(void);
- void EVENT_USB_Connect(void);
- void EVENT_USB_Disconnect(void);
- void EVENT_USB_ConfigurationChanged(void);
- void EVENT_USB_UnhandledControlPacket(void);
+ void EVENT_USB_Device_Connect(void);
+ void EVENT_USB_Device_Disconnect(void);
+ void EVENT_USB_Device_ConfigurationChanged(void);
+ void EVENT_USB_Device_UnhandledControlRequest(void);
#endif
diff --git a/Demos/Device/LowLevel/GenericHID/GenericHID.c b/Demos/Device/LowLevel/GenericHID/GenericHID.c index 34c991f12..5a8bb5187 100644 --- a/Demos/Device/LowLevel/GenericHID/GenericHID.c +++ b/Demos/Device/LowLevel/GenericHID/GenericHID.c @@ -74,7 +74,7 @@ void SetupHardware(void) /** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs and
* starts the library USB task to begin the enumeration and USB management process.
*/
-void EVENT_USB_Connect(void)
+void EVENT_USB_Device_Connect(void)
{
/* Indicate USB enumerating */
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
@@ -83,7 +83,7 @@ void EVENT_USB_Connect(void) /** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via
* the status LEDs and stops the USB management task.
*/
-void EVENT_USB_Disconnect(void)
+void EVENT_USB_Device_Disconnect(void)
{
/* Indicate USB not ready */
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
@@ -92,7 +92,7 @@ void EVENT_USB_Disconnect(void) /** Event handler for the USB_ConfigurationChanged event. This is fired when the host sets the current configuration
* of the USB device after enumeration, and configures the generic HID device endpoints.
*/
-void EVENT_USB_ConfigurationChanged(void)
+void EVENT_USB_Device_ConfigurationChanged(void)
{
/* Indicate USB connected and ready */
LEDs_SetAllLEDs(LEDMASK_USB_READY);
@@ -114,11 +114,11 @@ void EVENT_USB_ConfigurationChanged(void) }
}
-/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific
+/** Event handler for the USB_UnhandledControlRequest event. This is used to catch standard and class specific
* control requests that are not handled internally by the USB library (including the HID commands, which are
* all issued via the control endpoint), so that they can be handled appropriately for the application.
*/
-void EVENT_USB_UnhandledControlPacket(void)
+void EVENT_USB_Device_UnhandledControlRequest(void)
{
/* Handle HID Class specific requests */
switch (USB_ControlRequest.bRequest)
diff --git a/Demos/Device/LowLevel/GenericHID/GenericHID.h b/Demos/Device/LowLevel/GenericHID/GenericHID.h index fbd0a7f8d..c03651773 100644 --- a/Demos/Device/LowLevel/GenericHID/GenericHID.h +++ b/Demos/Device/LowLevel/GenericHID/GenericHID.h @@ -73,10 +73,10 @@ void SetupHardware(void);
void HID_Task(void);
- void EVENT_USB_Connect(void);
- void EVENT_USB_Disconnect(void);
- void EVENT_USB_ConfigurationChanged(void);
- void EVENT_USB_UnhandledControlPacket(void);
+ void EVENT_USB_Device_Connect(void);
+ void EVENT_USB_Device_Disconnect(void);
+ void EVENT_USB_Device_ConfigurationChanged(void);
+ void EVENT_USB_Device_UnhandledControlRequest(void);
void ProcessGenericHIDReport(uint8_t* DataArray);
void CreateGenericHIDReport(uint8_t* DataArray);
diff --git a/Demos/Device/LowLevel/Joystick/Joystick.c b/Demos/Device/LowLevel/Joystick/Joystick.c index db2415e4b..306baa9e0 100644 --- a/Demos/Device/LowLevel/Joystick/Joystick.c +++ b/Demos/Device/LowLevel/Joystick/Joystick.c @@ -72,7 +72,7 @@ void SetupHardware(void) /** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs and
* starts the library USB task to begin the enumeration and USB management process.
*/
-void EVENT_USB_Connect(void)
+void EVENT_USB_Device_Connect(void)
{
/* Indicate USB enumerating */
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
@@ -81,7 +81,7 @@ void EVENT_USB_Connect(void) /** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via
* the status LEDs and stops the USB management and joystick reporting tasks.
*/
-void EVENT_USB_Disconnect(void)
+void EVENT_USB_Device_Disconnect(void)
{
/* Indicate USB not ready */
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
@@ -90,7 +90,7 @@ void EVENT_USB_Disconnect(void) /** Event handler for the USB_ConfigurationChanged event. This is fired when the host set the current configuration
* of the USB device after enumeration - the device endpoints are configured and the joystick reporting task started.
*/
-void EVENT_USB_ConfigurationChanged(void)
+void EVENT_USB_Device_ConfigurationChanged(void)
{
/* Indicate USB connected and ready */
LEDs_SetAllLEDs(LEDMASK_USB_READY);
@@ -104,11 +104,11 @@ void EVENT_USB_ConfigurationChanged(void) }
}
-/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific
+/** Event handler for the USB_UnhandledControlRequest event. This is used to catch standard and class specific
* control requests that are not handled internally by the USB library (including the HID commands, which are
* all issued via the control endpoint), so that they can be handled appropriately for the application.
*/
-void EVENT_USB_UnhandledControlPacket(void)
+void EVENT_USB_Device_UnhandledControlRequest(void)
{
/* Handle HID Class specific requests */
switch (USB_ControlRequest.bRequest)
diff --git a/Demos/Device/LowLevel/Joystick/Joystick.h b/Demos/Device/LowLevel/Joystick/Joystick.h index c50d7f01b..db280ee5c 100644 --- a/Demos/Device/LowLevel/Joystick/Joystick.h +++ b/Demos/Device/LowLevel/Joystick/Joystick.h @@ -81,10 +81,10 @@ void SetupHardware(void);
void HID_Task(void);
- void EVENT_USB_Connect(void);
- void EVENT_USB_Disconnect(void);
- void EVENT_USB_ConfigurationChanged(void);
- void EVENT_USB_UnhandledControlPacket(void);
+ void EVENT_USB_Device_Connect(void);
+ void EVENT_USB_Device_Disconnect(void);
+ void EVENT_USB_Device_ConfigurationChanged(void);
+ void EVENT_USB_Device_UnhandledControlRequest(void);
bool GetNextReport(USB_JoystickReport_Data_t* ReportData);
diff --git a/Demos/Device/LowLevel/Keyboard/Keyboard.c b/Demos/Device/LowLevel/Keyboard/Keyboard.c index e27b22827..f8310abb4 100644 --- a/Demos/Device/LowLevel/Keyboard/Keyboard.c +++ b/Demos/Device/LowLevel/Keyboard/Keyboard.c @@ -96,7 +96,7 @@ void SetupHardware(void) /** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs and
* starts the library USB task to begin the enumeration and USB management process.
*/
-void EVENT_USB_Connect(void)
+void EVENT_USB_Device_Connect(void)
{
/* Indicate USB enumerating */
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
@@ -108,7 +108,7 @@ void EVENT_USB_Connect(void) /** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via
* the status LEDs.
*/
-void EVENT_USB_Disconnect(void)
+void EVENT_USB_Device_Disconnect(void)
{
/* Indicate USB not ready */
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
@@ -117,7 +117,7 @@ void EVENT_USB_Disconnect(void) /** Event handler for the USB_ConfigurationChanged event. This is fired when the host sets the current configuration
* of the USB device after enumeration, and configures the keyboard device endpoints.
*/
-void EVENT_USB_ConfigurationChanged(void)
+void EVENT_USB_Device_ConfigurationChanged(void)
{
/* Indicate USB connected and ready */
LEDs_SetAllLEDs(LEDMASK_USB_READY);
@@ -139,11 +139,11 @@ void EVENT_USB_ConfigurationChanged(void) }
}
-/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific
+/** Event handler for the USB_UnhandledControlRequest event. This is used to catch standard and class specific
* control requests that are not handled internally by the USB library (including the HID commands, which are
* all issued via the control endpoint), so that they can be handled appropriately for the application.
*/
-void EVENT_USB_UnhandledControlPacket(void)
+void EVENT_USB_Device_UnhandledControlRequest(void)
{
/* Handle HID Class specific requests */
switch (USB_ControlRequest.bRequest)
diff --git a/Demos/Device/LowLevel/Keyboard/Keyboard.h b/Demos/Device/LowLevel/Keyboard/Keyboard.h index 2a2ebdc49..bc478f317 100644 --- a/Demos/Device/LowLevel/Keyboard/Keyboard.h +++ b/Demos/Device/LowLevel/Keyboard/Keyboard.h @@ -101,10 +101,10 @@ void SetupHardware(void);
void HID_Task(void);
- void EVENT_USB_Connect(void);
- void EVENT_USB_Disconnect(void);
- void EVENT_USB_ConfigurationChanged(void);
- void EVENT_USB_UnhandledControlPacket(void);
+ void EVENT_USB_Device_Connect(void);
+ void EVENT_USB_Device_Disconnect(void);
+ void EVENT_USB_Device_ConfigurationChanged(void);
+ void EVENT_USB_Device_UnhandledControlRequest(void);
void CreateKeyboardReport(USB_KeyboardReport_Data_t* ReportData);
void ProcessLEDReport(uint8_t LEDReport);
diff --git a/Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.c b/Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.c index 7d486e16e..bfd337a2a 100644 --- a/Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.c +++ b/Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.c @@ -80,7 +80,7 @@ void SetupHardware(void) /** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs and
* starts the library USB task to begin the enumeration and USB management process.
*/
-void EVENT_USB_Connect(void)
+void EVENT_USB_Device_Connect(void)
{
/* Indicate USB enumerating */
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
@@ -89,7 +89,7 @@ void EVENT_USB_Connect(void) /** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via
* the status LEDs and stops the USB management task.
*/
-void EVENT_USB_Disconnect(void)
+void EVENT_USB_Device_Disconnect(void)
{
/* Indicate USB not ready */
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
@@ -98,7 +98,7 @@ void EVENT_USB_Disconnect(void) /** Event handler for the USB_ConfigurationChanged event. This is fired when the host sets the current configuration
* of the USB device after enumeration, and configures the keyboard and mouse device endpoints.
*/
-void EVENT_USB_ConfigurationChanged(void)
+void EVENT_USB_Device_ConfigurationChanged(void)
{
/* Indicate USB connected and ready */
LEDs_SetAllLEDs(LEDMASK_USB_READY);
@@ -132,7 +132,7 @@ void EVENT_USB_ConfigurationChanged(void) * control requests that are not handled internally by the USB library (including the HID commands, which are
* all issued via the control endpoint), so that they can be handled appropriately for the application.
*/
-void EVENT_USB_UnhandledControlPacket(void)
+void EVENT_USB_Device_UnhandledControlRequest(void)
{
uint8_t* ReportData;
uint8_t ReportSize;
diff --git a/Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.h b/Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.h index 138f0fc1d..37cb7f651 100644 --- a/Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.h +++ b/Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.h @@ -98,9 +98,9 @@ void Keyboard_HID_Task(void);
void Mouse_HID_Task(void);
- void EVENT_USB_Connect(void);
- void EVENT_USB_Disconnect(void);
- void EVENT_USB_ConfigurationChanged(void);
- void EVENT_USB_UnhandledControlPacket(void);
+ void EVENT_USB_Device_Connect(void);
+ void EVENT_USB_Device_Disconnect(void);
+ void EVENT_USB_Device_ConfigurationChanged(void);
+ void EVENT_USB_Device_UnhandledControlRequest(void);
#endif
diff --git a/Demos/Device/LowLevel/MIDI/MIDI.c b/Demos/Device/LowLevel/MIDI/MIDI.c index 8aed527db..4dfb9b7e6 100644 --- a/Demos/Device/LowLevel/MIDI/MIDI.c +++ b/Demos/Device/LowLevel/MIDI/MIDI.c @@ -70,7 +70,7 @@ void SetupHardware(void) }
/** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs. */
-void EVENT_USB_Connect(void)
+void EVENT_USB_Device_Connect(void)
{
/* Indicate USB enumerating */
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
@@ -79,7 +79,7 @@ void EVENT_USB_Connect(void) /** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via
* the status LEDs, disables the sample update and PWM output timers and stops the USB and MIDI management tasks.
*/
-void EVENT_USB_Disconnect(void)
+void EVENT_USB_Device_Disconnect(void)
{
/* Indicate USB not ready */
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
@@ -88,7 +88,7 @@ void EVENT_USB_Disconnect(void) /** Event handler for the USB_ConfigurationChanged event. This is fired when the host set the current configuration
* of the USB device after enumeration - the device endpoints are configured and the MIDI management task started.
*/
-void EVENT_USB_ConfigurationChanged(void)
+void EVENT_USB_Device_ConfigurationChanged(void)
{
/* Indicate USB connected and ready */
LEDs_SetAllLEDs(LEDMASK_USB_READY);
diff --git a/Demos/Device/LowLevel/MIDI/MIDI.h b/Demos/Device/LowLevel/MIDI/MIDI.h index 3b9b938a5..3e7a06d6d 100644 --- a/Demos/Device/LowLevel/MIDI/MIDI.h +++ b/Demos/Device/LowLevel/MIDI/MIDI.h @@ -95,8 +95,8 @@ void SetupHardware(void);
void MIDI_Task(void);
- void EVENT_USB_Connect(void);
- void EVENT_USB_Disconnect(void);
- void EVENT_USB_ConfigurationChanged(void);
+ void EVENT_USB_Device_Connect(void);
+ void EVENT_USB_Device_Disconnect(void);
+ void EVENT_USB_Device_ConfigurationChanged(void);
#endif
diff --git a/Demos/Device/LowLevel/MassStorage/MassStorage.c b/Demos/Device/LowLevel/MassStorage/MassStorage.c index 01d27f043..1a2d8d468 100644 --- a/Demos/Device/LowLevel/MassStorage/MassStorage.c +++ b/Demos/Device/LowLevel/MassStorage/MassStorage.c @@ -83,7 +83,7 @@ void SetupHardware(void) }
/** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs. */
-void EVENT_USB_Connect(void)
+void EVENT_USB_Device_Connect(void)
{
/* Indicate USB enumerating */
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
@@ -95,7 +95,7 @@ void EVENT_USB_Connect(void) /** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via
* the status LEDs and stops the Mass Storage management task.
*/
-void EVENT_USB_Disconnect(void)
+void EVENT_USB_Device_Disconnect(void)
{
/* Indicate USB not ready */
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
@@ -104,7 +104,7 @@ void EVENT_USB_Disconnect(void) /** Event handler for the USB_ConfigurationChanged event. This is fired when the host set the current configuration
* of the USB device after enumeration - the device endpoints are configured and the Mass Storage management task started.
*/
-void EVENT_USB_ConfigurationChanged(void)
+void EVENT_USB_Device_ConfigurationChanged(void)
{
/* Indicate USB connected and ready */
LEDs_SetAllLEDs(LEDMASK_USB_READY);
@@ -129,7 +129,7 @@ void EVENT_USB_ConfigurationChanged(void) * control requests that are not handled internally by the USB library (including the Mass Storage class-specific
* requests) so that they can be handled appropriately for the application.
*/
-void EVENT_USB_UnhandledControlPacket(void)
+void EVENT_USB_Device_UnhandledControlRequest(void)
{
/* Process UFI specific control requests */
switch (USB_ControlRequest.bRequest)
diff --git a/Demos/Device/LowLevel/MassStorage/MassStorage.h b/Demos/Device/LowLevel/MassStorage/MassStorage.h index 81fba0000..868daf09a 100644 --- a/Demos/Device/LowLevel/MassStorage/MassStorage.h +++ b/Demos/Device/LowLevel/MassStorage/MassStorage.h @@ -136,10 +136,10 @@ void SetupHardware(void);
void MassStorage_Task(void);
- void EVENT_USB_Connect(void);
- void EVENT_USB_Disconnect(void);
- void EVENT_USB_ConfigurationChanged(void);
- void EVENT_USB_UnhandledControlPacket(void);
+ void EVENT_USB_Device_Connect(void);
+ void EVENT_USB_Device_Disconnect(void);
+ void EVENT_USB_Device_ConfigurationChanged(void);
+ void EVENT_USB_Device_UnhandledControlRequest(void);
#if defined(INCLUDE_FROM_MASSSTORAGE_C)
static bool ReadInCommandBlock(void);
diff --git a/Demos/Device/LowLevel/Mouse/Mouse.c b/Demos/Device/LowLevel/Mouse/Mouse.c index d15f688d6..48f04612b 100644 --- a/Demos/Device/LowLevel/Mouse/Mouse.c +++ b/Demos/Device/LowLevel/Mouse/Mouse.c @@ -96,7 +96,7 @@ void SetupHardware(void) /** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs and
* starts the library USB task to begin the enumeration and USB management process.
*/
-void EVENT_USB_Connect(void)
+void EVENT_USB_Device_Connect(void)
{
/* Indicate USB enumerating */
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
@@ -108,7 +108,7 @@ void EVENT_USB_Connect(void) /** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via
* the status LEDs and stops the USB management and Mouse reporting tasks.
*/
-void EVENT_USB_Disconnect(void)
+void EVENT_USB_Device_Disconnect(void)
{
/* Indicate USB not ready */
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
@@ -117,7 +117,7 @@ void EVENT_USB_Disconnect(void) /** Event handler for the USB_ConfigurationChanged event. This is fired when the host sets the current configuration
* of the USB device after enumeration - the device endpoints are configured and the mouse reporting task started.
*/
-void EVENT_USB_ConfigurationChanged(void)
+void EVENT_USB_Device_ConfigurationChanged(void)
{
/* Indicate USB connected and ready */
LEDs_SetAllLEDs(LEDMASK_USB_READY);
@@ -131,11 +131,11 @@ void EVENT_USB_ConfigurationChanged(void) }
}
-/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific
+/** Event handler for the USB_UnhandledControlRequest event. This is used to catch standard and class specific
* control requests that are not handled internally by the USB library (including the HID commands, which are
* all issued via the control endpoint), so that they can be handled appropriately for the application.
*/
-void EVENT_USB_UnhandledControlPacket(void)
+void EVENT_USB_Device_UnhandledControlRequest(void)
{
/* Handle HID Class specific requests */
switch (USB_ControlRequest.bRequest)
diff --git a/Demos/Device/LowLevel/Mouse/Mouse.h b/Demos/Device/LowLevel/Mouse/Mouse.h index 8ff8b8fc3..b244ffa58 100644 --- a/Demos/Device/LowLevel/Mouse/Mouse.h +++ b/Demos/Device/LowLevel/Mouse/Mouse.h @@ -101,10 +101,10 @@ void SetupHardware(void);
void Mouse_Task(void);
- void EVENT_USB_Connect(void);
- void EVENT_USB_Disconnect(void);
- void EVENT_USB_ConfigurationChanged(void);
- void EVENT_USB_UnhandledControlPacket(void);
+ void EVENT_USB_Device_Connect(void);
+ void EVENT_USB_Device_Disconnect(void);
+ void EVENT_USB_Device_ConfigurationChanged(void);
+ void EVENT_USB_Device_UnhandledControlRequest(void);
void CreateMouseReport(USB_MouseReport_Data_t* ReportData);
diff --git a/Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.c b/Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.c index ca38c24d6..b722187c6 100644 --- a/Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.c +++ b/Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.c @@ -79,7 +79,7 @@ void SetupHardware(void) /** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs and
* starts the library USB task to begin the enumeration and USB management process.
*/
-void EVENT_USB_Connect(void)
+void EVENT_USB_Device_Connect(void)
{
/* Indicate USB enumerating */
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
@@ -88,7 +88,7 @@ void EVENT_USB_Connect(void) /** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via
* the status LEDs and stops all the relevant tasks.
*/
-void EVENT_USB_Disconnect(void)
+void EVENT_USB_Device_Disconnect(void)
{
/* Indicate USB not ready */
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
@@ -97,7 +97,7 @@ void EVENT_USB_Disconnect(void) /** Event handler for the USB_ConfigurationChanged event. This is fired when the host sets the current configuration
* of the USB device after enumeration, and configures the RNDIS device endpoints and starts the relevant tasks.
*/
-void EVENT_USB_ConfigurationChanged(void)
+void EVENT_USB_Device_ConfigurationChanged(void)
{
/* Indicate USB connected and ready */
LEDs_SetAllLEDs(LEDMASK_USB_READY);
@@ -125,11 +125,11 @@ void EVENT_USB_ConfigurationChanged(void) }
}
-/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific
+/** Event handler for the USB_UnhandledControlRequest event. This is used to catch standard and class specific
* control requests that are not handled internally by the USB library (including the RNDIS control commands,
* which set up the USB RNDIS network adapter), so that they can be handled appropriately for the application.
*/
-void EVENT_USB_UnhandledControlPacket(void)
+void EVENT_USB_Device_UnhandledControlRequest(void)
{
/* Process RNDIS class commands */
switch (USB_ControlRequest.bRequest)
diff --git a/Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.h b/Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.h index 5cbddee52..3ae896607 100644 --- a/Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.h +++ b/Demos/Device/LowLevel/RNDISEthernet/RNDISEthernet.h @@ -94,9 +94,9 @@ void RNDIS_Task(void);
void Ethernet_Task(void);
- void EVENT_USB_Connect(void);
- void EVENT_USB_Disconnect(void);
- void EVENT_USB_ConfigurationChanged(void);
- void EVENT_USB_UnhandledControlPacket(void);
+ void EVENT_USB_Device_Connect(void);
+ void EVENT_USB_Device_Disconnect(void);
+ void EVENT_USB_Device_ConfigurationChanged(void);
+ void EVENT_USB_Device_UnhandledControlRequest(void);
#endif
diff --git a/Demos/Device/LowLevel/USBtoSerial/USBtoSerial.c b/Demos/Device/LowLevel/USBtoSerial/USBtoSerial.c index 2765064f7..bb1b4da2d 100644 --- a/Demos/Device/LowLevel/USBtoSerial/USBtoSerial.c +++ b/Demos/Device/LowLevel/USBtoSerial/USBtoSerial.c @@ -89,7 +89,7 @@ void SetupHardware(void) /** Event handler for the USB_Connect event. This indicates that the device is enumerating via the status LEDs and
* starts the library USB task to begin the enumeration and USB management process.
*/
-void EVENT_USB_Connect(void)
+void EVENT_USB_Device_Connect(void)
{
/* Indicate USB enumerating */
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
@@ -98,7 +98,7 @@ void EVENT_USB_Connect(void) /** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via
* the status LEDs and stops the USB management and CDC management tasks.
*/
-void EVENT_USB_Disconnect(void)
+void EVENT_USB_Device_Disconnect(void)
{
/* Reset Tx and Rx buffers, device disconnected */
Buffer_Initialize(&Rx_Buffer);
@@ -111,7 +111,7 @@ void EVENT_USB_Disconnect(void) /** Event handler for the USB_ConfigurationChanged event. This is fired when the host set the current configuration
* of the USB device after enumeration - the device endpoints are configured and the CDC management task started.
*/
-void EVENT_USB_ConfigurationChanged(void)
+void EVENT_USB_Device_ConfigurationChanged(void)
{
/* Indicate USB connected and ready */
LEDs_SetAllLEDs(LEDMASK_USB_READY);
@@ -137,13 +137,16 @@ void EVENT_USB_ConfigurationChanged(void) {
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
}
+
+ /* Reset line encoding baud rate so that the host knows to send new values */
+ LineEncoding.BaudRateBPS = 0;
}
-/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific
+/** Event handler for the USB_UnhandledControlRequest event. This is used to catch standard and class specific
* control requests that are not handled internally by the USB library (including the CDC control commands,
* which are all issued via the control endpoint), so that they can be handled appropriately for the application.
*/
-void EVENT_USB_UnhandledControlPacket(void)
+void EVENT_USB_Device_UnhandledControlRequest(void)
{
/* Process CDC specific control requests */
switch (USB_ControlRequest.bRequest)
diff --git a/Demos/Device/LowLevel/USBtoSerial/USBtoSerial.h b/Demos/Device/LowLevel/USBtoSerial/USBtoSerial.h index 51c47c943..d9567a154 100644 --- a/Demos/Device/LowLevel/USBtoSerial/USBtoSerial.h +++ b/Demos/Device/LowLevel/USBtoSerial/USBtoSerial.h @@ -178,9 +178,9 @@ void CDC_Task(void);
void ReconfigureUSART(void);
- void EVENT_USB_Connect(void);
- void EVENT_USB_Disconnect(void);
- void EVENT_USB_ConfigurationChanged(void);
- void EVENT_USB_UnhandledControlPacket(void);
+ void EVENT_USB_Device_Connect(void);
+ void EVENT_USB_Device_Disconnect(void);
+ void EVENT_USB_Device_ConfigurationChanged(void);
+ void EVENT_USB_Device_UnhandledControlRequest(void);
#endif
|