Commit Graph

703 Commits

Author SHA1 Message Date
Dean Camera afe6ae1402 Add host mode USB Class driver stubs, add beginnings of a CDC host class driver.
Split out common defines/types from class drivers into a seperate common class driver directory.

Make central USB Class driver dispatch headers, used for both device and host modes.
2009-06-14 15:55:13 +00:00
Dean Camera 4d3a594f3e Changed per-device controller preprocessor checks over to per-device series for better device control.
Fixed error in Endpoint.c using HSOFI rather than SOFI for counting elapsed milliseconds.
2009-06-14 07:44:02 +00:00
Dean Camera 9798440ca4 Changed to new device mode Class Driver function name prefixes to make way for similar host mode Class drivers. 2009-06-11 06:15:45 +00:00
Dean Camera b2330934b9 Some minor whitespace corrections. 2009-06-11 01:52:53 +00:00
Dean Camera 6be24e4404 Fixes to the MIDI device demos (ClassDriver, LowLevel); discard unused read-in events from the host, use standard MIDI event structure in low level demo rather than sending individual bytes. 2009-06-10 05:03:45 +00:00
Dean Camera 0323e13b39 Copy over schedulerless host demos to ClassDrivers directory, for later modification to new Host mode USB class drivers. 2009-06-09 04:30:12 +00:00
Dean Camera 34f6e0dd33 Deleted Host ClassDriver demos -- not yet started, faster to rebase new ClassDriver demos from the newly schedulerless LowLevel host demos rather than re-convert each demo from the previous scheduler-based implementations.
Fixes to MassStorageHost demo to improve compatibility with more USB drives.
2009-06-09 04:27:53 +00:00
Dean Camera e6881fd166 Error status LEDs shown when device endpoint configuration fails to complete.
MIDI device demo no longer blocks if a note change event is sent while the endpoint is not ready.
2009-06-08 07:46:07 +00:00
Dean Camera ac70ddd0a1 Converted Host mode demos to schedulerless. Fixed host mode broken due to earlier Start-of-frame event experiments. 2009-06-08 07:34:16 +00:00
Dean Camera 33a0184749 Converted device mode low-level demos to schedulerless. 2009-06-07 07:20:33 +00:00
Dean Camera 2793c88fc6 Add master device Host demo makefile.
Copy and convert incomplete Bluetooth Host demo to the library.
2009-06-05 08:13:19 +00:00
Dean Camera d47df1cd3a Delete host mode demos from the root Host demos folder. 2009-06-05 07:59:24 +00:00
Dean Camera f1199200e1 Copy existing Host mode demos to new ClassDriver and LowLevel subfolders. 2009-06-05 07:56:39 +00:00
Dean Camera f51017f8fb Conversion of old incomplete SideShow demo to new APIs. 2009-06-05 07:52:53 +00:00
Dean Camera bf041e8bbf Add new Incomplete device subdirectory for work-in-progress demos. Add incomplete SideShow demo. 2009-06-05 07:32:40 +00:00
Dean Camera dd2cc7eda7 Remove outdated AVRStudio project files from demos, projects, bootloaders. Fix makefiles of ClassDriver device demos. 2009-06-05 07:30:23 +00:00
Dean Camera b9b03aadb2 Move new Class Driver powered demos to a new ClassDriver subdirectory, re-add old low level demos to a LowLevel subdirectory. 2009-06-05 07:16:33 +00:00
Dean Camera 3d1baa6f95 Added multiple Report ID support to the HID class driver. Removed OUT endpoint support from HID driver (all OUT reports are now processed through control requests) as a seperate endpoint had issues with determining the exact output report length. 2009-06-05 02:23:31 +00:00
Dean Camera 7665bf323e Fixed EVENT_USB_CDC_ControLineStateChanged() event not taking the CDC interface structure as a parameter.
Converted TestApp demo over to the new demo structure.

More class driver documentation improvements.
2009-06-04 06:26:35 +00:00
Dean Camera d37d419ffa Fix Doxygen errors in demos. 2009-06-04 03:12:07 +00:00
Dean Camera 4897ef8972 Ensure all USB device class drivers have the same three main functions as their interface for consistency. 2009-06-04 03:03:48 +00:00
Dean Camera a67bd74e3e Minor documentation page updates.
Redocumented all device demos, now that they have changed over to the new USB class drivers.

