Commit 88051e78 authored by Dean Camera's avatar Dean Camera
Browse files

Combined Mouse, MouseViaInt and MouseFullInt demos into a single unified demo.

Corrections to Keyboard demo.

Removed AVRISP_Programmer project due to code quality concerns.
parent 48400df1
......@@ -5,15 +5,10 @@
*/
/** \mainpage CDC Class USB AVR Bootloader
*
* This bootloader enumerates to the host as a CDC Class device (virtual serial port), allowing for AVR109
* protocol compatible programming software to load firmware onto the AVR.
*
* Out of the box this bootloader builds for the USB1287, and will fit into 4KB of bootloader space. If
* you wish to enlarge this space and/or change the AVR model, you will need to edit the BOOT_START and MCU
* values in the accompanying makefile.
*
* This bootloader is compatible with the open source application AVRDUDE, or Atmel's AVRPROG.
*
* \section SSec_Info USB Information:
*
* The following table gives a rundown of the USB utilization of this demo.
*
* <table>
* <tr>
......@@ -37,4 +32,27 @@
* <td>Full Speed Mode</td>
* </tr>
* </table>
*/
*
* \section SSec_Description Project Description:
*
* This bootloader enumerates to the host as a CDC Class device (virtual serial port), allowing for AVR109
* protocol compatible programming software to load firmware onto the AVR.
*
* Out of the box this bootloader builds for the USB1287, and will fit into 4KB of bootloader space. If
* you wish to enlarge this space and/or change the AVR model, you will need to edit the BOOT_START and MCU
* values in the accompanying makefile.
*
* This bootloader is compatible with the open source application AVRDUDE, or Atmel's AVRPROG.
*
* \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
......@@ -5,27 +5,10 @@
*/
/** \mainpage DFU Class USB AVR Bootloader
*
* This bootloader enumerates to the host as a DFU Class device, allowing for DFU-compatible programming
* software to load firmware onto the AVR.
*
* This bootloader is compatible with Atmel's FLIP application. However, it requires the use of Atmel's
* DFU drivers. You will need to install Atmel's DFU drivers prior to using this bootloader.
*
* As an open-source option, this bootloader is also compatible with the Linux Atmel USB DFU Programmer
* software, available for download at http://sourceforge.net/projects/dfu-programmer/.
*
* If SECURE_MODE is defined as true, upon startup the bootloader will be locked, with only the chip erase
* function available (similar to Atmel's DFU bootloader). If SECURE_MODE is defined as false, all functions
* are usable on startup without the prerequisite firmware erase.
*
* Out of the box this bootloader builds for the USB1287, and should fit into 4KB of bootloader space. If
* you wish to enlarge this space and/or change the AVR model, you will need to edit the BOOT_START and MCU
* values in the accompanying makefile.
*
* <b>NOTE:</b> This device spoofs Atmel's DFU Bootloader USB VID and PID so that the Atmel DFU bootloader
* drivers included with FLIP will work. If you do not wish to use Atmel's ID codes, please
* manually change them in Descriptors.c and alter your driver's INF file accordingly.
*
* \section SSec_Info USB Information:
*
* The following table gives a rundown of the USB utilization of this demo.
*
* <table>
* <tr>
......@@ -49,4 +32,46 @@
* <td>Full Speed Mode</td>
* </tr>
* </table>
*/
*
* \section SSec_Description Project Description:
*
* This bootloader enumerates to the host as a DFU Class device, allowing for DFU-compatible programming
* software to load firmware onto the AVR.
*
* This bootloader is compatible with Atmel's FLIP application. However, it requires the use of Atmel's
* DFU drivers. You will need to install Atmel's DFU drivers prior to using this bootloader.
*
* As an open-source option, this bootloader is also compatible with the Linux Atmel USB DFU Programmer
* software, available for download at http://sourceforge.net/projects/dfu-programmer/.
*
* If SECURE_MODE is defined as true, upon startup the bootloader will be locked, with only the chip erase
* function available (similar to Atmel's DFU bootloader). If SECURE_MODE is defined as false, all functions
* are usable on startup without the prerequisite firmware erase.
*
* Out of the box this bootloader builds for the USB1287, and should fit into 4KB of bootloader space. If
* you wish to enlarge this space and/or change the AVR model, you will need to edit the BOOT_START and MCU
* values in the accompanying makefile.
*
* <b>NOTE:</b> This device spoofs Atmel's DFU Bootloader USB VID and PID so that the Atmel DFU bootloader
* drivers included with FLIP will work. If you do not wish to use Atmel's ID codes, please
* manually change them in Descriptors.c and alter your driver's INF file accordingly.
*
* \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>SECURE_MODE</td>
* <td>BootloaderDFU.h</td>
* <td>If defined to true, the bootloader will not accept any memory commands other than a chip erase on statup, until an
* erase has been perfomed. This can be used in conjunction with the AVR's lockbits to prevent the AVRs firmware from
* being dumped by unauthorized persons.</td>
* </tr>
* </table>
*/
\ No newline at end of file
......@@ -57,9 +57,9 @@
/* Macros: */
/** HID Class specific request to send the next HID report to the device. */
#define REQ_SetReport 0x09
#define REQ_SetReport 0x09
#define TEENSY_STARTAPPLICATION 0xFFFF
#define TEENSY_STARTAPPLICATION 0xFFFF
/* Event Handlers: */
/** Indicates that this module will catch the USB_Disconnect event when thrown by the library. */
......
......@@ -5,15 +5,11 @@
*/
/** \mainpage Teensy HID Class USB AVR Bootloader
*
* This bootloader enumerates to the host as a HID Class device, allowing for Teensy compatible programming
* software to load firmware onto the AVR, such as the official software at http://www.pjrc.com/teensy/.
*
* Out of the box this bootloader builds for the USB162, and will fit into 2KB of bootloader space.
*
* This spoofs (with permission) the offical Teensy bootloader's VID and PID, so that the software remains
* compatible with no changes.
*
* \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>
......@@ -38,4 +34,26 @@
* <td>Full Speed Mode</td>
* </tr>
* </table>
*/
*
* \section SSec_Description Project Description:
*
* This bootloader enumerates to the host as a HID Class device, allowing for Teensy compatible programming
* software to load firmware onto the AVR, such as the official software at http://www.pjrc.com/teensy/.
*
* Out of the box this bootloader builds for the USB162, and will fit into 2KB of bootloader space.
*
* This spoofs (with permission) the offical Teensy bootloader's VID and PID, so that the software remains
* compatible with no changes.
*
* \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
......@@ -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"
......
......@@ -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
......@@ -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 */
......
......@@ -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
......@@ -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)
......
......@@ -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
......@@ -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
......@@ -5,6 +5,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
......@@ -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
......@@ -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
......@@ -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
......