aboutsummaryrefslogtreecommitdiff
path: root/LUFA/Drivers/USB/LowLevel/Endpoint.c
AgeCommit message (Collapse)Author
2011-02-19Initial restructuring of the core USB driver module to support multiple ↵Dean
architectures in the future. git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@1672 d5102386-fcda-11dd-9fdb-3debd5008f28
2011-01-10Call USB_USBTask() in the Endpoint stream functions between packets if ↵Dean
INTERRUPT_CONTROL_ENDPOINT is not set. Remove calls to USB_USBTask in the Mass Storage class driver stream read/write continuation checks, since this is now done inside the stream function. git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@1629 d5102386-fcda-11dd-9fdb-3debd5008f28
2011-01-10Altered all endpoint/pipe stream transfers so that the new BytesProcessed ↵Dean
parameter now points to a location where the number of bytes in the transfer that have been completed can be stored (or NULL if entire transaction should be performed in one chunk). Added new Endpoint_Null_Stream() and Pipe_Null_stream() functions. Removed the NO_STREAM_CALLBACKS compile time option due to the new partial stream transfer feature replacing it. Fixed errors in the incomplete Test and Measurement device demo preventing proper operation (thanks to Pavel Plotnikov). git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@1628 d5102386-fcda-11dd-9fdb-3debd5008f28
2011-01-01Update copyright year on all source files.Dean
git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@1622 d5102386-fcda-11dd-9fdb-3debd5008f28
2010-12-24Much more efficient algorithm for the Endpoint/Pipe configuration routine of ↵Dean
unordered endpoints/pipes - only reconfigure the endpoints and pipes above the newly configured endpoint/pipe, and don't cache existing endpoint/pipe configuration before use to save SRAM. git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@1611 d5102386-fcda-11dd-9fdb-3debd5008f28
2010-12-24Re-add in old Endpoint/Pipe workaround for unordered pipes - add new ↵Dean
ORDERED_EP_CONFIG compile time option to override the workaround and use the previous behaviour that imposes correct Endpoint/Pipe ordering but produces smaller compiled code. git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@1608 d5102386-fcda-11dd-9fdb-3debd5008f28
2010-10-28Changed over www.fourwalledcubicle.com links to the new www.lufa-lib.org ↵Dean
redirect domain, including the new aliased links for LUFA-related pages such as the various download/source control mirrors and support lists. git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@1541 d5102386-fcda-11dd-9fdb-3debd5008f28
2010-10-13Clean up excessive whitespace at the end of each line using the wspurify ↵Dean
tool made by Laszlo Monda git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@1524 d5102386-fcda-11dd-9fdb-3debd5008f28
2010-10-06Cache the USB_DeviceState variable internally in the library core when ↵Dean
multiple checks are required in a single loop iteration, to reduce compiled code size. git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@1513 d5102386-fcda-11dd-9fdb-3debd5008f28
2010-09-30Reverted Endpoint/Pipe non-sequential configuration hack, placed restriction ↵Dean
on the configuration order instead to ensure maximum reliability. Altered all low level device and host mode demos to ensure that endpoints and pipes are configured in ascending order properly. Rewrote all low level host mode demos' configuration descriptor parser code to ensure that pipes are enumerated in ascending order, and to ensure maximum compatibility with devices. Incremented all device mode demo's device descriptor revision numbers to ensure that any descriptor changes are re-fetched on machines which have enumerated previous versions. git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@1502 d5102386-fcda-11dd-9fdb-3debd5008f28
2010-09-07Must save and restore the endpoint/pipe interrupt enable flags during ↵Dean
reconfiguration of all endpoints/pipes in the Endpoint_ConfigureEndpoint() and Pipe_ConfigurePipe() routines. git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@1465 d5102386-fcda-11dd-9fdb-3debd5008f28
2010-09-05Added new USB_Device_GetFrameNumber() and USB_Host_GetFrameNumber() ↵Dean
functions to retrieve the current USB frame number. Added new USB_Host_EnableSOFEvents(), USB_Host_DisableSOFEvents() and EVENT_USB_Host_StartOfFrame() for the user application handling of USB Start of Frame events while in USB Host mode. Changed over all demos, drivers and internal functions to use the current frame number over the Start of Frame flag where possible to free up the Start of Frame flag for interrupt use in the user application. git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@1463 d5102386-fcda-11dd-9fdb-3debd5008f28
2010-08-22Optimise Endpoint_ConfigureEndpoint_Prv() function to produce smaller code ↵Dean
when CONTROL_ONLY_DEVICE compile time token is defined. git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@1450 d5102386-fcda-11dd-9fdb-3debd5008f28
2010-08-22Split out endpoint and pipe stream functions into new EndpointStream.c/.h ↵Dean
and PipeStream.c/.h files. git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@1449 d5102386-fcda-11dd-9fdb-3debd5008f28
2010-08-22Added compile time error to the AVRISP-MKII project when built for the U4 ↵Dean
chips, as the default VTARGET detection ADC channel does not exist on these chips (thanks to Marco). git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@1446 d5102386-fcda-11dd-9fdb-3debd5008f28
2010-08-20Fixed critical pipe/endpoint memory allocation issue where the bank memory ↵Dean
address space could be silently overlapped in the USB controller if the endpoints or pipes were allocated in anything other than ascending order (thanks to Martin Degelsegger). git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@1443 d5102386-fcda-11dd-9fdb-3debd5008f28
2010-08-09Removed complicated logic for the Endpoint_ConfigureEndpoint() function to ↵Dean
use inlined or function called versions depending of if the given bank size is a compile time constant, as the compiler does a better job of optimizing with basic code. Changed over all device demos to use a clearer algorithm for the configuring of the application's endpoints. git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@1438 d5102386-fcda-11dd-9fdb-3debd5008f28
2010-07-21Add missing const qualifiers to class drivers.Dean
Indent core library function parameters so that there is only one parameter per line, to increase readability. git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@1398 d5102386-fcda-11dd-9fdb-3debd5008f28
2010-07-15Removed the automated checking of event names in the demo, project and ↵Dean
bootloader makefiles due to inconsistancies between the behaviour of the command line tools used to perform the check on each platform. Removed the internal endpoint and pipe memory allocation macros, as this is already performed directly in the code. Simplify the endpoint and pipe reset procedure. git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@1391 d5102386-fcda-11dd-9fdb-3debd5008f28
2010-06-12Speed up calls to Pipe_IsPipeBound() by immediately skipping unconfigured ↵Dean
pipes, rather than performing token check first. git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@1328 d5102386-fcda-11dd-9fdb-3debd5008f28
2010-05-26The EEPROM stream read/write functions now use eeprom_update_byte() instead ↵Dean
of eeprom_write_byte(), so that only changed bytes are written to EEPROM to preserve its lifespan. Changed over the AVRISP-MKII and TemperatureDataLogger projects to use eeprom_update_byte() when writing non-volatile parameters to EEPROM to preserve its lifespan. git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@1283 d5102386-fcda-11dd-9fdb-3debd5008f28
2010-05-08Add svn:eol-style property to source files, so that the line endings are ↵Dean
correctly converted to the target system's native end of line style. git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@1248 d5102386-fcda-11dd-9fdb-3debd5008f28
2010-05-03Added new ENDPOINT_*_BusSuspended error code to the Endpoint function, so ↵Dean
that the stream functions early-abort if the bus is suspended before or during a transfer. git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@1230 d5102386-fcda-11dd-9fdb-3debd5008f28
2010-02-24Revert changes made for the partial port to the AVR32 architecture.Dean
git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@1155 d5102386-fcda-11dd-9fdb-3debd5008f28
2010-02-23More porting of the USB core to the AVR32.Dean
git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@1153 d5102386-fcda-11dd-9fdb-3debd5008f28
2010-02-23Start porting the USB core to the AVR32 UC3B.Dean
git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@1152 d5102386-fcda-11dd-9fdb-3debd5008f28
2010-02-11Add more include protection macros to give the user warnings when they try ↵Dean
to manually include private driver header files, instead of the public driver headers. git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@1123 d5102386-fcda-11dd-9fdb-3debd5008f28
2009-12-30Update copyright year to 2010.Dean
git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@1032 d5102386-fcda-11dd-9fdb-3debd5008f28
2009-12-28Fix MIT license language to make its intent clearer.Dean
git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@1019 d5102386-fcda-11dd-9fdb-3debd5008f28
2009-12-21Ensure that unsupported SetFeature/ClearFeature request targets cause a ↵Dean
STALL back to the host. git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@997 d5102386-fcda-11dd-9fdb-3debd5008f28
2009-12-17Un-inline the SendAddress function in NVMTarget.c/.h of the AVRISP project.Dean
Add new HotmailNotifier project, which changes a LED's colour based on the user's unread email count as sent from Windows Live Messenger. git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@984 d5102386-fcda-11dd-9fdb-3debd5008f28
2009-11-10Update CDC Class Driver character stream functions to use the correct ↵Dean
avr-libc return codes for errors and EOF. Fix pointer arithmetic on void byte buffers by explicitly typecasting the buffer pointers to uint8_t* before altering them. git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@891 d5102386-fcda-11dd-9fdb-3debd5008f28
2009-10-18Moved USBtoSerial demo the Projects directory, as it is simply an expanded ↵Dean
CDC demo. Added const qualifier to Endpoint/Pipe stream write routines. git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@868 d5102386-fcda-11dd-9fdb-3debd5008f28
2009-08-05Make Control Endpoint stream transfers more reliable by adding in early ↵Dean
aborts for unexpected new SETUP tokens, or unexpected status stage during control stream writes. Fix corruption in Device RNDIS demos TCP stack when too many connections attempted simultaneously, freezing the device when a page was re-fetched before the first connection was closed. Fix incorrect model compatibility information in the Host LowLevel demo overview text files. git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@722 d5102386-fcda-11dd-9fdb-3debd5008f28
2009-07-21Added new USB_DeviceState variable to keep track of the current Device mode ↵Dean
USB state. Added new Endpoint_ClearStatusStage() convenience function to assist with the status stages of control transfers. Removed vague USB_IsConnected global - test USB_DeviceState or USB_HostState explicitly to gain previous functionality. Removed USB_IsSuspended global - test USB_DeviceState against DEVICE_STATE_Suspended instead. Fixed possible enumeration errors from spinloops which may fail to exit if the USB connection is severed before the exit condition becomes true. git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@676 d5102386-fcda-11dd-9fdb-3debd5008f28
2009-07-13Added new EEPROM and FLASH buffer versions of the Endpoint and Pipe stream ↵Dean
functions. Changed Endpoint.c and Pipe.c to use a templated system to build the seperate functions, rather than duplicating each function's code many times. git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@644 d5102386-fcda-11dd-9fdb-3debd5008f28
2009-06-28Added const modifiers to device mode class drivers.Dean
Added parameter directions to function parameter documentation. Added new experimental FAST_STREAM_FUNCTIONS compile time option to speed up stream transfers at the expense of a higher FLASH consumption (needs testing to verify improved throughput). git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@636 d5102386-fcda-11dd-9fdb-3debd5008f28
2009-06-14Changed per-device controller preprocessor checks over to per-device series ↵Dean
for better device control. Fixed error in Endpoint.c using HSOFI rather than SOFI for counting elapsed milliseconds. git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@592 d5102386-fcda-11dd-9fdb-3debd5008f28
2009-06-08Converted Host mode demos to schedulerless. Fixed host mode broken due to ↵Dean
earlier Start-of-frame event experiments. git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@580 d5102386-fcda-11dd-9fdb-3debd5008f28
2009-06-01Commit of new class abstraction APIs for all device demos other than the ↵Dean
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. git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@562 d5102386-fcda-11dd-9fdb-3debd5008f28
2009-05-15Create a new function pointer type in StreamCallbacks.h for endpoint/pipe ↵Dean
stream callbacks, to make stream function prototypes clearer. git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@552 d5102386-fcda-11dd-9fdb-3debd5008f28
2009-05-03More minor renaming of library enums and events to try to create a ↵Dean
consistent API. git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@530 d5102386-fcda-11dd-9fdb-3debd5008f28
2009-05-02Fixed Endpoint_Write_Control_* functions writing more data than expected by ↵Dean
the host, causing it to panic (thanks to Johannes Raschke). git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@529 d5102386-fcda-11dd-9fdb-3debd5008f28
2009-04-26Move the length decrements in the pipe and endpoint stream functions to the ↵Dean
point at which the buffers are operated on, to prevent decrements during iterations where no data is exchanged (thanks to Francisco Moraes). git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@525 d5102386-fcda-11dd-9fdb-3debd5008f28
2009-04-24Endpoint configuration is now refined to give better output when all ↵Dean
configurations have static inputs - removed the now useless STATIC_ENDPOINT_CONFIGURATION compile time token. git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@524 d5102386-fcda-11dd-9fdb-3debd5008f28
2009-04-23Fixed USB_RemoteWakeupEnabled flag never being set (the REMOTE WAKEUP Set ↵Dean
Feature request was not being handled). Renamed the FEATURELESS_CONTROL_ONLY_DEVICE compile-time token to CONTROL_ONLY_DEVICE. git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@523 d5102386-fcda-11dd-9fdb-3debd5008f28
2009-04-22USB_HostRequest renamed to USB_ControlRequest, entire control request header ↵Dean
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. git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@520 d5102386-fcda-11dd-9fdb-3debd5008f28
2009-04-21Removed specialized Endpoint_ClearControl* and Pipe_ClearControl* macros in ↵Dean
favour of the standard Endpoint_Clear* and Pipe_Clear* macros (Atmel have confirmed no effect from setting FIFOCON on control endpoints). git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@519 d5102386-fcda-11dd-9fdb-3debd5008f28
2009-04-16Fixed GenericHIDHost demo report write routine incorrect for control type ↵Dean
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. git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@507 d5102386-fcda-11dd-9fdb-3debd5008f28
2009-04-05Move StdRequestType.h, StreamCallbacks.h, USBMode.h from the LowLevel USB ↵Dean
driver directory to the HighLevel USB driver directory, where they are more suited. git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@495 d5102386-fcda-11dd-9fdb-3debd5008f28