Added C linkage to class drivers for C++ support.

Added prefixes to most of the class driver constants to prevent name clashes.
2009-06-04 02:55:30 +00:00
Dean Camera 7c5444b89a Removed new Start of Frame event from the library; performance suffered far too much and it was only useful in one of the standard classes (HID). Altered HID demos to use the previous method of tracking millisecond periods via a hardware timer rather than the SOF events.
Fixed MIDI class driver blocking on unread events to the host.
2009-06-02 10:54:32 +00:00
Dean Camera 74b7c07e96 Add MIDI class driver, update MIDI device demo to use the new USB class driver. All device demos/projects have now been converted to the new library class drivers, although documentation is yet to be completed. 2009-06-01 12:01:53 +00:00
Dean Camera d1e5266036 Commit of new class abstraction APIs for all device demos other than the MIDI demo - not documented yet.
Removed scheduler and memory allocation libraries.

Added new EVENT_USB_StartOfFrame event in the library to indicate the start of each USB frame (when generated).

Removed Tx interrupt from the USBtoSerial demo; now sends characters via polling to ensure more time for the Rx interrupt.
2009-06-01 11:03:39 +00:00
Dean Camera 7eb4eb7cdd Fix all device mode demos broken in the recent API changes.
Change USBtoSerial Tx to polling-driven rather than interrupt driven, to ensure more time for the Rx interrupt to be serviced.
2009-05-26 04:46:35 +00:00
Dean Camera b7ef7f49c9 Moved out each demos' functionality library files (e.g. Ring Buffer library) to /Lib directories for a better directory structure. 2009-05-22 06:17:57 +00:00
Dean Camera d0806c817c Deleted StdDescriptors.c, renamed USB_GetDescriptor() to CALLBACK_USB_GetDescriptor, moved ConfigDescriptor.c/.h from the LUFA/Drivers/USB/Class/ directory to LUFA/Drivers/USB/HighLevel/ in preperation for the new USB class APIs. 2009-05-22 05:23:00 +00:00
Dean Camera b3a4d8512b Fixed incorrect PID value being used in the USBtoSerial project (thanks to Phill). 2009-05-20 14:50:26 +00:00
Dean Camera 2ee9fc7077 Rewritten event system to remove all macros, to make user code clearer.
Fixed incorrect ENDPOINT_EPNUM_MASK mask preventing endpoints above EP3 from being selected (thanks to Jonathan Oakley).

Removed STREAM_CALLBACK() macro - callbacks now use regular function definitions to clarify user code.

