aboutsummaryrefslogtreecommitdiffstats
path: root/Demos
diff options
context:
space:
mode:
Diffstat (limited to 'Demos')
-rw-r--r--Demos/AudioInput/AudioInput.c4
-rw-r--r--Demos/AudioInput/AudioInput.txt52
-rw-r--r--Demos/AudioOutput/AudioOutput.c7
-rw-r--r--Demos/AudioOutput/AudioOutput.txt68
-rw-r--r--Demos/AudioOutput/makefile2
-rw-r--r--Demos/CDC/CDC.txt44
-rw-r--r--Demos/CDCHost/CDCHost.txt39
-rw-r--r--Demos/DualCDC/DualCDC.txt60
-rw-r--r--Demos/Joystick/Joystick.txt42
-rw-r--r--Demos/Keyboard/Keyboard.c14
-rw-r--r--Demos/Keyboard/Keyboard.txt1
-rw-r--r--Demos/KeyboardHost/KeyboardHost.txt48
-rw-r--r--Demos/KeyboardHostViaInt/KeyboardHostViaInt.h2
-rw-r--r--Demos/KeyboardHostViaInt/KeyboardHostViaInt.txt52
-rw-r--r--Demos/KeyboardHostWithParser/KeyboardHostWithParser.txt44
-rw-r--r--Demos/KeyboardMouse/KeyboardMouse.txt50
-rw-r--r--Demos/MIDI/MIDI.txt47
-rw-r--r--Demos/MassStorage/MassStorage.h5
-rw-r--r--Demos/MassStorage/MassStorage.txt62
-rw-r--r--Demos/MassStorageHost/MassStorageHost.txt36
-rw-r--r--Demos/Mouse/Mouse.c149
-rw-r--r--Demos/Mouse/Mouse.h5
-rw-r--r--Demos/Mouse/Mouse.txt54
-rw-r--r--Demos/Mouse/makefile1
-rw-r--r--Demos/MouseHost/MouseHost.txt50
-rw-r--r--Demos/MouseHostViaInt/MouseHostViaInt.txt54
-rw-r--r--Demos/MouseHostWithParser/MouseHostWithParser.txt44
-rw-r--r--Demos/RNDISEthernet/RNDISEthernet.txt55
-rw-r--r--Demos/StillImageHost/StillImageHost.txt34
-rw-r--r--Demos/TestApp/TestApp.txt54
-rw-r--r--Demos/USBtoSerial/USBtoSerial.txt49
-rw-r--r--Demos/makefile8
32 files changed, 889 insertions, 347 deletions
diff --git a/Demos/AudioInput/AudioInput.c b/Demos/AudioInput/AudioInput.c
index 6ead7a015..f41306f3b 100644
--- a/Demos/AudioInput/AudioInput.c
+++ b/Demos/AudioInput/AudioInput.c
@@ -33,10 +33,6 @@
* Main source file for the Audio Input demo. This file contains the main tasks of the demo and
* is responsible for the initial application hardware configuration.
*/
-
-/* --- Project Configuration --- */
-//#define MICROPHONE_BIASED_TO_HALF_RAIL
-/* --- --- --- --- --- --- --- --- */
#include "AudioInput.h"
diff --git a/Demos/AudioInput/AudioInput.txt b/Demos/AudioInput/AudioInput.txt
index 09b77f7ec..36e71e975 100644
--- a/Demos/AudioInput/AudioInput.txt
+++ b/Demos/AudioInput/AudioInput.txt
@@ -5,21 +5,10 @@
*/
/** \mainpage Audio Input Device Demo
- *
- * Audio demonstration application. This gives a simple reference
- * application for implementing a USB Audio Input device using the
- * basic USB Audio drivers in all modern OSes (i.e. no special drivers
- * required).
- *
- * On startup the system will automatically enumerate and function
- * as a USB microphone. Incomming audio from the ADC channel 1 will
- * be sampled and sent to the host computer.
- *
- * To use, connect a microphone to the ADC channel 2.
- *
- * Under Windows, if a driver request dialogue pops up, select the option
- * to automatically install the appropriate drivers.
- *
+ *
+ * \section SSec_Info USB Information:
+ *
+ * The following table gives a rundown of the USB utilization of this demo.
*
* <table>
* <tr>
@@ -45,4 +34,37 @@
* <td>Full Speed Mode</td>
* </tr>
* </table>
+ *
+ * \section SSec_Description Project Description:
+ *
+ * Audio demonstration application. This gives a simple reference
+ * application for implementing a USB Audio Input device using the
+ * basic USB Audio drivers in all modern OSes (i.e. no special drivers
+ * required).
+ *
+ * On startup the system will automatically enumerate and function
+ * as a USB microphone. Incomming audio from the ADC channel 1 will
+ * be sampled and sent to the host computer.
+ *
+ * To use, connect a microphone to the ADC channel 2.
+ *
+ * Under Windows, if a driver request dialogue pops up, select the option
+ * to automatically install the appropriate drivers.
+ *
+ * \section SSec_Options Project Options
+ *
+ * The following defines can be found in this demo, which can control the demo behaviour when defined, or changed in value.
+ *
+ * <table>
+ * <tr>
+ * <td><b>Define Name:</b></td>
+ * <td><b>Location:</b></td>
+ * <td><b>Description:</b></td>
+ * </tr>
+ * <tr>
+ * <td>MICROPHONE_BIASED_TO_HALF_RAIL</td>
+ * <td>Makefile CDEFS</td>
+ * <td>When defined, this alters the demo so that the half VCC bias of the microphone input is subtracted.</td>
+ * </tr>
+ * </table>
*/ \ No newline at end of file
diff --git a/Demos/AudioOutput/AudioOutput.c b/Demos/AudioOutput/AudioOutput.c
index 87afd3606..0f390f001 100644
--- a/Demos/AudioOutput/AudioOutput.c
+++ b/Demos/AudioOutput/AudioOutput.c
@@ -34,13 +34,6 @@
* is responsible for the initial application hardware configuration.
*/
-/* --- Project Configuration (Choose ONE) --- */
-//#define AUDIO_OUT_MONO
-#define AUDIO_OUT_STEREO
-//#define AUDIO_OUT_LEDS
-//#define AUDIO_OUT_PORTC
-/* --- --- --- --- --- --- --- --- --- --- --- */
-
#include "AudioOutput.h"
/* Project Tags, for reading out using the ButtLoad project */
diff --git a/Demos/AudioOutput/AudioOutput.txt b/Demos/AudioOutput/AudioOutput.txt
index ce7d4ed94..0638c47f9 100644
--- a/Demos/AudioOutput/AudioOutput.txt
+++ b/Demos/AudioOutput/AudioOutput.txt
@@ -5,7 +5,38 @@
*/
/** \mainpage Audio Output Device Demo
- *
+ *
+ * \section SSec_Info USB Information:
+ *
+ * The following table gives a rundown of the USB utilization of this demo.
+ *
+ * <table>
+ * <tr>
+ * <td><b>USB Mode:</b></td>
+ * <td>Device</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Class:</b></td>
+ * <td>Audio Class</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Subclass:</b></td>
+ * <td>Standard Audio Device</td>
+ * </tr>
+ * <tr>
+ * <td><b>Relevant Standards:</b></td>
+ * <td>USBIF Audio Class Specification</td>
+ * <td>USBIF Audio Class Terminal Types Specification</td>
+ * <td>USBIF Audio Data Formats Specification</td>
+ * </tr>
+ * <tr>
+ * <td><b>Usable Speeds:</b></td>
+ * <td>Full Speed Mode</td>
+ * </tr>
+ * </table>
+ *
+ * \section SSec_Description Project Description:
+ *
* Audio demonstration application. This gives a simple reference
* application for implementing a USB Audio Output device using the
* basic USB Audio drivers in all modern OSes (i.e. no special drivers
@@ -21,30 +52,37 @@
*
* Under Windows, if a driver request dialogue pops up, select the option
* to automatically install the appropriate drivers.
- *
+ *
+ * \section SSec_Options Project Options
+ *
+ * The following defines can be found in this demo, which can control the demo behaviour when defined, or changed in value.
*
* <table>
* <tr>
- * <td><b>USB Mode:</b></td>
- * <td>Device</td>
+ * <td><b>Define Name:</b></td>
+ * <td><b>Location:</b></td>
+ * <td><b>Description:</b></td>
* </tr>
* <tr>
- * <td><b>USB Class:</b></td>
- * <td>Audio Class</td>
+ * <td>AUDIO_OUT_STEREO</td>
+ * <td>Makefile CDEFS</td>
+ * <td>When defined, this outputs the audio samples in stereo to the timer output pins of the microcontroller.</td>
* </tr>
- * <tr>
- * <td><b>USB Subclass:</b></td>
- * <td>Standard Audio Device</td>
+ * <tr>
+ * <td>AUDIO_OUT_MONO</td>
+ * <td>Makefile CDEFS</td>
+ * <td>When defined, this outputs the audio samples in mono to the timer output pin of the microcontroller.</td>
* </tr>
* <tr>
- * <td><b>Relevant Standards:</b></td>
- * <td>USBIF Audio Class Specification</td>
- * <td>USBIF Audio Class Terminal Types Specification</td>
- * <td>USBIF Audio Data Formats Specification</td>
+ * <td>AUDIO_OUT_LEDS</td>
+ * <td>Makefile CDEFS</td>
+ * <td>When defined, this outputs the audio samples in stereo to the board LEDs.</td>
* </tr>
* <tr>
- * <td><b>Usable Speeds:</b></td>
- * <td>Full Speed Mode</td>
+ * <td>AUDIO_OUT_PORTC</td>
+ * <td>Makefile CDEFS</td>
+ * <td>When defined, this outputs the audio samples in mono to port C of the microcontroller, for connection to an
+ * external DAC.</td>
* </tr>
* </table>
*/ \ No newline at end of file
diff --git a/Demos/AudioOutput/makefile b/Demos/AudioOutput/makefile
index 3584d55f9..af99358f5 100644
--- a/Demos/AudioOutput/makefile
+++ b/Demos/AudioOutput/makefile
@@ -176,7 +176,7 @@ CSTANDARD = -std=gnu99
CDEFS = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD)
CDEFS += -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DNO_STREAM_CALLBACKS -DUSB_DEVICE_ONLY
CDEFS += -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
-
+CDEFS += -DAUDIO_OUT_STEREO
# Place -D or -U options here for ASM sources
ADEFS = -DF_CPU=$(F_CPU)
diff --git a/Demos/CDC/CDC.txt b/Demos/CDC/CDC.txt
index 34e1c82a1..8e13b55b4 100644
--- a/Demos/CDC/CDC.txt
+++ b/Demos/CDC/CDC.txt
@@ -6,19 +6,9 @@
/** \mainpage Communications Device Class Device (Virtual Serial Port)
*
- * Communications Device Class demonstration application.
- * This gives a simple reference application for implementing
- * a CDC device acting as a virtual serial port. Joystick
- * actions are transmitted to the host as strings. The device
- * does not respond to serial data sent from the host.
- *
- * After running this demo for the first time on a new computer,
- * you will need to supply the .INF file located in this demo
- * project's directory as the device's driver when running under
- * Windows. This will enable Windows to use its inbuilt CDC drivers,
- * negating the need for custom drivers for the device. Other
- * Operating Systems should automatically use their own inbuilt
- * CDC-ACM drivers.
+ * \section SSec_Info USB Information:
+ *
+ * The following table gives a rundown of the USB utilization of this demo.
*
* <table>
* <tr>
@@ -42,4 +32,32 @@
* <td>Full Speed Mode</td>
* </tr>
* </table>
+ *
+ * \section SSec_Description Project Description:
+ *
+ * Communications Device Class demonstration application.
+ * This gives a simple reference application for implementing
+ * a CDC device acting as a virtual serial port. Joystick
+ * actions are transmitted to the host as strings. The device
+ * does not respond to serial data sent from the host.
+ *
+ * After running this demo for the first time on a new computer,
+ * you will need to supply the .INF file located in this demo
+ * project's directory as the device's driver when running under
+ * Windows. This will enable Windows to use its inbuilt CDC drivers,
+ * negating the need for custom drivers for the device. Other
+ * Operating Systems should automatically use their own inbuilt
+ * CDC-ACM drivers.
+ *
+ * \section SSec_Options Project Options
+ *
+ * The following defines can be found in this demo, which can control the demo behaviour when defined, or changed in value.
+ *
+ * <table>
+ * <tr>
+ * <td>
+ * None
+ * </td>
+ * </tr>
+ * </table>
*/ \ No newline at end of file
diff --git a/Demos/CDCHost/CDCHost.txt b/Demos/CDCHost/CDCHost.txt
index 5f8dc8cc0..39e2357ba 100644
--- a/Demos/CDCHost/CDCHost.txt
+++ b/Demos/CDCHost/CDCHost.txt
@@ -5,17 +5,10 @@
*/
/** \mainpage CDC Host Demo
- *
- * CDC host demonstration application. This gives a simple reference application
- * for implementing a USB CDC host, for CDC devices using the standard ACM profile.
- *
- * This demo prints out received CDC data through the serial port.
- *
- * Not that this demo is only compatible with devices which report the correct CDC
- * and ACM class, subclass and protocol values. Most USB-Serial cables have vendor
- * specific features, thus use vendor-specfic class/subclass/protocol codes to force
- * the user to use specialized drivers. This demo is not compaible with such devices.
- *
+ *
+ * \section SSec_Info USB Information:
+ *
+ * The following table gives a rundown of the USB utilization of this demo.
*
* <table>
* <tr>
@@ -39,4 +32,28 @@
* <td>Full Speed Mode</td>
* </tr>
* </table>
+ *
+ * \section SSec_Description Project Description:
+ *
+ * CDC host demonstration application. This gives a simple reference application
+ * for implementing a USB CDC host, for CDC devices using the standard ACM profile.
+ *
+ * This demo prints out received CDC data through the serial port.
+ *
+ * Not that this demo is only compatible with devices which report the correct CDC
+ * and ACM class, subclass and protocol values. Most USB-Serial cables have vendor
+ * specific features, thus use vendor-specfic class/subclass/protocol codes to force
+ * the user to use specialized drivers. This demo is not compaible with such devices.
+ *
+ * \section SSec_Options Project Options
+ *
+ * The following defines can be found in this demo, which can control the demo behaviour when defined, or changed in value.
+ *
+ * <table>
+ * <tr>
+ * <td>
+ * None
+ * </td>
+ * </tr>
+ * </table>
*/ \ No newline at end of file
diff --git a/Demos/DualCDC/DualCDC.txt b/Demos/DualCDC/DualCDC.txt
index aebbec353..6e086029b 100644
--- a/Demos/DualCDC/DualCDC.txt
+++ b/Demos/DualCDC/DualCDC.txt
@@ -6,6 +6,38 @@
/** \mainpage Dual Communications Device Class Device (Dual Virtual Serial Port)
*
+ * \section SSec_Info USB Information:
+ *
+ * The following table gives a rundown of the USB utilization of this demo.
+ *
+ * <table>
+ * <tr>
+ * <td><b>USB Mode:</b></td>
+ * <td>Device</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Class:</b></td>
+ * <td>Miscellaneous Device Class</td>
+ * <td>( Sub-Interface: Communications Device Class (CDC) )</td>
+ * </tr>
+ * <tr>
+ * <td><b>USB Subclass:</b></td>
+ * <td>Common Class</td>
+ * <td>( Sub-Interface: Abstract Control Model (ACM) )</td>
+ * </tr>
+ * <tr>
+ * <td><b>Relevant Standards:</b></td>
+ * <td>USBIF Interface Association Descriptor ECN</td>
+ * <td>USBIF CDC Class Standard</td>
+ * </tr>
+ * <tr>
+ * <td><b>Usable Speeds:</b></td>
+ * <td>Full Speed Mode</td>
+ * </tr>
+ * </table>
+ *
+ * \section SSec_Description Project Description:
+ *
* Dual Communications Device Class demonstration application.
* This gives a simple reference application for implementing
* a compound device with dual CDC functions acting as a pair
@@ -29,29 +61,15 @@
* Operating Systems should automatically use their own inbuilt
* CDC-ACM drivers.
*
+ * \section SSec_Options Project Options
+ *
+ * The following defines can be found in this demo, which can control the demo behaviour when defined, or changed in value.
+ *
* <table>
* <tr>
- * <td><b>USB Mode:</b></td>
- * <td>Device</td>
- * </tr>
- * <tr>
- * <td><b>USB Class:</b></td>
- * <td>Miscellaneous Device Class</td>
- * <td>( Sub-Interface: Communications Device Class (CDC) )</td>
- * </tr>
- * <tr>
- * <td><b>USB Subclass:</b></td>
- * <td>Common Class</td>
- * <td>( Sub-Interface: Abstract Control Model (ACM) )</td>
- * </tr>
- * <tr>
- * <td><b>Relevant Standards:</b></td>
- * <td>USBIF Interface Association Descriptor ECN</td>
- * <td>USBIF CDC Class Standard</td>
- * </tr>
- * <tr>
- * <td><b>Usable Speeds:</b></td>
- * <td>Full Speed Mode</td>
+ * <td>
+ * None
+ * </td>
* </tr>
* </table>
*/ \ No newline at end of file
diff --git a/Demos/Joystick/Joystick.txt b/Demos/Joystick/Joystick.txt
index 6229aa042..7d47ae92f 100644
--- a/Demos/Joystick/Joystick.txt
+++ b/Demos/Joystick/Joystick.txt
@@ -6,18 +6,9 @@
/** \mainpage Joystick Device Demo
*
- * Joystick demonstration application. This gives a simple reference
- * application for implementing a USB Keyboard device, for USB Joysticks
- * using the standard Keyboard HID profile.
- *
- * This device will show up as a generic joystick device, with two buttons.
- * Pressing the joystick inwards is the first button, and the HWB button
- * is the second.
- *
- * Moving the joystick on the selected board moves the joystick location on
- * the host computer.
- *
- * Currently only single interface joysticks are supported.
+ * \section SSec_Info USB Information:
+ *
+ * The following table gives a rundown of the USB utilization of this demo.
*
* <table>
* <tr>
@@ -41,4 +32,31 @@
* <td>Low Speed Mode, Full Speed Mode</td>
* </tr>
* </table>
+ *
+ * \section SSec_Description Project Description:
+ *
+ * Joystick demonstration application. This gives a simple reference
+ * application for implementing a USB Keyboard device, for USB Joysticks
+ * using the standard Keyboard HID profile.
+ *
+ * This device will show up as a generic joystick device, with two buttons.
+ * Pressing the joystick inwards is the first button, and the HWB button
+ * is the second.
+ *
+ * Moving the joystick on the selected board moves the joystick location on
+ * the host computer.
+ *
+ * Currently only single interface joysticks are supported.
+ *
+ * \section SSec_Options Project Options
+ *
+ * The following defines can be found in this demo, which can control the demo behaviour when defined, or changed in value.
+ *
+ * <table>
+ * <tr>
+ * <td>
+ * None
+ * </td>
+ * </tr>
+ * </table>
*/ \ No newline at end of file
diff --git a/Demos/Keyboard/Keyboard.c b/Demos/Keyboard/Keyboard.c
index 3884eeb16..f506070c0 100644
--- a/Demos/Keyboard/Keyboard.c
+++ b/Demos/Keyboard/Keyboard.c
@@ -140,6 +140,15 @@ EVENT_HANDLER(USB_Reset)
*/
EVENT_HANDLER(USB_Disconnect)
{
+ /* Stop running keyboard reporting and USB management tasks */
+ #if !defined(INTERRUPT_DATA_ENDPOINT)
+ Scheduler_SetTaskMode(USB_Keyboard_Report, TASK_STOP);
+ #endif
+
+ #if !defined(INTERRUPT_CONTROL_ENDPOINT)
+ Scheduler_SetTaskMode(USB_USBTask, TASK_STOP);
+ #endif
+
/* Indicate USB not ready */
UpdateStatus(Status_USBNotReady);
}
@@ -171,6 +180,11 @@ EVENT_HANDLER(USB_ConfigurationChanged)
/* Indicate USB connected and ready */
UpdateStatus(Status_USBReady);
+
+ #if !defined(INTERRUPT_DATA_ENDPOINT)
+ /* Start running keyboard reporting task */
+ Scheduler_SetTaskMode(USB_Keyboard_Report, TASK_RUN);
+ #endif
}
/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific
diff --git a/Demos/Keyboard/Keyboard.txt b/Demos/Keyboard/Keyboard.txt
index 7939035a0..a09d83507 100644
--- a/Demos/Keyboard/Keyboard.txt
+++ b/Demos/Keyboard/Keyboard.txt
@@ -34,6 +34,7 @@
* </table>
*
* \section SSec_Description Project Description:
+ *
* Keyboard demonstration application. This gives a simple reference application
* for implementing a USB Keyboard using the basic USB HID drivers in all modern
* OSes (i.e. no special drivers required). It is boot protocol compatible, and thus
diff --git a/Demos/KeyboardHost/KeyboardHost.txt b/Demos/KeyboardHost/KeyboardHost.txt
index 92e380789..db0e14ad6 100644
--- a/Demos/KeyboardHost/KeyboardHost.txt
+++ b/Demos/KeyboardHost/KeyboardHost.txt
@@ -5,21 +5,10 @@
*/
/** \mainpage Keyboard Host Demo
- *
- * Keyboard host demonstration application. This gives a simple reference
- * application for implementing a USB Mouse keyboard, for USB keyboards using
- * the standard keyboard HID profile.
- *
- * Pressed alpha-numeric, enter or space key is transmitted through the serial
- * USART at serial settings 9600, 8, N, 1.
- *
- * This uses a naive method where the keyboard is set to Boot Protocol mode, so
- * that the report structure is fixed and known. A better implementation
- * uses the HID report parser for correct report data processing across
- * all compatable mice with advanced characteristics, as shown in the
- * KeyboardHostWithParser demo application.
- *
- * Currently only single interface keyboards are supported.
+ *
+ * \section SSec_Info USB Information:
+ *
+ * The following table gives a rundown of the USB utilization of this demo.
*
* <table>
* <tr>
@@ -43,4 +32,33 @@
* <td>Low Speed Mode, Full Speed Mode</td>
* </tr>
* </table>
+ *
+ * \section SSec_Description Project Description:
+ *
+ * Keyboard host demonstration application. This gives a simple reference
+ * application for implementing a USB Mouse keyboard, for USB keyboards using
+ * the standard keyboard HID profile.
+ *
+ * Pressed alpha-numeric, enter or space key is transmitted through the serial
+ * USART at serial settings 9600, 8, N, 1.
+ *
+ * This uses a naive method where the keyboard is set to Boot Protocol mode, so
+ * that the report structure is fixed and known. A better implementation
+ * uses the HID report parser for correct report data processing across
+ * all compatable mice with advanced characteristics, as shown in the
+ * KeyboardHostWithParser demo application.
+ *
+ * Currently only single interface keyboards are supported.
+ *
+ * \section SSec_Options Project Options
+ *
+ * The following defines can be found in this demo, which can control the demo behaviour when defined, or changed in value.
+ *
+ * <table>
+ * <tr>
+ * <td>
+ * None
+ * </td>
+ * </tr>
+ * </table>
*/ \ No newline at end of file
diff --git a/Demos/KeyboardHostViaInt/KeyboardHostViaInt.h b/Demos/KeyboardHostViaInt/KeyboardHostViaInt.h
index 7ae54e6ad..06cd02a9f 100644
--- a/Demos/KeyboardHostViaInt/KeyboardHostViaInt.h
+++ b/Demos/KeyboardHostViaInt/KeyboardHostViaInt.h
@@ -59,7 +59,7 @@
#define KEYBOARD_DATAPIPE 1
/** HID Class Specific request to set the report protocol mode */
- #define REQ_SetProtocol 0x0B
+ #define REQ_SetProtocol 0x0B
/* Type Defines: */
/** Type define for a standard Boot Protocol Keyboard report */
diff --git a/Demos/KeyboardHostViaInt/KeyboardHostViaInt.txt b/Demos/KeyboardHostViaInt/KeyboardHostViaInt.txt
index 07c110848..de61d32fe 100644
--- a/Demos/KeyboardHostViaInt/KeyboardHostViaInt.txt
+++ b/Demos/KeyboardHostViaInt/KeyboardHostViaInt.txt
@@ -4,23 +4,11 @@
* documentation pages. It is not a project source file.
*/
-/** \mainpage Keyboard Host Demo
- *
- * Keyboard host demonstration application, using pipe interrupts. This gives
- * a simple reference application for implementing a USB Keyboard host utilizing
- * the LUFA pipe interrupt system, for USB keyboards using the standard Keyboard
- * HID profile.
- *
- * Pressed alpha-numeric, enter or space key is transmitted through the serial
- * USART at serial settings 9600, 8, N, 1.
- *
- * This uses a naive method where the keyboard is set to Boot Protocol mode, so
- * that the report structure is fixed and known. A better implementation
- * uses the HID report parser for correct report data processing across
- * all compatable mice with advanced characteristics, as shown in the
- * KeyboardHostWithParser demo application.
- *
- * Currently only single interface keyboards are supported.
+/** \mainpage Keyboard Host Demo (via interrupts)
+ *
+ * \section SSec_Info USB Information:
+ *
+ * The following table gives a rundown of the USB utilization of this demo.
*
* <table>
* <tr>
@@ -44,4 +32,34 @@
* <td>Low Speed Mode, Full Speed Mode</td>
* </tr>
* </table>
+ *
+ * \section SSec_Description Project Description:
+ *
+ * Keyboard host demonstration application, using pipe interrupts. This gives
+ * a simple reference application for implementing a USB Keyboard host utilizing
+ * the LUFA pipe interrupt system, for USB keyboards using the standard Keyboard
+ * HID profile.
+ *
+ * Pressed alpha-numeric, enter or space key is transmitted through the serial
+ * USART at serial settings 9600, 8, N, 1.
+ *
+ * This uses a naive method where the keyboard is set to Boot Protocol mode, so
+ * that the report structure is fixed and known. A better implementation
+ * uses the HID report parser for correct report data processing across
+ * all compatable mice with advanced characteristics, as shown in the
+ * KeyboardHostWithParser demo application.
+ *
+ * Currently only single interface keyboards are supported.
+ *
+ * \section SSec_Options Project Options
+ *
+ * The following defines can be found in this demo, which can control the demo behaviour when defined, or changed in value.
+ *
+ * <table>
+ * <tr>
+ * <td>
+ * None
+ * </td>
+ * </tr>
+ * </table>
*/ \ No newline at end of file
diff --git a/Demos/KeyboardHostWithParser/KeyboardHostWithParser.txt b/Demos/KeyboardHostWithParser/KeyboardHostWithParser.txt
index 09a83ca57..cd3670673 100644
--- a/Demos/KeyboardHostWithParser/KeyboardHostWithParser.txt
+++ b/Demos/KeyboardHostWithParser/KeyboardHostWithParser.txt
@@ -5,19 +5,10 @@
*/
/** \mainpage Keyboard Host With HID Descriptor Parser Demo
- *
- * Keyboard host demonstration application. This gives a simple reference
- * application for implementing a USB Keyboard host, for USB keyboards using
- * the standard Keyboard HID profile. It uses a HID parser for the HID reports,
- * allowing for correct operation across all USB keyboards. This demo supports
- * keyboards with a single HID report.
- *
- * Pressed alpha-numeric, enter or space key is transmitted through the serial
- * USART at serial settings 9600, 8, N, 1. On connection to a USB keyboard, the
- * report items will be processed and printed as a formatted list through the
- * USART before the keyboard is fully enumerated.
- *
- * Currently only single interface keyboards are supported.
+ *
+ * \section SSec_Info USB Information:
+ *
+ * The following table gives a rundown of the USB utilization of this demo.
*
* <table>
* <tr>
@@ -41,4 +32,31 @@
* <td>Low Speed Mode, Full Speed Mode</td>
* </tr>
* </table>
+ *
+ * \section SSec_Description Project Description:
+ *
+ * Keyboard host demonstration application. This gives a simple reference
+ * application for implementing a USB Keyboard host, for USB keyboards using
+ * the standard Keyboard HID profile. It uses a HID parser for the HID reports,
+ * allowing for correct operation across all USB keyboards. This demo supports
+ * keyboards with a single HID report.
+ *
+ * Pressed alpha-numeric, enter or space key is transmitted through the serial
+ * USART at serial settings 9600, 8, N, 1. On connection to a USB keyboard, the
+ * report items will be processed and printed as a formatted list through the
+ * USART before the keyboard is fully enumerated.
+ *
+ * Currently only single interface keyboards are supported.
+ *
+ * \section SSec_Options Project Options
+ *
+ * The following defines can be found in this demo, which can control the demo behaviour when defined, or changed in value.
+ *
+ * <table>
+ * <tr>
+ * <td>
+ * None
+ * </td>
+ * </tr>
+ * </table>
*/ \ No newline at end of file
diff --git a/Demos/KeyboardMouse/KeyboardMouse.txt b/Demos/KeyboardMouse/KeyboardMouse.txt
index 969e2871b..6388e9803 100644
--- a/Demos/KeyboardMouse/KeyboardMouse.txt
+++ b/Demos/KeyboardMouse/KeyboardMouse.txt
@@ -6,22 +6,9 @@
/** \mainpage Dual HID Keyboard and Mouse Device Demo
*
- * Keyboard/Mouse demonstration application. This gives a simple reference
- * application for implementing a composite device containing both USB Keyboard
- * and USB Mouse functionality using the basic USB HID drivers in all modern OSes
- * (i.e. no special drivers required). This example uses two seperate HID
- * interfaces for each function. It is boot protocol compatible, and thus works under
- * compatible BIOS as if it was a native keyboard and mouse (e.g. PS/2).
- *
- * On startup the system will automatically enumerate and function
- * as a keyboard when the USB connection to a host is present and the HWB is not
- * pressed. When enabled, manipulate the joystick to send the letters
- * a, b, c, d and e. See the USB HID documentation for more information
- * on sending keyboard event and keypresses.
- *
- * When the HWB is pressed, the mouse mode is enabled. When enabled, move the
- * joystick to move the pointer, and push the joystick inwards to simulate a
- * left-button click.
+ * \section SSec_Info USB Information:
+ *
+ * The following table gives a rundown of the USB utilization of this demo.
*
* <table>
* <tr>
@@ -45,4 +32,35 @@
* <td>Low Speed Mode, Full Speed Mode</td>
* </tr>
* </table>
+ *
+ * \section SSec_Description Project Description:
+ *
+ * Keyboard/Mouse demonstration application. This gives a simple reference
+ * application for implementing a composite device containing both USB Keyboard
+ * and USB Mouse functionality using the basic USB HID drivers in all modern OSes
+ * (i.e. no special drivers required). This example uses two seperate HID
+ * interfaces for each function. It is boot protocol compatible, and thus works under
+ * compatible BIOS as if it was a native keyboard and mouse (e.g. PS/2).
+ *
+ * On startup the system will automatically enumerate and function
+ * as a keyboard when the USB connection to a host is present and the HWB is not
+ * pressed. When enabled, manipulate the joystick to send the letters
+ * a, b, c, d and e. See the USB HID documentation for more information
+ * on sending keyboard event and keypresses.
+ *
+ * When the HWB is pressed, the mouse mode is enabled. When enabled, move the
+ * joystick to move the pointer, and push the joystick inwards to simulate a
+ * left-button click.
+ *
+ * \section SSec_Options Project Options
+ *
+ * The following defines can be found in this demo, which can control the demo behaviour when defined, or changed in value.
+ *
+ * <table>
+ * <tr>
+ * <td>
+ * None
+ * </td>
+ * </tr>
+ * </table>
*/ \ No newline at end of file
diff --git a/Demos/MIDI/MIDI.txt b/Demos/MIDI/MIDI.txt
index 0b34ccb66..3eb60cdc6 100644
--- a/Demos/MIDI/MIDI.txt
+++ b/Demos/MIDI/MIDI.txt
@@ -5,21 +5,10 @@
*/
/** \mainpage MIDI Input Device Demo
- *
- * MIDI demonstration application. This gives a simple reference
- * application for implementing the USB-MIDI class in USB devices.
- * It is built upon the USB Audio class.
- *
- * Joystick movements are translated into note on/off messages and
- * are sent to the host PC as MIDI streams which can be read by any
- * MIDI program supporting MIDI IN devices.
- *
- * If the HWB is not pressed, channel 1 (default piano) is used. If
- * the HWB is set, then channel 10 (default percussion) is selected.
- *
- * This device implements MIDI-THRU mode, with the IN MIDI data being
- * generated by the device itself. OUT MIDI data is discarded.
- *
+ *
+ * \section SSec_Info USB Information:
+ *
+ * The following table gives a rundown of the USB utilization of this demo.
*
* <table>
* <tr>
@@ -45,4 +34,32 @@
* <td>Full Speed Mode</td>
* </tr>
* </table>
+ *
+ * \section SSec_Description Project Description:
+ *
+ * MIDI demonstration application. This gives a simple reference
+ * application for implementing the USB-MIDI class in USB devices.
+ * It is built upon the USB Audio class.
+ *
+ * Joystick movements are translated into note on/off messages and
+ * are sent to the host PC as MIDI streams which can be read by any
+ * MIDI program supporting MIDI IN devices.
+ *
+ * If the HWB is not pressed, channel 1 (default piano) is used. If
+ * the HWB is set, then channel 10 (default percussion) is selected.
+ *
+ * This device implements MIDI-THRU mode, with the IN MIDI data being
+ * generated by the device itself. OUT MIDI data is discarded.
+ *
+ * \section SSec_Options Project Options
+ *
+ * The following defines can be found in this demo, which can control the demo behaviour when defined, or changed in value.
+ *
+ * <table>
+ * <tr>
+ * <td>
+ * None
+ * </td>
+ * </tr>
+ * </table>
*/ \ No newline at end of file
diff --git a/Demos/MassStorage/MassStorage.h b/Demos/MassStorage/MassStorage.h
index 3525340ff..a30e7f746 100644
--- a/Demos/MassStorage/MassStorage.h
+++ b/Demos/MassStorage/MassStorage.h
@@ -62,8 +62,9 @@
/** Maximum length of a SCSI command which can be issued by the device or host in a Mass Storage bulk wrapper. */
#define MAX_SCSI_COMMAND_LENGTH 16
- /** Total number of Logical Units (drives) in the device. By default, the total device capacity is shared equally between
- * each drive - this can be set to any positive non-zero amount. */
+ /** Total number of Logical Units (drives) in the device. The total device capacity is shared equally between
+ * each drive - this can be set to any positive non-zero amount.
+ */
#define TOTAL_LUNS 2
/** Blocks in each LUN, calculated from the total capacity divided by the total number of Logical Units in the device. */
diff --git a/Demos/MassStorage/MassStorage.txt b/Demos/MassStorage/MassStorage.txt
index 428faa8e0..4e8adadbc 100644
--- a/Demos/MassStorage/MassStorage.txt
+++ b/Demos/MassStorage/MassStorage.txt
@@ -6,25 +6,9 @@
/** \mainpage Mass Storage Device Demo
*
- * Dual LUN Mass Storage demonstration application. This gives a simple
- * reference application for implementing a multiple LUN USB Mass Storage
- * device using the basic USB UFI drivers in all modern OSes (i.e. no
- * special drivers required).
- *
- * On startup the system will automatically enumerate and function as an
- * external mass storage device with two LUNs (seperate disks) which may
- * be formatted and used in the same manner as commercial USB Mass Storage
- * devices.
- *
- * You will need to format the mass storage drives upon first run of this
- * demonstration - as the device acts only as a data block transport between
- * the host and the storage media, it does not matter what file system is used,
- * as the data interpretation is performed by the host and not the USB device.
- *
- * This demo is not restricted to only two LUNs; by changing the TOTAL_LUNS
- * value in MassStorageDualLUN.h, any number of LUNs can be used (from 1 to
- * 255), with each LUN being allocated an equal portion of the available
- * Dataflash memory.
+ * \section SSec_Info USB Information:
+ *
+ * The following table gives a rundown of the USB utilization of this demo.
*
* <table>
* <tr>
@@ -51,4 +35,44 @@
* <td>Full Speed Mode</td>
* </tr>
* </table>
+ *
+ * \section SSec_Description Project Description:
+ *
+ * Dual LUN Mass Storage demonstration application. This gives a simple
+ * reference application for implementing a multiple LUN USB Mass Storage
+ * device using the basic USB UFI drivers in all modern OSes (i.e. no
+ * special drivers required).
+ *
+ * On startup the system will automatically enumerate and function as an
+ * external mass storage device with two LUNs (seperate disks) which may
+ * be formatted and used in the same manner as commercial USB Mass Storage
+ * devices.
+ *
+ * You will need to format the mass storage drives upon first run of this
+ * demonstration - as the device acts only as a data block transport between
+ * the host and the storage media, it does not matter what file system is used,
+ * as the data interpretation is performed by the host and not the USB device.
+ *
+ * This demo is not restricted to only two LUNs; by changing the TOTAL_LUNS
+ * value in MassStorageDualLUN.h, any number of LUNs can be used (from 1 to
+ * 255), with each LUN being allocated an equal portion of the available
+ * Dataflash memory.
+ *
+ * \section SSec_Options Project Options
+ *
+ * The following defines can be found in this demo, which can control the demo behaviour when defined, or changed in value.
+ *
+ * <table>
+ * <tr>
+ * <td><b>Define Name:</b></td>
+ * <td><b>Location:</b></td>
+ * <td><b>Description:</b></td>
+ * </tr>
+ * <tr>
+ * <td>TOTAL_LUNS</td>
+ * <td>MassStorage.h</td>
+ * <td>Total number of Logical Units (drives) in the device. The total device capacity is shared equally between each drive
+ * - this can be set to any positive non-zero amount.</td>
+ * </tr>
+ * </table>
*/ \ No newline at end of file
diff --git a/Demos/MassStorageHost/MassStorageHost.txt b/Demos/MassStorageHost/MassStorageHost.txt
index 2defd7fe8..88b42e937 100644
--- a/Demos/MassStorageHost/MassStorageHost.txt
+++ b/Demos/MassStorageHost/MassStorageHost.txt
@@ -5,15 +5,10 @@
*/
/** \mainpage Mass Storage Host Demo
- *
- * Mass Storage host demonstration application. This gives a simple reference
- * application for implementing a USB Mass Storage host, for USB storage devices
- * using the standard Mass Storage USB profile.
- *
- * The first 512 bytes (boot sector) of an attached disk's memory will be dumped
- * out of the serial port in HEX and ASCII form when it is attached to the AT90USB1287
- * AVR. The device will then wait for HWB to be pressed, whereupon the entire ASCII contents
- * of the disk will be dumped to the serial port.
+ *
+ * \section SSec_Info USB Information:
+ *
+ * The following table gives a rundown of the USB utilization of this demo.
*
* <table>
* <tr>
@@ -40,4 +35,27 @@
* <td>Full Speed Mode</td>
* </tr>
* </table>
+ *
+ * \section SSec_Description Project Description:
+ *
+ * Mass Storage host demonstration application. This gives a simple reference
+ * application for implementing a USB Mass Storage host, for USB storage devices
+ * using the standard Mass Storage USB profile.
+ *
+ * The first 512 bytes (boot sector) of an attached disk's memory will be dumped
+ * out of the serial port in HEX and ASCII form when it is attached to the AT90USB1287
+ * AVR. The device will then wait for HWB to be pressed, whereupon the entire ASCII contents
+ * of the disk will be dumped to the serial port.
+ *
+ * \section SSec_Options Project Options
+ *
+ * The following defines can be found in this demo, which can control the demo behaviour when defined, or changed in value.
+ *
+ * <table>
+ * <tr>
+ * <td>
+ * None
+ * </td>
+ * </tr>
+ * </table>
*/ \ No newline at end of file
diff --git a/Demos/Mouse/Mouse.c b/Demos/Mouse/Mouse.c
index f8ec0a0f5..b61850abe 100644
--- a/Demos/Mouse/Mouse.c
+++ b/Demos/Mouse/Mouse.c
@@ -45,8 +45,13 @@ BUTTLOADTAG(LUFAVersion, "LUFA V" LUFA_VERSION_STRING);
/* Scheduler Task List */
TASK_LIST
{
+ #if !defined(INTERRUPT_CONTROL_ENDPOINT)
{ Task: USB_USBTask , TaskStatus: TASK_STOP },
+ #endif
+
+ #if !defined(INTERRUPT_DATA_ENDPOINT)
{ Task: USB_Mouse_Report , TaskStatus: TASK_STOP },
+ #endif
};
/* Global Variables */
@@ -118,14 +123,34 @@ EVENT_HANDLER(USB_Connect)
UsingReportProtocol = true;
}
+/** Event handler for the USB_Reset event. This fires when the USB interface is reset by the USB host, before the
+ * enumeration process begins, and enables the control endpoint interrupt so that control requests can be handled
+ * asynchronously when they arrive rather than when the control endpoint is polled manually.
+ */
+EVENT_HANDLER(USB_Reset)
+{
+ #if defined(INTERRUPT_CONTROL_ENDPOINT)
+ /* Select the control endpoint */
+ Endpoint_SelectEndpoint(ENDPOINT_CONTROLEP);
+
+ /* Enable the endpoint SETUP interrupt ISR for the control endpoint */
+ USB_INT_Enable(ENDPOINT_INT_SETUP);
+ #endif
+}
+
/** 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.
*/
EVENT_HANDLER(USB_Disconnect)
{
- /* Stop running mouse reporting and USB management tasks */
+ /* Stop running keyboard reporting and USB management tasks */
+ #if !defined(INTERRUPT_DATA_ENDPOINT)
Scheduler_SetTaskMode(USB_Mouse_Report, TASK_STOP);
+ #endif
+
+ #if !defined(INTERRUPT_CONTROL_ENDPOINT)
Scheduler_SetTaskMode(USB_USBTask, TASK_STOP);
+ #endif
/* Indicate USB not ready */
UpdateStatus(Status_USBNotReady);
@@ -141,11 +166,18 @@ EVENT_HANDLER(USB_ConfigurationChanged)
ENDPOINT_DIR_IN, MOUSE_EPSIZE,
ENDPOINT_BANK_SINGLE);
+ #if defined(INTERRUPT_DATA_ENDPOINT)
+ /* Enable the endpoint IN interrupt ISR for the report endpoint */
+ USB_INT_Enable(ENDPOINT_INT_IN);
+ #endif
+
/* Indicate USB connected and ready */
UpdateStatus(Status_USBReady);
+ #if !defined(INTERRUPT_DATA_ENDPOINT)
/* Start running mouse reporting task */
Scheduler_SetTaskMode(USB_Mouse_Report, TASK_RUN);
+ #endif
}
/** Event handler for the USB_UnhandledControlPacket event. This is used to catch standard and class specific
@@ -163,7 +195,7 @@ EVENT_HANDLER(USB_UnhandledControlPacket)
USB_MouseReport_Data_t MouseReportData;
/* Create the next mouse report for transmission to the host */
- GetNextReport(&MouseReportData);
+ CreateMouseReport(&MouseReportData);
/* Ignore report type and ID number value */
Endpoint_Discard_Word();
@@ -278,7 +310,7 @@ ISR(TIMER0_COMPA_vect, ISR_BLOCK)
*
* \return Boolean true if the new report differs from the last report, false otherwise
*/
-bool GetNextReport(USB_MouseReport_Data_t* ReportData)
+bool CreateMouseReport(USB_MouseReport_Data_t* ReportData)
{
static uint8_t PrevJoyStatus = 0;
static bool PrevHWBStatus = false;
@@ -315,6 +347,45 @@ bool GetNextReport(USB_MouseReport_Data_t* ReportData)
return InputChanged;
}
+/** Sends the next HID report to the host, via the keyboard data endpoint. */
+static inline void SendNextReport(void)
+{
+ USB_MouseReport_Data_t MouseReportData;
+ bool SendReport = true;
+
+ /* Create the next mouse report for transmission to the host */
+ CreateMouseReport(&MouseReportData);
+
+ /* Check if the idle period is set*/
+ if (IdleCount)
+ {
+ /* Determine if the idle period has elapsed */
+ if (!(IdleMSRemaining))
+ {
+ /* Reset the idle time remaining counter, must multiply by 4 to get the duration in milliseconds */
+ IdleMSRemaining = (IdleCount << 2);
+ }
+ else
+ {
+ /* Idle period not elapsed, indicate that a report must not be sent */
+ SendReport = false;
+ }
+ }
+
+ /* Select the Mouse Report Endpoint */
+ Endpoint_SelectEndpoint(MOUSE_EPNUM);
+
+ /* Check if Mouse Endpoint Ready for Read/Write and if we should send a new report */
+ if (Endpoint_ReadWriteAllowed() && SendReport)
+ {
+ /* Write Mouse Report Data */
+ Endpoint_Write_Stream_LE(&MouseReportData, sizeof(MouseReportData));
+
+ /* Finalize the stream transfer to send the last packet */
+ Endpoint_ClearCurrentBank();
+ }
+}
+
/** Function to manage status updates to the user. This is done via LEDs on the given board, if available, but may be changed to
* log to a serial port, or anything else that is suitable for status updates.
*
@@ -342,45 +413,57 @@ void UpdateStatus(uint8_t CurrentStatus)
LEDs_SetAllLEDs(LEDMask);
}
+#if !defined(INTERRUPT_DATA_ENDPOINT)
/** Task to manage HID report generation and transmission to the host, when in report mode. */
TASK(USB_Mouse_Report)
{
- USB_MouseReport_Data_t MouseReportData;
- bool SendReport = true;
-
- /* Create the next mouse report for transmission to the host */
- GetNextReport(&MouseReportData);
-
- /* Check if the idle period is set*/
- if (IdleCount)
+ /* Check if the USB system is connected to a host */
+ if (USB_IsConnected)
{
- /* Determine if the idle period has elapsed */
- if (!(IdleMSRemaining))
- {
- /* Reset the idle time remaining counter, must multiply by 4 to get the duration in milliseconds */
- IdleMSRemaining = (IdleCount << 2);
- }
- else
- {
- /* Idle period not elapsed, indicate that a report must not be sent */
- SendReport = false;
- }
+ /* Send the next mouse report to the host */
+ SendNextReport();
}
+}
+#endif
+
+/** ISR for the general Pipe/Endpoint interrupt vector. This ISR fires when an endpoint's status changes (such as
+ * a packet has been received) on an endpoint with its corresponding ISR enabling bits set. This is used to send
+ * HID packets to the host each time the HID interrupt endpoints polling period elapses, as managed by the USB
+ * controller. It is also used to respond to standard and class specific requests send to the device on the control
+ * endpoint, by handing them off to the LUFA library when they are received.
+ */
+ISR(ENDPOINT_PIPE_vect, ISR_BLOCK)
+{
+ #if defined(INTERRUPT_CONTROL_ENDPOINT)
+ /* Check if the control endpoint has received a request */
+ if (Endpoint_HasEndpointInterrupted(ENDPOINT_CONTROLEP))
+ {
+ /* Clear the endpoint interrupt */
+ Endpoint_ClearEndpointInterrupt(ENDPOINT_CONTROLEP);
+
+ /* Process the control request */
+ USB_USBTask();
+
+ /* Handshake the endpoint setup interrupt - must be after the call to USB_USBTask() */
+ USB_INT_Clear(ENDPOINT_INT_SETUP);
+ }
+ #endif
- /* Check if the USB system is connected to a host */
- if (USB_IsConnected)
+ #if defined(INTERRUPT_DATA_ENDPOINT)
+ /* Check if mouse endpoint has interrupted */
+ if (Endpoint_HasEndpointInterrupted(MOUSE_EPNUM))
{
/* Select the Mouse Report Endpoint */
Endpoint_SelectEndpoint(MOUSE_EPNUM);
- /* Check if Mouse Endpoint Ready for Read/Write and if we should send a new report */
- if (Endpoint_ReadWriteAllowed() && SendReport)
- {
- /* Write Mouse Report Data */
- Endpoint_Write_Stream_LE(&MouseReportData, sizeof(MouseReportData));
-
- /* Finalize the stream transfer to send the last packet */
- Endpoint_ClearCurrentBank();
- }
+ /* Clear the endpoint IN interrupt flag */
+ USB_INT_Clear(ENDPOINT_INT_IN);
+
+ /* Clear the Mouse Report endpoint interrupt and select the endpoint */
+ Endpoint_ClearEndpointInterrupt(MOUSE_EPNUM);
+
+ /* Send the next mouse report to the host */
+ SendNextReport();
}
+ #endif
}
diff --git a/Demos/Mouse/Mouse.h b/Demos/Mouse/Mouse.h
index 50908129a..8723b7840 100644
--- a/Demos/Mouse/Mouse.h
+++ b/Demos/Mouse/Mouse.h
@@ -103,6 +103,9 @@
/** Indicates that this module will catch the USB_Disconnect event when thrown by the library. */
HANDLES_EVENT(USB_Disconnect);
+ /** Indicates that this module will catch the USB_Reset event when thrown by the library. */
+ HANDLES_EVENT(USB_Reset);
+
/** Indicates that this module will catch the USB_ConfigurationChanged event when thrown by the library. */
HANDLES_EVENT(USB_ConfigurationChanged);
@@ -110,7 +113,7 @@
HANDLES_EVENT(USB_UnhandledControlPacket);
/* Function Prototypes: */
- bool GetNextReport(USB_MouseReport_Data_t* ReportData);
+ bool CreateMouseReport(USB_MouseReport_Data_t* ReportData);
void UpdateStatus(uint8_t CurrentStatus);
#endif
diff --git a/Demos/Mouse/Mouse.txt b/Demos/Mouse/Mouse.txt
index 7b7360f0e..6764275ce 100644
--- a/Demos/Mouse/Mouse.txt
+++ b/Demos/Mouse/Mouse.txt
@@ -6,17 +6,9 @@
/** \mainpage Mouse Device Demo
*
- * Mouse demonstration application. This gives a simple reference
- * application for implementing a USB Mouse using the basic USB HID
- * drivers in all modern OSes (i.e. no special drivers required). It is
- * boot protocol compatible, and thus works under compatible BIOS as if
- * it was a native mouse (e.g. PS/2).
- *
- * On startup the system will automatically enumerate and function
- * as a mouse when the USB connection to a host is present. To use
- * the mouse, move the joystick to move the pointer, and push the
- * joystick inwards to simulate a left-button click. The HWB serves as
- * the right mouse button.
+ * \section SSec_Info USB Information:
+ *
+ * The following table gives a rundown of the USB utilization of this demo.
*
* <table>
* <tr>
@@ -40,4 +32,44 @@
* <td>Low Speed Mode, Full Speed Mode</td>
* </tr>
* </table>
+ *
+ * \section SSec_Description Project Description:
+ *
+ * Mouse demonstration application. This gives a simple reference
+ * application for implementing a USB Mouse using the basic USB HID
+ * drivers in all modern OSes (i.e. no special drivers required). It is
+ * boot protocol compatible, and thus works under compatible BIOS as if
+ * it was a native mouse (e.g. PS/2).
+ *
+ * On startup the system will automatically enumerate and function
+ * as a mouse when the USB connection to a host is present. To use
+ * the mouse, move the joystick to move the pointer, and push the
+ * joystick inwards to simulate a left-button click. The HWB serves as
+ * the right mouse button.
+ *
+ * \section SSec_Options Project Options
+ *
+ * The following defines can be found in this demo, which can control the demo behaviour when defined, or changed in value.
+ *
+ * <table>
+ * <tr>
+ * <td><b>Define Name:</b></td>
+ * <td><b>Location:</b></td>
+ * <td><b>Description:</b></td>
+ * </tr>
+ * <tr>
+ * <td>INTERRUPT_CONTROL_ENDPOINT</td>
+ * <td>Makefile CDEFS</td>
+ * <td>When defined, this causes the demo to enable interrupts for the control endpoint,
+ * which services control requests from the host. If not defined, the control endpoint
+ * is serviced via polling using the task scheduler.</td>
+ * </tr>
+ * <tr>
+ * <td>INTERRUPT_DATA_ENDPOINT</td>
+ * <td>Makefile CDEFS</td>
+ * <td>When defined, this causes the demo to enable interrupts for the data endpoint,
+ * which services outgoing mouse button and movement reports to the host. If not defined,
+ * the data endpoint is serviced via polling using the task scheduler.</td>
+ * </tr>
+ * </table>
*/ \ No newline at end of file
diff --git a/Demos/Mouse/makefile b/Demos/Mouse/makefile
index a731e205e..27ca1d809 100644
--- a/Demos/Mouse/makefile
+++ b/Demos/Mouse/makefile
@@ -177,7 +177,6 @@ CDEFS = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD)
CDEFS += -DUSE_NONSTANDARD_DESCRIPTOR_NAMES -DNO_STREAM_CALLBACKS -DUSB_DEVICE_ONLY
CDEFS += -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
-
# Place -D or -U options here for ASM sources
ADEFS = -DF_CPU=$(F_CPU)
diff --git a/Demos/MouseHost/MouseHost.txt b/Demos/MouseHost/MouseHost.txt
index 11c434c69..a6d1ba828 100644
--- a/Demos/MouseHost/MouseHost.txt
+++ b/Demos/MouseHost/MouseHost.txt
@@ -5,22 +5,10 @@
*/
/** \mainpage Mouse Host Demo
- *
- * Mouse host demonstration application. This gives a simple reference
- * application for implementing a USB Mouse host, for USB mice using
- * the standard mouse HID profile.
- *
- * Mouse movement and button presses are displayed on the board LEDs,
- * as well as printed out the serial terminal as formatted dY, dY and
- * button status information.
- *
- * This uses a naive method where the mouse is set to Boot Protocol mode, so
- * that the report structure is fixed and known. A better implementation
- * uses the HID report parser for correct report data processing across
- * all compatable mice with advanced characteristics, as shown in the
- * MouseHostWithParser demo application.
- *
- * Currently only single interface mice are supported.
+ *
+ * \section SSec_Info USB Information:
+ *
+ * The following table gives a rundown of the USB utilization of this demo.
*
* <table>
* <tr>
@@ -44,4 +32,34 @@
* <td>Low Speed Mode, Full Speed Mode</td>
* </tr>
* </table>
+ *
+ * \section SSec_Description Project Description:
+ *
+ * Mouse host demonstration application. This gives a simple reference
+ * application for implementing a USB Mouse host, for USB mice using
+ * the standard mouse HID profile.
+ *
+ * Mouse movement and button presses are displayed on the board LEDs,
+ * as well as printed out the serial terminal as formatted dY, dY and
+ * button status information.
+ *
+ * This uses a naive method where the mouse is set to Boot Protocol mode, so
+ * that the report structure is fixed and known. A better implementation
+ * uses the HID report parser for correct report data processing across
+ * all compatable mice with advanced characteristics, as shown in the
+ * MouseHostWithParser demo application.
+ *
+ * Currently only single interface mice are supported.
+ *
+ * \section SSec_Options Project Options
+ *
+ * The following defines can be found in this demo, which can control the demo behaviour when defined, or changed in value.
+ *
+ * <table>
+ * <tr>
+ * <td>
+ * None
+ * </td>
+ * </tr>
+ * </table>
*/ \ No newline at end of file
diff --git a/Demos/MouseHostViaInt/MouseHostViaInt.txt b/Demos/MouseHostViaInt/MouseHostViaInt.txt
index 72ee1dbee..749865544 100644
--- a/Demos/MouseHostViaInt/MouseHostViaInt.txt
+++ b/Demos/MouseHostViaInt/MouseHostViaInt.txt
@@ -4,24 +4,9 @@
* documentation pages. It is not a project source file.
*/
-/** \mainpage Mouse Host Demo
- *
- * Mouse host demonstration application, using pipe interrupts. This
- * gives a simple reference application for implementing a USB Mouse
- * host utilizing the LUFA pipe interrupt system, for USB mice using
- * the standard mouse HID profile.
- *
- * Mouse movement and button presses are displayed on the board LEDs,
- * as well as printed out the serial terminal as formatted dY, dY and
- * button status information.
- *
- * This uses a naive method where the mouse is set to Boot Protocol mode, so
- * that the report structure is fixed and known. A better implementation
- * uses the HID report parser for correct report data processing across
- * all compatable mice with advanced characteristics, as shown in the
- * MouseHostWithParser demo application.
- *
- * Currently only single interface mice are supported.
+/** \mainpage Mouse Host Demo (via interrupts)
+ *
+ * \section SSec_Info USB Information:
*
* <table>
* <tr>
@@ -45,4 +30,37 @@
* <td>Low Speed Mode, Full Speed Mode</td>
* </tr>
* </table>
+ *
+ * \section SSec_Description Project Description:
+ *
+ * The following table gives a rundown of the USB utilization of this demo.
+ *
+ * Mouse host demonstration application, using pipe interrupts. This
+ * gives a simple reference application for implementing a USB Mouse
+ * host utilizing the LUFA pipe interrupt system, for USB mice using
+ * the standard mouse HID profile.
+ *
+ * Mouse movement and button presses are displayed on the board LEDs,
+ * as well as printed out the serial terminal as formatted dY, dY and
+ * button status information.
+ *
+ * This uses a naive method where the mouse is set to Boot Protocol mode, so
+ * that the report structure is fixed and known. A better implementation
+ * uses the HID report parser for correct report data processing across
+ * all compatable mice with advanced characteristics, as shown in the
+ * MouseHostWithParser demo application.
+ *
+ * Currently only single interface mice are supported.
+ *
+ * \section SSec_Options Project Options
+ *
+ * The following defines can be found in this demo, which can control the demo behaviour when defined, or changed in value.
+ *
+ * <table>
+ * <tr>
+ * <td>
+ * None
+ * </td>
+ * </tr>
+ * </table>
*/ \ No newline at end of file
diff --git a/Demos/MouseHostWithParser/MouseHostWithParser.txt b/Demos/MouseHostWithParser/MouseHostWithParser.txt
index 97ee8bfb8..3c83341a2 100644
--- a/Demos/MouseHostWithParser/MouseHostWithParser.txt
+++ b/Demos/MouseHostWithParser/MouseHostWithParser.txt
@@ -5,19 +5,10 @@
*/
/** \mainpage Mouse Host With HID Descriptor Parser Demo
- *
- * Mouse host demonstration application. This gives a simple reference
- * application for implementing a USB Mouse host, for USB mice using
- * the standard mouse HID profile. It uses a HID parser for the HID
- * reports, allowing for correct operation across all USB mice. This
- * demo supports mice with a single HID report.
- *
- * Mouse movement and button presses are displayed on the board LEDs.
- * On connection to a USB mouse, the report items will be processed and
- * printed as a formatted list through the USART before the mouse is
- * fully enumerated.
- *
- * Currently only single interface mice are supported.
+ *
+ * \section SSec_Info USB Information:
+ *
+ * The following table gives a rundown of the USB utilization of this demo.
*
* <table>
* <tr>
@@ -41,4 +32,31 @@
* <td>Low Speed Mode, Full Speed Mode</td>
* </tr>
* </table>
+ *
+ * \section SSec_Description Project Description:
+ *
+ * Mouse host demonstration application. This gives a simple reference
+ * application for implementing a USB Mouse host, for USB mice using
+ * the standard mouse HID profile. It uses a HID parser for the HID
+ * reports, allowing for correct operation across all USB mice. This
+ * demo supports mice with a single HID report.
+ *
+ * Mouse movement and button presses are displayed on the board LEDs.
+ * On connection to a USB mouse, the report items will be processed and
+ * printed as a formatted list through the USART before the mouse is
+ * fully enumerated.
+ *
+ * Currently only single interface mice are supported.
+ *
+ * \section SSec_Options Project Options
+ *
+ * The following defines can be found in this demo, which can control the demo behaviour when defined, or changed in value.
+ *
+ * <table>
+ * <tr>
+ * <td>
+ * None
+ * </td>
+ * </tr>
+ * </table>
*/ \ No newline at end of file
diff --git a/Demos/RNDISEthernet/RNDISEthernet.txt b/Demos/RNDISEthernet/RNDISEthernet.txt
index bd4ff69e8..306cf8526 100644
--- a/Demos/RNDISEthernet/RNDISEthernet.txt
+++ b/Demos/RNDISEthernet/RNDISEthernet.txt
@@ -5,7 +5,11 @@
*/
/** \mainpage RNDIS Class Ethernet Demo (with Webserver/Telnet)
- *
+ *
+ * \section SSec_Info USB Information:
+ *
+ * The following table gives a rundown of the USB utilization of this demo.
+ *
* Remote Network Driver Interface demonstration application.
* This gives a simple reference application for implementing
* a CDC RNDIS device acting as a simple network interface for
@@ -37,6 +41,8 @@
* recommended that it be replaced with an external open source TCP/IP
* stack that is feature complete, such as the uIP stack.
*
+ * \section SSec_Description Project Description:
+ *
* <table>
* <tr>
* <td><b>USB Mode:</b></td>
@@ -59,4 +65,51 @@
* <td>Full Speed Mode</td>
* </tr>
* </table>
+ *
+ * \section SSec_Options Project Options
+ *
+ * The following defines can be found in this demo, which can control the demo behaviour when defined, or changed in value.
+ *
+ * <table>
+ * <tr>
+ * <td><b>Define Name:</b></td>
+ * <td><b>Location:</b></td>
+ * <td><b>Description:</b></td>
+ * </tr>
+ * <tr>
+ * <td>NO_DECODE_ETHERNET</td>
+ * <td>Makefile CDEFS</td>
+ * <td>When defined, received Ethernet headers will not be decoded and printed to the device serial port.</td>
+ * </tr>
+ * <tr>
+ * <td>NO_DECODE_ARP</td>
+ * <td>Makefile CDEFS</td>
+ * <td>When defined, received ARP headers will not be decoded and printed to the device serial port.</td>
+ * </tr>
+ * <tr>
+ * <td>NO_DECODE_IP</td>
+ * <td>Makefile CDEFS</td>
+ * <td>When defined, received IP headers will not be decoded and printed to the device serial port.</td>
+ * </tr>
+ * <tr>
+ * <td>NO_DECODE_ICMP</td>
+ * <td>Makefile CDEFS</td>
+ * <td>When defined, received ICMP headers will not be decoded and printed to the device serial port.</td>
+ * </tr>
+ * <tr>
+ * <td>NO_DECODE_TCP</td>
+ * <td>Makefile CDEFS</td>
+ * <td>When defined, received TCP headers will not be decoded and printed to the device serial port.</td>
+ * </tr>
+ * <tr>
+ * <td>NO_DECODE_UDP</td>
+ * <td>Makefile CDEFS</td>
+ * <td>When defined, received UDP headers will not be decoded and printed to the device serial port.</td>
+ * </tr>
+ * <tr>
+ * <td>NO_DECODE_DHCP</td>
+ * <td>Makefile CDEFS</td>
+ * <td>When defined, received DHCP headers will not be decoded and printed to the device serial port.</td>
+ * </tr>
+ * </table>
*/ \ No newline at end of file
diff --git a/Demos/StillImageHost/StillImageHost.txt b/Demos/StillImageHost/StillImageHost.txt
index 6e2657be6..4cdfe6346 100644
--- a/Demos/StillImageHost/StillImageHost.txt
+++ b/Demos/StillImageHost/StillImageHost.txt
@@ -5,14 +5,10 @@
*/
/** \mainpage Still Image Host Demo
- *
- * Still Image host demonstration application. This gives a simple reference
- * application for implementing a Still Image host, for USB devices such as
- * digital cameras.
- *
- * This demo will enumerate an attached USB Still Image device, print out its
- * information structure, open a session with the device and finally close the
- * session.
+ *
+ * \section SSec_Info USB Information:
+ *
+ * The following table gives a rundown of the USB utilization of this demo.
*
* <table>
* <tr>
@@ -37,4 +33,26 @@
* <td>Full Speed Mode</td>
* </tr>
* </table>
+ *
+ * \section SSec_Description Project Description:
+ *
+ * Still Image host demonstration application. This gives a simple reference
+ * application for implementing a Still Image host, for USB devices such as
+ * digital cameras.
+ *
+ * This demo will enumerate an attached USB Still Image device, print out its
+ * information structure, open a session with the device and finally close the
+ * session.
+ *
+ * \section SSec_Options Project Options
+ *
+ * The following defines can be found in this demo, which can control the demo behaviour when defined, or changed in value.
+ *
+ * <table>
+ * <tr>
+ * <td>
+ * None
+ * </td>
+ * </tr>
+ * </table>
*/ \ No newline at end of file
diff --git a/Demos/TestApp/TestApp.txt b/Demos/TestApp/TestApp.txt
index e5b268aa5..aef55b761 100644
--- a/Demos/TestApp/TestApp.txt
+++ b/Demos/TestApp/TestApp.txt
@@ -6,25 +6,9 @@
/** \mainpage Test Application for the LUFA library
*
- * Test application. Demonstrates several aspects of the LUFA
- * Library. On startup the current temperature will be printed
- * through the USART every 10 seconds, and the current joystick
- * position will be indicated via the LEDs on the selected board.
- * Pressing the HWB will initiate the USB subsystem, enumerating
- * the device (which has <b>no actual functionality beyond
- * enumeration as a device or as a host in this demo</b>, and serves
- * only to demonstrate the USB portion of the library). It will
- * also suspend the joystick and temperature monitoring tasks.
- *
- * Pressing the HWB a second time will turn off the USB system
- * and resume the temperature printing task (but not the joystick
- * monitoring task).
- *
- * When activated, the USB events will be printed through the
- * serial USART.
+ * \section SSec_Info USB Information:
*
- * When the USB subsystem is activated, the board LEDs will show
- * the current USB status.
+ * The following table gives a rundown of the USB utilization of this demo.
*
* <table>
* <tr>
@@ -48,4 +32,38 @@
* <td>Low Speed Mode, Full Speed Mode</td>
* </tr>
* </table>
+ *
+ * \section SSec_Description Project Description:
+ *
+ * Test application. Demonstrates several aspects of the LUFA
+ * Library. On startup the current temperature will be printed
+ * through the USART every 10 seconds, and the current joystick
+ * position will be indicated via the LEDs on the selected board.
+ * Pressing the HWB will initiate the USB subsystem, enumerating
+ * the device (which has <b>no actual functionality beyond
+ * enumeration as a device or as a host in this demo</b>, and serves
+ * only to demonstrate the USB portion of the library). It will
+ * also suspend the joystick and temperature monitoring tasks.
+ *
+ * Pressing the HWB a second time will turn off the USB system
+ * and resume the temperature printing task (but not the joystick
+ * monitoring task).
+ *
+ * When activated, the USB events will be printed through the
+ * serial USART.
+ *
+ * When the USB subsystem is activated, the board LEDs will show
+ * the current USB status.
+ *
+ * \section SSec_Options Project Options
+ *
+ * The following defines can be found in this demo, which can control the demo behaviour when defined, or changed in value.
+ *
+ * <table>
+ * <tr>
+ * <td>
+ * None
+ * </td>
+ * </tr>
+ * </table>
*/ \ No newline at end of file
diff --git a/Demos/USBtoSerial/USBtoSerial.txt b/Demos/USBtoSerial/USBtoSerial.txt
index 992f00f47..e33467217 100644
--- a/Demos/USBtoSerial/USBtoSerial.txt
+++ b/Demos/USBtoSerial/USBtoSerial.txt
@@ -6,19 +6,9 @@
/** \mainpage USB to Serial Converter Demo (via CDC-ACM class)
*
- * Communications Device Class demonstration application.
- * This gives a simple reference application for implementing
- * a USB to Serial converter using the CDC class. Sent and
- * received data on the serial port is communicated to the USB
- * host.
- *
- * After running this demo for the first time on a new computer,
- * you will need to supply the .INF file located in this demo
- * project's directory as the device's driver when running under
- * Windows. This will enable Windows to use its inbuilt CDC drivers,
- * negating the need for custom drivers for the device. Other
- * Operating Systems should automatically use their own inbuilt
- * CDC-ACM drivers.
+ * \section SSec_Info USB Information:
+ *
+ * The following table gives a rundown of the USB utilization of this demo.
*
* <table>
* <tr>
@@ -42,4 +32,37 @@
* <td>Full Speed Mode</td>
* </tr>
* </table>
+ *
+ * \section SSec_Description Project Description:
+ *
+ * Communications Device Class demonstration application.
+ * This gives a simple reference application for implementing
+ * a USB to Serial converter using the CDC class. Sent and
+ * received data on the serial port is communicated to the USB
+ * host.
+ *
+ * After running this demo for the first time on a new computer,
+ * you will need to supply the .INF file located in this demo
+ * project's directory as the device's driver when running under
+ * Windows. This will enable Windows to use its inbuilt CDC drivers,
+ * negating the need for custom drivers for the device. Other
+ * Operating Systems should automatically use their own inbuilt
+ * CDC-ACM drivers.
+ *
+ * \section SSec_Options Project Options
+ *
+ * The following defines can be found in this demo, which can control the demo behaviour when defined, or changed in value.
+ *
+ * <table>
+ * <tr>
+ * <td><b>Define Name:</b></td>
+ * <td><b>Location:</b></td>
+ * <td><b>Description:</b></td>
+ * </tr>
+ * <tr>
+ * <td>BUFF_STATICSIZE</td>
+ * <td>RingBuff.h</td>
+ * <td>Defines the maximum number of bytes which can be buffered in each Ring Buffer.</td>
+ * </tr>
+ * </table>
*/ \ No newline at end of file
diff --git a/Demos/makefile b/Demos/makefile
index 2fd957a36..8f441461a 100644
--- a/Demos/makefile
+++ b/Demos/makefile
@@ -58,12 +58,6 @@ all:
make -C Mouse clean
make -C Mouse all
-
- make -C MouseFullInt clean
- make -C MouseFullInt all
-
- make -C MouseViaInt clean
- make -C MouseViaInt all
make -C MouseHost clean
make -C MouseHost all
@@ -102,8 +96,6 @@ all:
make -C MassStorageHost $@
make -C MIDI $@
make -C Mouse $@
- make -C MouseFullInt $@
- make -C MouseViaInt $@
make -C MouseHost $@
make -C MouseHostWithParser $@
make -C MouseHostViaInt $@