Removed DESCRIPTOR_COMPARATOR() macro - comparators should now use regular function definitions to clarify user code.
2009-05-18 10:05:21 +00:00
Dean Camera 72c2922e38 Removed DESCRIPTOR_ADDRESS() macro as it was largely supurflous and only served to obfuscate code. 2009-05-17 07:44:00 +00:00
Dean Camera eeba38e343 Create a new function pointer type in StreamCallbacks.h for endpoint/pipe stream callbacks, to make stream function prototypes clearer. 2009-05-15 12:27:32 +00:00
Dean Camera 76d5e99bb8 Fix to previous patch (make CDCHost demo deallocate pipes when an invalid CDC interface is skipped).
Remove the saving of the USB_GetNextDescriptorComp() return value in all host demos, since it went unused anyway; replaced with a simple check against the success error code for clarity.
2009-05-15 08:02:30 +00:00
Dean Camera fabfdd454a Fixed CDCHost not clearing configured endpoints and resetting configured endpoints mask when a partially enumerated invalid CDC interface is skipped. 2009-05-15 07:38:35 +00:00
Dean Camera 32f0f605ef Removed all user pipe/endpoint interrupt APIs, added internal library support for interrupt driven control endpoints when in device mode by defining INTERRUPT_CONTROL_ENDPOINT token and passing it to the compiler via the -D switch. 2009-05-14 10:07:08 +00:00
Dean Camera 4904b10ef6 Moved USB Host state machine code out from USBTask.c and into Host.c, where it more properly belongs. 2009-05-13 14:13:57 +00:00
Dean Camera da007db18d Remove remainder of data pipe interrupt management code from the host demos. 2009-05-12 12:59:57 +00:00
Dean Camera 958a1b4e2b Fixed Mouse and Keyboard device demos not acting in accordance with the HID specification for idle periods (thanks to Brian Dickman).
Removed support for endpoint/pipe non-control interrupts; these did not act in the way users expected, and had many subtle issues.
2009-05-12 08:28:02 +00:00
Dean Camera ea74397095 Fixed RNDISEthernet not working under Linux due to Linux requiring an "optional" request which was unhandled. 2009-05-11 08:58:53 +00:00
Dean Camera e0985b9950 Fixed bug in RNDISEthernet and DualCDC demos not using the correct USB_ControlRequest structure for control request data.
Fixed documentation showing incorrect USB mode support on the supported AVRs list.
2009-05-11 07:52:13 +00:00
Dean Camera 3f48497874 Fix broken Set Feature/Clear Feature chapter 9 request (incorrect status stage clearing).
Commit for the 090510 release.
2009-05-10 05:23:35 +00:00
Dean Camera 1f83abe6f4 Renamed the the TotalHIDReports element of the HID descriptor structure in the HID class demos to TotalReportDescriptors, to be more accurate of the element's function (thanks to Brian Dickman). 2009-05-07 22:33:36 +00:00
Dean Camera 938f86d063 Fix build errors in Joystick device demo and library LEDs driver (on *nix systems). 2009-05-07 06:33:07 +00:00
Dean Camera a908773a13 Change device demos to cache the board button values in the same manner as the board joystick to maintain consistency. 2009-05-06 12:43:00 +00:00
Dean Camera 63a8f66d92 Changed HWB board driver to Buttons driver, to allow for the support of future boards with more than one mounted GPIO button. 2009-05-06 07:50:34 +00:00
Dean Camera 253deb996f Changed PIPE_CONTROLPIPE_DEFAULT_SIZE from 8 to 64 to try to prevent problems with faulty devices which do not respect the given wLength value when reading in the device descriptor.
Further documentation improvements - removed file view from the main library documentation, replaced file references in the documentation with group references.
2009-05-04 12:55:00 +00:00
Dean Camera edcfaf7716 Fix build errors in host demos due to usage of pipe error codes which have now been renamed. 2009-05-03 14:34:20 +00:00
Dean Camera 01c4bef107 More minor renaming of library enums and events to try to create a consistent API. 2009-05-03 14:17:24 +00:00
Dean Camera f05224ec46 Fix minor build errors. 2009-05-01 05:20:23 +00:00
Dean Camera 58e42c6ca9 Fixed SPI driver init function not clearing SPI2X bit when not needed.
Fixed PREVENT ALLOW MEDIUM REMOVAL command issuing in the MassStorageHost demo using incorrect parameters (thanks to Mike Alex).

Fixed MassStorageHost demo broken due to an incorrect if statement test in MassStore_GetReturnedStatus().
2009-04-26 10:29:59 +00:00
Dean Camera a504a3a010 Endpoint configuration is now refined to give better output when all configurations have static inputs - removed the now useless STATIC_ENDPOINT_CONFIGURATION compile time token. 2009-04-24 07:28:51 +00:00
Dean Camera c20a94a4e8 Fixed USB_RemoteWakeupEnabled flag never being set (the REMOTE WAKEUP Set Feature request was not being handled).
Renamed the FEATURELESS_CONTROL_ONLY_DEVICE compile-time token to CONTROL_ONLY_DEVICE.
2009-04-23 13:28:12 +00:00
Dean Camera 9cec85bfd9 Documentation enhancements to improve documentation cross-references. 2009-04-22 14:28:55 +00:00
Dean Camera 6865a7bc09 Applied STATIC_ENDPOINT_CONFIGURATION and FIXED_CONTROL_SIZE tokens to all Device mode demos to reduce binary size. 2009-04-22 13:30:03 +00:00
Dean Camera d860e9e842 USB_HostRequest renamed to USB_ControlRequest, entire control request header is now read into USB_ControlRequest in Device mode rather than having the library pass only partially read header data to the application.
The USB_UnhandledControlPacket event has had its parameters removed, in favour of accessing the new USB_ControlRequest structure.

The Endpoint control stream functions now correctly send a ZLP to the host when less data than requested is sent.
2009-04-22 13:03:11 +00:00
Dean Camera e5e7eaee7a Removed specialized Endpoint_ClearControl* and Pipe_ClearControl* macros in favour of the standard Endpoint_Clear* and Pipe_Clear* macros (Atmel have confirmed no effect from setting FIFOCON on control endpoints). 2009-04-21 06:05:50 +00:00
Dean Camera ba7cd3f22e Fix errors in the KeyboardHost demo which prevented correct compilation. 2009-04-20 13:24:25 +00:00
Dean Camera 37b2130fb2 Changed over all deprecated GCC structure tag initializers to the standardized C99 format (thanks to Mike Alexander). 2009-04-20 11:21:36 +00:00
Dean Camera 619b0b7b6b Spell checked non-source documentation pages. 2009-04-19 14:29:57 +00:00
Dean Camera 663f449c10 Fixed incorrect HID interface class and subclass values in the Mouse and KeyboardMouse demos (thanks to Brian Dickman).
Capitolised the "Descriptor_Search" and "Descriptor_Search_Comp" prefixes of the values in the DSearch_Return_ErrorCodes_t and DSearch_Comp_Return_ErrorCodes_t enums.

Minor documentation improvements.
2009-04-19 11:43:21 +00:00
Dean Camera 32e735b2b2 Removed "Host_" section of the function names in ConfigDescriptor.h, as most of the routines can now be used in device mode on the device descriptor.
Renamed functions in the HID parser to have a "USB_" prefix and the acronym "HID" in the name.

Further module-level documentation updates.
2009-04-17 08:33:53 +00:00
Dean Camera d38fa49cb6 More documentation changes for better module-level documentation rather than file-level documentation. 2009-04-17 05:04:21 +00:00
Dean Camera 6380d057f8 Fixed CDC and USBtoSerial demos freezing where buffers were full while still transmitting or receiving (thanks to Peter Hand). 2009-04-17 04:10:30 +00:00
Dean Camera 11bb2f2172 Renamed Serial_Stream driver to SerialStream to remain consistent with the rest of the library's naming scheme for files. 2009-04-17 00:20:00 +00:00
Dean Camera 1c16ae399a Partial commit: change references to Drivers/AT90USBXXX to Drivers/Peripheral. 2009-04-16 23:59:14 +00:00
Dean Camera 8f6b4ddf76 Fixed GenericHIDHost demo report write routine incorrect for control type requests (thanks to Andrei Krainev).
Removed Endpoint_ClearCurrentBank() and Pipe_ClearCurrentBank() in favour of new Endpoint_ClearIN(), Endpoint_ClearOUT(), Endpoint_ClearControlIN(), Endpoint_ClearControlOUT(), Pipe_ClearIN(), Pipe_ClearOUT(), Pipe_ClearControlIN() and Pipe_ClearControlOUT() macros (done to allow for the detection of packets of zero length).

Renamed *_ReadWriteAllowed() macros to *_IsReadWriteAllowed() to remain consistent with the rest of the LUFA API.

Endpoint_IsSetupReceived() macro has been renamed to Endpoint_IsSETUPReceived(), Endpoint_ClearSetupReceived() macro has been renamed to Endpoint_ClearControlSETUP(), the Pipe_IsSetupSent() macro has been renamed to Pipe_IsSETUPSent() and the Pipe_ClearSetupSent() macro is no longer applicable and should be removed - changes made to compliment the new endpoint and pipe bank management API.

Updated all demos, bootloaders and projects to use the new endpoint and pipe management APIs (thanks to Roman Thiel).

Updated library doxygen documentation, added groups, changed documentation macro functions to real functions for clarity.

Removed old endpoint and pipe aliased read/write/discard routines which did not have an explicit endian specifier for clarity.

Removed the ButtLoadTag.h header file, as no one used for its intended purpose anyway.
2009-04-16 08:50:34 +00:00
Dean Camera ef06bfd1c0 Fixed minor issue with the RNDISEthernet demo DHCP protocol decoder routine using incorrectly named variables (thanks to Jonathan Oakley).
Fixed GenericHIDHost demo report write routine incorrect for control type requests (thanks to Andrei).
2009-04-15 00:56:12 +00:00
Dean Camera ecaf872177 Corrected AudioInput and AudioOutput demos, to fix endpoint underflows due to rounding in the sample reload timer. 2009-04-14 12:07:41 +00:00
Dean Camera 6a5a37d7d1 The USB_Host_SendControlRequest() function no longer automatically selects the Control pipe (pipe 0), so that other control type pipes can be used with the function.
The USB Host management task now saves and restores the currently selected pipe before and after the task completes.
2009-04-14 08:35:47 +00:00
Dean Camera fea5d08512 Adjusted sample CTC timer calculations in the AudioOutput and AudioInput demos to account for situations where the division results in a value with no remainder, requiring one to be subtracted from the result (thanks to Robin Theunis). 2009-04-14 08:17:24 +00:00
Dean Camera af02b5b0c9 Fixed RNDISEthenet demo checking the incorrect message field for packet size constraints (thanks to Jonathan).
Fixed WriteNextReport code in the GenericHIDHost demo using incorrect parameter types and not selecting the correct endpoint.
2009-04-13 06:58:46 +00:00
Dean Camera d3484e6bdd Fixed GenericHID demo not starting USB and HID management tasks when not using interrupt driven modes (thanks to Carl Kjeldsen). 2009-04-09 00:00:59 +00:00
Dean Camera 51910b4505 Added support to the CDCHost demo for devices with mutiple CDC interfaces which are not the correct ACM type preceeding the desired ACM CDC interface. 2009-04-07 11:46:54 +00:00
Dean Camera cb7884da50 Added preprocessor checks and documentation to the bootloaders giving information about missing SIGNATURE_x defines due to outdated avr-libc versions. 2009-04-07 04:19:57 +00:00
Dean Camera 01d388f293 Add call to MassStore_WaitForDataReceived() in MassStore_GetReturnedStatus() to ensure that the CSW has been received in the extended MSC timeout period before continuing, to prevent long processing delays from causing the MassStore_GetReturnedStatus() to early-abort. 2009-04-05 04:05:07 +00:00
Dean Camera 58f550dfb3 Added new PIMA_DATA_SIZE() define to the Still Image Host demo. 2009-04-02 10:13:12 +00:00
Dean Camera 6933f2e1a5 All comments in the library, bootloaders, demos and projects have now been spell-checked and spelling mistakes/typos corrected. 2009-04-01 13:53:58 +00:00
Dean Camera ece9e3d599 Changed GenericHID device demo to use the LUFA scheduler, added INTERRUPT_DATA_ENDPOINT and INTERRUPT_CONTROL_ENDPOINT compile time options. 2009-04-01 07:43:50 +00:00
Dean Camera 6198289b38 Added new GenericHIDHost demo.
Corrections to the KeyboardHost and MouseHost demos' pipe handling to freeze and unfreeze the data pipes at the point of use.
2009-04-01 07:21:45 +00:00
Dean Camera 74496a947e Fixed incorrect defined in Version.h.
Fixed Still Image Host SImage_SendData() function not clearing the pipe bank after sending data.
2009-04-01 05:38:43 +00:00
Dean Camera dc83f73ca3 Added new GenericHID device demo application. 2009-03-29 12:42:25 +00:00
Dean Camera ca641bba83 Corrected bitfields -- the smallest datatype required for each bitfield is now used, rather than relying on GCC to truncate unused bytes in bitfields (thanks to Walt Sacuta). 2009-03-26 03:22:02 +00:00
Dean Camera 7cca7eb53d Added missing documentation for AUDIO_SAMPLE_FREQUENCY configuration option in the audio device demos. 2009-03-25 10:51:24 +00:00
Dean Camera 350141e085 Fixed CDC demo not sending an empty packet after each transfer to prevent the host from buffering incomming data.
Altered Project and Bootloader makefiles so that the path to the LUFA library can be set in one place.
2009-03-23 05:43:49 +00:00
Dean Camera ed031c1df2 Seperated out OTG, Device and Host mode demos into seperate folders for clarity. Adjusted makefiles so that the path to the LUFA library can be set in one place. 2009-03-20 06:34:41 +00:00
Dean Camera ecf7538430 Combined Keyboad and Mouse normal and interrupt driven host demos into unified Keyboard and Mouse host demos. 2009-03-20 05:39:15 +00:00
Dean Camera ee7bd5685e Ensure that the Keyboard and Mouse demos adhere to the boot protocol specification in that they send a report before the idle period has elapsed if the report data has changed. 2009-03-19 15:10:51 +00:00
Dean Camera 7184153e5d Corrections to Keyboard and Mouse combined demos so that all modes (normal, interrupt, fully interrupt) work correctly. 2009-03-19 15:01:57 +00:00
Dean Camera 3ab07f0d93 Remove now redundant MouseViaInt and MouseFullInt demos. 2009-03-19 14:17:16 +00:00
Dean Camera 88051e78a2 Combined Mouse, MouseViaInt and MouseFullInt demos into a single unified demo.
Corrections to Keyboard demo.

Removed AVRISP_Programmer project due to code quality concerns.
2009-03-19 14:16:12 +00:00
Dean Camera 48400df13c Combined Keyboard, KeyboardViaInt and KeyboardFullInt demos into a single unified demo. 2009-03-19 13:19:12 +00:00
Dean Camera ceb68a0640 Corrected CDC class bootloader to fix a few bugs, changed address counter to store x2 addresses for convenience. 2009-03-17 13:56:26 +00:00
Dean Camera 904ad3abd2 Incomplete non-functional BluetoothHost demo removed until it has reached a stable state to prevent confusion. 2009-03-17 12:58:15 +00:00
Dean Camera 14c5615474 Added DataflashManager_WriteBlocks_RAM() and DataflashManager_ReadBlocks_RAM() functions to the MassStorage demo, to allow for easy interfacing with a FAT library for dataflash file level access. 2009-03-17 10:45:32 +00:00
Dean Camera e611b250c1 Added extra output to makefiles to indicate the currently selected BOARD parameter. 2009-03-16 11:29:00 +00:00
Dean Camera 3803976534 Fixed incorrect/missing control status stage transfers on demos, bootloaders and applications (thanks to Nate Lawson). 2009-03-10 05:56:17 +00:00
Dean Camera 4a09da2098 Removed SetSystemClockPrescaler() macro, the clock_prescale_set() avr-libc macro has been corrected in recent avr-libc versions 2009-03-09 12:28:50 +00:00
Dean Camera b0d9f961ac Fixed interrupt driven HID device demos not clearing the interrupt flags in all circumstances. 2009-03-09 11:50:43 +00:00
Dean Camera 7e7124e40b Updated makefiles to reflect new dfu-ee programming target invocations (supplied by Opendous, Inc.).
Renamed the ATTR_ALWAYSINLINE function attribute macro to ATTR_ALWAYS_INLINE to match the style of the other function attribute macro names.

Added ATTR_ALWAYS_INLINE attribute to several inlined library functions, to ensure they are inlined in all circumstances.

Cleanups to Endpoint.h and Pipe.h. Added better documentation for the endpoint and pipe interrupts.
2009-03-04 08:03:13 +00:00
Dean Camera ea7039a0cc Changed stream wait timeout counter to be 16-bit, so that very long timeout periods can be set for correct communications with badly designed hosts or devices which greatly exceed the USB specification limits.
Mass Storage Host demo now uses a USB_STREAM_TIMEOUT_MS of two seconds to maintain compatibility with poorly designed devices.
2009-03-03 08:19:06 +00:00
Dean Camera 99145a8d7c Makefiles and library modified to add a new F_CLOCK constant to give the unprescaled master input clock frequency, so that the correct PLL mask can be determined even when the CPU (F_CPU) clock rate is prescaled outside the normal input range of the PLL.
Started to clean up the AVRISP Programmer project code, donated by Opendous Inc.
2009-02-26 05:48:47 +00:00
Dean Camera fa456ce531 USBtoSerial demo now discards all Rx data when not connected to a USB host, rather than buffering characters for transmission next time the device is attached to a host. 2009-02-23 09:30:29 +00:00
Dean Camera 9991321321 Moved all source to the trunk directory. 2009-02-23 07:08:17 +00:00