All comments in the library, bootloaders, demos and projects have now been spell-checked and spelling mistakes/typos corrected.
This commit is contained in:
parent
fb3fcb968e
commit
6933f2e1a5
95 changed files with 274 additions and 273 deletions
|
|
@ -68,7 +68,7 @@
|
|||
#error The selected board does not contain a HWB.
|
||||
#endif
|
||||
|
||||
/* Psudo-Functions for Doxygen: */
|
||||
/* Pseudo-Functions for Doxygen: */
|
||||
#if defined(__DOXYGEN__)
|
||||
/** Initializes the HWB driver, so that the current button position can be read. This sets the appropriate
|
||||
* I/O pin to an input with pull-up enabled.
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@
|
|||
#error The selected board does not contain a joystick.
|
||||
#endif
|
||||
|
||||
/* Psudo-Functions for Doxygen: */
|
||||
/* Pseudo-Functions for Doxygen: */
|
||||
#if defined(__DOXYGEN__)
|
||||
/** Initializes the joystick driver so that the joystick position can be read. This sets the appropriate
|
||||
* I/O pins to inputs with their pull-ups enabled.
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@
|
|||
#include "Board/LEDs.h"
|
||||
#endif
|
||||
|
||||
/* Psudo-Functions for Doxygen: */
|
||||
/* Pseudo-Functions for Doxygen: */
|
||||
#if defined(__DOXYGEN__)
|
||||
/** Initializes the board LED driver so that the LEDs can be controlled. This sets the appropriate port
|
||||
* I/O pins as outputs, and sets the LEDs to default to off.
|
||||
|
|
|
|||
|
|
@ -72,16 +72,16 @@
|
|||
/** Initializes the temperature sensor driver, including setting up the appropriate ADC channel.
|
||||
* This must be called before any other temperature sensor routines.
|
||||
*
|
||||
* The ADC itself (not the ADC channel) must be configured seperately before calling the temperature
|
||||
* The ADC itself (not the ADC channel) must be configured separately before calling the temperature
|
||||
* sensor functions.
|
||||
*/
|
||||
#define Temperature_Init() ADC_SetupChannel(TEMP_ADC_CHANNEL);
|
||||
|
||||
/* Function Prototypes: */
|
||||
/** Performs a complete ADC on the temperature sensor channel, and converts the result into a
|
||||
* valid temperature between TEMP_MIN_TEMP and TEMP_MAX_TEMP in degrees Celcius.
|
||||
* valid temperature between TEMP_MIN_TEMP and TEMP_MAX_TEMP in degrees Celsius.
|
||||
*
|
||||
* \return Signed temperature in degrees Celcius
|
||||
* \return Signed temperature in degrees Celsius
|
||||
*/
|
||||
int8_t Temperature_GetTemperature(void) ATTR_WARN_UNUSED_RESULT;
|
||||
|
||||
|
|
|
|||
|
|
@ -97,13 +97,13 @@
|
|||
#define DESCRIPTOR_SIZE(DescriptorPtr) DESCRIPTOR_CAST(DescriptorPtr, USB_Descriptor_Header_t).bLength
|
||||
#endif
|
||||
|
||||
/** Creates a prototype for or begins a descriptor comparitor routine. Descriptor comparitor routines are
|
||||
/** Creates a prototype for or begins a descriptor comparator routine. Descriptor comparator routines are
|
||||
* small search routines which are passed a pointer to the current sub descriptor in the configuration
|
||||
* descriptor, and which analyse the sub descriptor to determine whether or not it matches the routine's
|
||||
* search parameters. Comparitor routines provide a powerful way to scan through the config descriptor
|
||||
* search parameters. Comparator routines provide a powerful way to scan through the config descriptor
|
||||
* for certain descriptors matching unique criteria.
|
||||
*
|
||||
* Comparitor routines are passed in a single pointer named CurrentDescriptor, and should return a value
|
||||
* Comparator routines are passed in a single pointer named CurrentDescriptor, and should return a value
|
||||
* of a member of the DSEARCH_Return_ErrorCodes_t enum.
|
||||
*/
|
||||
#define DESCRIPTOR_COMPARATOR(name) uint8_t DCOMP_##name (void* const CurrentDescriptor)
|
||||
|
|
@ -117,7 +117,7 @@
|
|||
*
|
||||
* \param DSize Pointer to an int storing the remaining bytes in the configuration descriptor
|
||||
* \param DPos Pointer to the current position in the configuration descriptor
|
||||
* \param DSearch Name of the comparitor search function to use on the configuration descriptor
|
||||
* \param DSearch Name of the comparator search function to use on the configuration descriptor
|
||||
*
|
||||
* \return Value of one of the members of the DSEARCH_Comp_Return_ErrorCodes_t enum
|
||||
*
|
||||
|
|
@ -156,7 +156,7 @@
|
|||
/** Enum for return values of USB_Host_GetNextDescriptorComp() */
|
||||
enum DSEARCH_Comp_Return_ErrorCodes_t
|
||||
{
|
||||
Descriptor_Search_Comp_Found = 0, /**< Configuration descriptor now points to decriptor which matches
|
||||
Descriptor_Search_Comp_Found = 0, /**< Configuration descriptor now points to descriptor which matches
|
||||
* search criteria of the given comparator function. */
|
||||
Descriptor_Search_Comp_Fail = 1, /**< Comparator function returned Descriptor_Search_Fail. */
|
||||
Descriptor_Search_Comp_EndOfDescriptor = 2, /**< End of configuration descriptor reached before match found. */
|
||||
|
|
|
|||
|
|
@ -220,7 +220,7 @@
|
|||
bool GetReportItemInfo(const uint8_t* ReportData, HID_ReportItem_t* const ReportItem)
|
||||
ATTR_NON_NULL_PTR_ARG(1, 2);
|
||||
|
||||
/** Retreives the given report item's value out of the Value member of the report item's
|
||||
/** Retrieves the given report item's value out of the Value member of the report item's
|
||||
* HID_ReportItem_t structure and places it into the correct position in the HID report
|
||||
* buffer. The report buffer is assumed to have the appropriate bits cleared before calling
|
||||
* this function (i.e., the buffer should be explicitly cleared before report values are added).
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@
|
|||
/** HID_ReportItem_t.ItemFlags flag for buffered bytes. */
|
||||
#define IOF_BUFFEREDBYTES (1 << 8)
|
||||
|
||||
/** HID_ReportItem_t.ItemFlags flag for bitfield data. */
|
||||
/** HID_ReportItem_t.ItemFlags flag for bit field data. */
|
||||
#define IOF_BITFIELD (0 << 8)
|
||||
|
||||
/* Private Interface - For use in library only: */
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@
|
|||
/* Macros: */
|
||||
/** Raises a given event name, with the specified parameters. For events with no parameters the
|
||||
* only argument to the macro is the event name, events with parameters list the parameter values
|
||||
* after the name as a comma seperated list.
|
||||
* after the name as a comma separated list.
|
||||
*
|
||||
* When a given event is fired, its corresponding event handler code is executed.
|
||||
*
|
||||
|
|
@ -75,7 +75,7 @@
|
|||
*/
|
||||
#define RAISE_EVENT(e, ...) Event_ ## e (__VA_ARGS__)
|
||||
|
||||
/** Indicates that a given module can raise a given event. This is the equivelent of putting the
|
||||
/** Indicates that a given module can raise a given event. This is the equivalent of putting the
|
||||
* event function's prototype into the module, but in a cleaner way. Each event which may be
|
||||
* fired via the RAISE_EVENT macro in the module should have an accompanying RAISES_EVENT
|
||||
* prototype in the module's header file.
|
||||
|
|
@ -100,7 +100,7 @@
|
|||
*
|
||||
* Only one event handler may be defined in any user project for each individual event. Events may
|
||||
* or may not have parameters - for each event, refer to its documentation elsewhere in this module
|
||||
* to determine the presense and purpose of any event parameters.
|
||||
* to determine the presence and purpose of any event parameters.
|
||||
*
|
||||
* Usage Example:
|
||||
* \code
|
||||
|
|
@ -115,7 +115,7 @@
|
|||
*/
|
||||
#define EVENT_HANDLER(e) void Event_ ## e e ## _P
|
||||
|
||||
/** Indicates that a given module handles an event. This is the equivelent of putting the
|
||||
/** Indicates that a given module handles an event. This is the equivalent of putting the
|
||||
* event function's prototype into the module, but in a cleaner way. Each event which may be
|
||||
* handled via the EVENT_HANDLER macro in the module should have an accompanying HANDLES_EVENT
|
||||
* prototype in the module's header file.
|
||||
|
|
@ -136,7 +136,7 @@
|
|||
*/
|
||||
#define HANDLES_EVENT(e) EVENT_HANDLER(e)
|
||||
|
||||
/* Psudo-Functions for Doxygen: */
|
||||
/* Pseudo-Functions for Doxygen: */
|
||||
#if defined(__DOXYGEN__)
|
||||
/** Event for VBUS level change. This event fires when the VBUS line of the USB AVR changes from
|
||||
* high to low or vice-versa.
|
||||
|
|
@ -165,7 +165,7 @@
|
|||
* has been attached (but not yet fully enumerated), or when in device mode and the device is connected
|
||||
* to a host, beginning the enumeration process.
|
||||
*
|
||||
* When in device mode, this can be used to progmatically start the USB management task to reduce
|
||||
* When in device mode, this can be used to programmatically start the USB management task to reduce
|
||||
* CPU usage.
|
||||
*
|
||||
* \note For the smaller USB AVRs (AT90USBXX2) with limited USB controllers, VBUS is not available to the USB controller.
|
||||
|
|
@ -183,7 +183,7 @@
|
|||
* attached and enumerated device has been disconnected, or when in device mode and the device is
|
||||
* disconnected from the host.
|
||||
*
|
||||
* When in device mode, this can be used to progmatically stop the USB management task to reduce
|
||||
* When in device mode, this can be used to programmatically stop the USB management task to reduce
|
||||
* CPU usage.
|
||||
*
|
||||
* \note For the smaller USB AVRs (AT90USBXX2) with limited USB controllers, VBUS is not available to the USB controller.
|
||||
|
|
@ -231,7 +231,7 @@
|
|||
|
||||
/** Event for USB device attachment. This event fires when a the USB interface is in host mode, and
|
||||
* a USB device has been connected to the USB interface. This is interrupt driven, thus fires before
|
||||
* the standard USB_DeviceConnect event and so can be used to programatically start the USB management
|
||||
* the standard USB_DeviceConnect event and so can be used to programmatically start the USB management
|
||||
* task to reduce CPU consumption.
|
||||
*
|
||||
* \note This event only exists on USB AVR models which supports host mode.
|
||||
|
|
@ -245,7 +245,7 @@
|
|||
|
||||
/** Event for USB device removal. This event fires when a the USB interface is in host mode, and
|
||||
* a USB device has been removed the USB interface whether or not it has been enumerated. This
|
||||
* can be used to programatically stop the USB management task to reduce CPU consumption.
|
||||
* can be used to programmatically stop the USB management task to reduce CPU consumption.
|
||||
*
|
||||
* \note This event only exists on USB AVR models which supports host mode.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
/** \file
|
||||
*
|
||||
* Standard USB device descriptor defines and retrieval routines, for USB devices. This module contains
|
||||
* strucutures and macros for the easy creation of standard USB descriptors in USB device projects.
|
||||
* structures and macros for the easy creation of standard USB descriptors in USB device projects.
|
||||
*
|
||||
* All standard descriptors have their elements named in an identical manner to the official USB specification,
|
||||
* however slightly more verbose alternate (non-standard) names are also supplied if the macro
|
||||
|
|
@ -245,7 +245,7 @@
|
|||
uint16_t ReleaseNumber; /**< Product release (version) number. */
|
||||
|
||||
uint8_t ManufacturerStrIndex; /**< String index for the manufacturer's name. The
|
||||
* host will request this string via a seperate
|
||||
* host will request this string via a separate
|
||||
* control request for the string descriptor.
|
||||
*
|
||||
* \note If no string supplied, use NO_DESCRIPTOR.
|
||||
|
|
@ -255,7 +255,7 @@
|
|||
* \see ManufacturerStrIndex structure entry.
|
||||
*/
|
||||
uint8_t SerialNumStrIndex; /**< String index for the product's globally unique hexadecimal
|
||||
* serial number, in uppercase Unicoded ASCII.
|
||||
* serial number, in uppercase Unicode ASCII.
|
||||
*
|
||||
* \see ManufacturerStrIndex structure entry.
|
||||
*/
|
||||
|
|
@ -363,7 +363,7 @@
|
|||
|
||||
/** Type define for a standard interface association descriptor.
|
||||
*
|
||||
* This descriptor has been added as a suppliment to the USB2.0 standard, in the ECN located at
|
||||
* This descriptor has been added as a supplement to the USB2.0 standard, in the ECN located at
|
||||
* <a>http://www.usb.org/developers/docs/InterfaceAssociationDescriptor_ecn.pdf</a>. It allows compound
|
||||
* devices with multiple interfaces related to the same function to have the multiple interfaces bound
|
||||
* together at the point of enumeration, loading one generic driver for all the interfaces in the single
|
||||
|
|
@ -425,7 +425,7 @@
|
|||
* maximum packet size that the endpoint can receive at a time.
|
||||
*/
|
||||
|
||||
uint8_t PollingIntervalMS; /**< Polling interval in milliseconds for the endpont
|
||||
uint8_t PollingIntervalMS; /**< Polling interval in milliseconds for the endpoint
|
||||
* if it is an INTERRUPT or ISOCHRONOUS type.
|
||||
*/
|
||||
#else
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@
|
|||
#define USB_INT_IsEnabled(int) ((USB_INT_GET_EN_REG(int) & USB_INT_GET_EN_MASK(int)) ? true : false)
|
||||
|
||||
/** Returns boolean true if the given interrupt flag is set (i.e. the condition for the interrupt has occurred,
|
||||
* but the interrupt vector is not neccesarily enabled), otherwise returns false.
|
||||
* but the interrupt vector is not necessarily enabled), otherwise returns false.
|
||||
*/
|
||||
#define USB_INT_HasOccurred(int) ((USB_INT_GET_INT_REG(int) & USB_INT_GET_INT_MASK(int)) ? true : false)
|
||||
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@
|
|||
*/
|
||||
extern volatile bool USB_IsConnected;
|
||||
|
||||
/** Indicates if the USB interface is currently initialized but not neccesarily connected to a host
|
||||
/** Indicates if the USB interface is currently initialized but not necessarily connected to a host
|
||||
* or device (i.e. if USB_Init() has been run). If this is false, all other library globals are invalid.
|
||||
*
|
||||
* \note This variable should be treated as read-only in the user application, and never manually
|
||||
|
|
@ -166,10 +166,10 @@
|
|||
* The USB task must be serviced within 50mS in all modes, when needed. The task may be serviced
|
||||
* at all times, or (for minimum CPU consumption):
|
||||
*
|
||||
* - In device mode, it may be disabled at startup, enabled on the firing of the USB_Connect event
|
||||
* - In device mode, it may be disabled at start-up, enabled on the firing of the USB_Connect event
|
||||
* and disabled again on the firing of the USB_Disconnect event.
|
||||
*
|
||||
* - In host mode, it may be disabled at startup, enabled on the firing of the USB_DeviceAttached
|
||||
* - In host mode, it may be disabled at start-up, enabled on the firing of the USB_DeviceAttached
|
||||
* event and disabled again on the firing of the USB_DeviceUnattached event.
|
||||
*
|
||||
* \see Events.h for more information on the USB events.
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@
|
|||
|
||||
/** Indicates if the device is currently suspended by the host. While suspended, the device is
|
||||
* to enter a low power state until resumed by the host. While suspended no USB traffic to or
|
||||
* from the device can ocurr (except for Remote Wakeup requests).
|
||||
* from the device can occur (except for Remote Wakeup requests).
|
||||
*
|
||||
* This macro returns true if the USB communications have been suspended by the host, false
|
||||
* otherwise.
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
*
|
||||
* Functions, macros and enums related to endpoint management when in USB Device mode. This
|
||||
* module contains the endpoint management macros, as well as endpoint interrupt and data
|
||||
* send/recieve functions for various datatypes.
|
||||
* send/recieve functions for various data types.
|
||||
*/
|
||||
|
||||
#ifndef __ENDPOINT_H__
|
||||
|
|
@ -210,7 +210,7 @@
|
|||
|
||||
/** Returns true if the currently selected endpoint may be read from (if data is waiting in the endpoint
|
||||
* bank and the endpoint is an OUT direction, or if the bank is not yet full if the endpoint is an
|
||||
* IN direction). This function will return false if an error has occured in the endpoint, or if
|
||||
* IN direction). This function will return false if an error has occurred in the endpoint, or if
|
||||
* the endpoint is an OUT direction and no packet has been received, or if the endpoint is an IN
|
||||
* direction and the endpoint bank is full.
|
||||
*/
|
||||
|
|
@ -262,10 +262,10 @@
|
|||
*/
|
||||
#define Endpoint_ClearSetupOUT() MACROS{ UEINTX &= ~(1 << RXOUTI); }MACROE
|
||||
|
||||
/** Stalls the current endpoint, indicating to the host that a logical problem occured with the
|
||||
/** Stalls the current endpoint, indicating to the host that a logical problem occurred with the
|
||||
* indicated endpoint and that the current transfer sequence should be aborted. This provides a
|
||||
* way for devices to indicate invalid commands to the host so that the current transfer can be
|
||||
* aborted and the host can begin its own recovery seqeuence.
|
||||
* aborted and the host can begin its own recovery sequence.
|
||||
*
|
||||
* The currently selected endpoint remains stalled until either the Endpoint_ClearStall() macro
|
||||
* is called, or the host issues a CLEAR FEATURE request to the device for the currently selected
|
||||
|
|
@ -276,7 +276,7 @@
|
|||
/** Clears the stall on the currently selected endpoint. */
|
||||
#define Endpoint_ClearStall() MACROS{ UECONX |= (1 << STALLRQC); }MACROE
|
||||
|
||||
/** Returns true if the currently selected endpoint is stalled, false othewise. */
|
||||
/** Returns true if the currently selected endpoint is stalled, false otherwise. */
|
||||
#define Endpoint_IsStalled() ((UECONX & (1 << STALLRQ)) ? true : false)
|
||||
|
||||
/** Resets the data toggle of the currently selected endpoint. */
|
||||
|
|
@ -552,12 +552,12 @@
|
|||
*
|
||||
* The callback routine should be created using the STREAM_CALLBACK() macro. If the token
|
||||
* NO_STREAM_CALLBACKS is passed via the -D option to the compiler, stream callbacks are disabled
|
||||
* and this function has the Callback parameter ommitted.
|
||||
* and this function has the Callback parameter omitted.
|
||||
*
|
||||
* \note This routine should not be used on CONTROL type endpoints.
|
||||
*
|
||||
* \param Length Number of bytes to send via the currently selected endpoint.
|
||||
* \param Callback Name of a callback routine to call between sucessive USB packet transfers, NULL if no callback
|
||||
* \param Callback Name of a callback routine to call between successive USB packet transfers, NULL if no callback
|
||||
*
|
||||
* \return A value from the Endpoint_Stream_RW_ErrorCodes_t enum.
|
||||
*/
|
||||
|
|
@ -576,13 +576,13 @@
|
|||
*
|
||||
* The callback routine should be created using the STREAM_CALLBACK() macro. If the token
|
||||
* NO_STREAM_CALLBACKS is passed via the -D option to the compiler, stream callbacks are disabled
|
||||
* and this function has the Callback parameter ommitted.
|
||||
* and this function has the Callback parameter omitted.
|
||||
*
|
||||
* \note This routine should not be used on CONTROL type endpoints.
|
||||
*
|
||||
* \param Buffer Pointer to the source data buffer to read from.
|
||||
* \param Length Number of bytes to read for the currently selected endpoint into the buffer.
|
||||
* \param Callback Name of a callback routine to call between sucessive USB packet transfers, NULL if no callback
|
||||
* \param Callback Name of a callback routine to call between successive USB packet transfers, NULL if no callback
|
||||
*
|
||||
* \return A value from the Endpoint_Stream_RW_ErrorCodes_t enum.
|
||||
*/
|
||||
|
|
@ -601,13 +601,13 @@
|
|||
*
|
||||
* The callback routine should be created using the STREAM_CALLBACK() macro. If the token
|
||||
* NO_STREAM_CALLBACKS is passed via the -D option to the compiler, stream callbacks are disabled
|
||||
* and this function has the Callback parameter ommitted.
|
||||
* and this function has the Callback parameter omitted.
|
||||
*
|
||||
* \note This routine should not be used on CONTROL type endpoints.
|
||||
*
|
||||
* \param Buffer Pointer to the source data buffer to read from.
|
||||
* \param Length Number of bytes to read for the currently selected endpoint into the buffer.
|
||||
* \param Callback Name of a callback routine to call between sucessive USB packet transfers, NULL if no callback
|
||||
* \param Callback Name of a callback routine to call between successive USB packet transfers, NULL if no callback
|
||||
*
|
||||
* \return A value from the Endpoint_Stream_RW_ErrorCodes_t enum.
|
||||
*/
|
||||
|
|
@ -626,13 +626,13 @@
|
|||
*
|
||||
* The callback routine should be created using the STREAM_CALLBACK() macro. If the token
|
||||
* NO_STREAM_CALLBACKS is passed via the -D option to the compiler, stream callbacks are disabled
|
||||
* and this function has the Callback parameter ommitted.
|
||||
* and this function has the Callback parameter omitted.
|
||||
*
|
||||
* \note This routine should not be used on CONTROL type endpoints.
|
||||
*
|
||||
* \param Buffer Pointer to the destination data buffer to write to.
|
||||
* \param Length Number of bytes to send via the currently selected endpoint.
|
||||
* \param Callback Name of a callback routine to call between sucessive USB packet transfers, NULL if no callback
|
||||
* \param Callback Name of a callback routine to call between successive USB packet transfers, NULL if no callback
|
||||
*
|
||||
* \return A value from the Endpoint_Stream_RW_ErrorCodes_t enum.
|
||||
*/
|
||||
|
|
@ -651,13 +651,13 @@
|
|||
*
|
||||
* The callback routine should be created using the STREAM_CALLBACK() macro. If the token
|
||||
* NO_STREAM_CALLBACKS is passed via the -D option to the compiler, stream callbacks are disabled
|
||||
* and this function has the Callback parameter ommitted.
|
||||
* and this function has the Callback parameter omitted.
|
||||
*
|
||||
* \note This routine should not be used on CONTROL type endpoints.
|
||||
*
|
||||
* \param Buffer Pointer to the destination data buffer to write to.
|
||||
* \param Length Number of bytes to send via the currently selected endpoint.
|
||||
* \param Callback Name of a callback routine to call between sucessive USB packet transfers, NULL if no callback
|
||||
* \param Callback Name of a callback routine to call between successive USB packet transfers, NULL if no callback
|
||||
*
|
||||
* \return A value from the Endpoint_Stream_RW_ErrorCodes_t enum.
|
||||
*/
|
||||
|
|
@ -749,27 +749,27 @@
|
|||
#define Endpoint_Ignore_DWord() Endpoint_Discard_DWord()
|
||||
|
||||
/** Alias for Endpoint_Read_Word_LE(). By default USB transfers use little endian format, thus
|
||||
* the command with no endianness specifier indicates little endian mode.
|
||||
* the command with no endianness specified indicates little endian mode.
|
||||
*/
|
||||
#define Endpoint_Read_Word() Endpoint_Read_Word_LE()
|
||||
|
||||
/** Alias for Endpoint_Write_Word_LE(). By default USB transfers use little endian format, thus
|
||||
* the command with no endianness specifier indicates little endian mode.
|
||||
* the command with no endianness specified indicates little endian mode.
|
||||
*/
|
||||
#define Endpoint_Write_Word(Word) Endpoint_Write_Word_LE(Word)
|
||||
|
||||
/** Alias for Endpoint_Read_DWord_LE(). By default USB transfers use little endian format, thus
|
||||
* the command with no endianness specifier indicates little endian mode.
|
||||
* the command with no endianness specified indicates little endian mode.
|
||||
*/
|
||||
#define Endpoint_Read_DWord() Endpoint_Read_DWord_LE()
|
||||
|
||||
/** Alias for Endpoint_Write_DWord_LE(). By default USB transfers use little endian format, thus
|
||||
* the command with no endianness specifier indicates little endian mode.
|
||||
* the command with no endianness specified indicates little endian mode.
|
||||
*/
|
||||
#define Endpoint_Write_DWord(DWord) Endpoint_Write_DWord_LE(DWord)
|
||||
|
||||
/** Alias for Endpoint_Read_Stream_LE(). By default USB transfers use little endian format, thus
|
||||
* the command with no endianness specifier indicates little endian mode.
|
||||
* the command with no endianness specified indicates little endian mode.
|
||||
*/
|
||||
#if !defined(NO_STREAM_CALLBACKS)
|
||||
#define Endpoint_Read_Stream(Buffer, Length, Callback) Endpoint_Read_Stream_LE(Buffer, Length, Callback)
|
||||
|
|
@ -778,7 +778,7 @@
|
|||
#endif
|
||||
|
||||
/** Alias for Endpoint_Write_Stream_LE(). By default USB transfers use little endian format, thus
|
||||
* the command with no endianness specifier indicates little endian mode.
|
||||
* the command with no endianness specified indicates little endian mode.
|
||||
*/
|
||||
#if !defined(NO_STREAM_CALLBACKS)
|
||||
#define Endpoint_Write_Stream(Buffer, Length, Callback) Endpoint_Write_Stream_LE(Buffer, Length, Callback)
|
||||
|
|
@ -787,12 +787,12 @@
|
|||
#endif
|
||||
|
||||
/** Alias for Endpoint_Read_Control_Stream_LE(). By default USB transfers use little endian format, thus
|
||||
* the command with no endianness specifier indicates little endian mode.
|
||||
* the command with no endianness specified indicates little endian mode.
|
||||
*/
|
||||
#define Endpoint_Read_Control_Stream(Data, Length) Endpoint_Read_Control_Stream_LE(Data, Length)
|
||||
|
||||
/** Alias for Endpoint_Write_Control_Stream_LE(). By default USB transfers use little endian format, thus
|
||||
* the command with no endianness specifier indicates little endian mode.
|
||||
* the command with no endianness specified indicates little endian mode.
|
||||
*/
|
||||
#define Endpoint_Write_Control_Stream(Data, Length) Endpoint_Write_Control_Stream_LE(Data, Length)
|
||||
|
||||
|
|
|
|||
|
|
@ -93,8 +93,8 @@ void USB_Host_ResetDevice(void)
|
|||
|
||||
for (uint8_t MSRem = 10; MSRem != 0; MSRem--)
|
||||
{
|
||||
/* Workaround for powerless-pullup devices. After a USB bus reset,
|
||||
all disconnection interrupts are supressed while a USB frame is
|
||||
/* Workaround for powerless-pull-up devices. After a USB bus reset,
|
||||
all disconnection interrupts are suppressed while a USB frame is
|
||||
looked for - if it is found within 10ms, the device is still
|
||||
present. */
|
||||
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@
|
|||
*/
|
||||
#define USB_Host_ResumeBus() MACROS{ UHCON |= (1 << SOFEN); }MACROE
|
||||
|
||||
/** Suspends the USB bus, preventing any communications from occuring between the host and attached
|
||||
/** Suspends the USB bus, preventing any communications from occurring between the host and attached
|
||||
* device until the bus has been resumed. This stops the transmission of the 1MS Start Of Frame
|
||||
* messages to the device.
|
||||
*/
|
||||
|
|
@ -192,14 +192,14 @@
|
|||
* event.
|
||||
*/
|
||||
HOST_ENUMERROR_WaitStage = 1, /**< One of the delays between enumeration steps failed
|
||||
* to complete successfuly, due to a timeout or other
|
||||
* to complete successfully, due to a timeout or other
|
||||
* error.
|
||||
*/
|
||||
HOST_ENUMERROR_NoDeviceDetected = 2, /**< No device was detected, despite the USB data lines
|
||||
* indicating the attachment of a device.
|
||||
*/
|
||||
HOST_ENUMERROR_ControlError = 3, /**< One of the enumeration control requests failed to
|
||||
* complete successfuly.
|
||||
* complete successfully.
|
||||
*/
|
||||
HOST_ENUMERROR_PipeConfigError = 4, /**< The default control pipe (address 0) failed to
|
||||
* configure correctly.
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@
|
|||
HOST_SENDCONTROL_DeviceDisconnect = 1, /**< The attached device was disconnected during the
|
||||
* request transfer.
|
||||
*/
|
||||
HOST_SENDCONTROL_PipeError = 2, /**< An error occured in the pipe while sending the request. */
|
||||
HOST_SENDCONTROL_PipeError = 2, /**< An error occurred in the pipe while sending the request. */
|
||||
HOST_SENDCONTROL_SetupStalled = 3, /**< The attached device stalled the request, usually
|
||||
* indicating that the request is unsupported on the device.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@
|
|||
* host mode indicates that VBUS should be applied and a session started.
|
||||
*
|
||||
* There are two different methods of sending a SRP - either pulses on the VBUS line, or by
|
||||
* pulsing the Data + line via the internal pullup resistor. The SRP mode is given as the
|
||||
* pulsing the Data + line via the internal pull-up resistor. The SRP mode is given as the
|
||||
* "type" parameter, and can be either USB_OTG_SRP_VBUS or USB_OTG_STP_DATA.
|
||||
*/
|
||||
#define USB_OTG_DEV_Initiate_SRP(type) MACROS{ OTGCON = ((OTGCON & ~(1 << SRPSEL)) | (type | (1 << SRPREQ))); }MACROE
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
*
|
||||
* Functions, macros and enums related to pipe management when in USB Host mode. This
|
||||
* module contains the pipe management macros, as well as pipe interrupt and data
|
||||
* send/recieve functions for various datatypes.
|
||||
* send/recieve functions for various data types.
|
||||
*/
|
||||
|
||||
#ifndef __PIPE_H__
|
||||
|
|
@ -303,7 +303,7 @@
|
|||
/** Returns true if the master pipe error flag is set for the currently selected pipe, indicating that
|
||||
* some sort of hardware error has occurred on the pipe.
|
||||
*
|
||||
* \see Pipe_GetErrorFlags() macro for information on retreiving the exact error flag.
|
||||
* \see Pipe_GetErrorFlags() macro for information on retrieving the exact error flag.
|
||||
*/
|
||||
#define Pipe_IsError() ((UPINTX & (1 << PERRI)) ? true : false)
|
||||
|
||||
|
|
@ -311,14 +311,14 @@
|
|||
* flag for the pipe. */
|
||||
#define Pipe_ClearErrorFlags() MACROS{ UPERRX = 0; }MACROE
|
||||
|
||||
/** Returns a mask of the hardware error flags which have occured on the currently selected pipe. This
|
||||
/** Returns a mask of the hardware error flags which have occurred on the currently selected pipe. This
|
||||
* value can then be masked against the PIPE_ERRORFLAG_* masks to determine what error has occurred.
|
||||
*/
|
||||
#define Pipe_GetErrorFlags() UPERRX
|
||||
|
||||
/** Returns true if the currently selected pipe may be read from (if data is waiting in the pipe
|
||||
* bank and the pipe is an IN direction, or if the bank is not yet full if the pipe is an OUT
|
||||
* direction). This function will return false if an error has occured in the pipe, or if the pipe
|
||||
* direction). This function will return false if an error has occurred in the pipe, or if the pipe
|
||||
* is an IN direction and no packet has been received, or if the pipe is an OUT direction and the
|
||||
* pipe bank is full.
|
||||
*/
|
||||
|
|
@ -358,9 +358,9 @@
|
|||
#define Pipe_ClearSetupOUT() MACROS{ UPINTX &= ~(1 << TXOUTI); UPINTX &= ~(1 << FIFOCON); }MACROE
|
||||
|
||||
/** Returns true if the device sent a NAK (Negative Acknowledge) in response to the last sent packet on
|
||||
* the currently selected pipe. This ocurrs when the host sends a packet to the device, but the device
|
||||
* the currently selected pipe. This occurs when the host sends a packet to the device, but the device
|
||||
* is not currently ready to handle the packet (i.e. its endpoint banks are full). Once a NAK has been
|
||||
* received, it must be cleard using Pipe_ClearNAKReceived() before the previous (or any other) packet
|
||||
* received, it must be cleared using Pipe_ClearNAKReceived() before the previous (or any other) packet
|
||||
* can be re-sent.
|
||||
*/
|
||||
#define Pipe_IsNAKReceived() ((UPINTX & (1 << NAKEDI)) ? true : false)
|
||||
|
|
@ -607,11 +607,11 @@
|
|||
*
|
||||
* The callback routine should be created using the STREAM_CALLBACK() macro. If the token
|
||||
* NO_STREAM_CALLBACKS is passed via the -D option to the compiler, stream callbacks are disabled
|
||||
* and this function has the Callback parameter ommitted.
|
||||
* and this function has the Callback parameter omitted.
|
||||
*
|
||||
* \param Buffer Pointer to the source data buffer to read from.
|
||||
* \param Length Number of bytes to read for the currently selected pipe into the buffer.
|
||||
* \param Callback Name of a callback routine to call between sucessive USB packet transfers, NULL if no callback
|
||||
* \param Callback Name of a callback routine to call between successive USB packet transfers, NULL if no callback
|
||||
*
|
||||
* \return A value from the Pipe_Stream_RW_ErrorCodes_t enum.
|
||||
*/
|
||||
|
|
@ -629,11 +629,11 @@
|
|||
*
|
||||
* The callback routine should be created using the STREAM_CALLBACK() macro. If the token
|
||||
* NO_STREAM_CALLBACKS is passed via the -D option to the compiler, stream callbacks are disabled
|
||||
* and this function has the Callback parameter ommitted.
|
||||
* and this function has the Callback parameter omitted.
|
||||
*
|
||||
* \param Buffer Pointer to the source data buffer to read from.
|
||||
* \param Length Number of bytes to read for the currently selected pipe into the buffer.
|
||||
* \param Callback Name of a callback routine to call between sucessive USB packet transfers, NULL if no callback
|
||||
* \param Callback Name of a callback routine to call between successive USB packet transfers, NULL if no callback
|
||||
*
|
||||
* \return A value from the Pipe_Stream_RW_ErrorCodes_t enum.
|
||||
*/
|
||||
|
|
@ -651,10 +651,10 @@
|
|||
*
|
||||
* The callback routine should be created using the STREAM_CALLBACK() macro. If the token
|
||||
* NO_STREAM_CALLBACKS is passed via the -D option to the compiler, stream callbacks are disabled
|
||||
* and this function has the Callback parameter ommitted.
|
||||
* and this function has the Callback parameter omitted.
|
||||
*
|
||||
* \param Length Number of bytes to send via the currently selected pipe.
|
||||
* \param Callback Name of a callback routine to call between sucessive USB packet transfers, NULL if no callback
|
||||
* \param Callback Name of a callback routine to call between successive USB packet transfers, NULL if no callback
|
||||
*
|
||||
* \return A value from the Pipe_Stream_RW_ErrorCodes_t enum.
|
||||
*/
|
||||
|
|
@ -672,11 +672,11 @@
|
|||
*
|
||||
* The callback routine should be created using the STREAM_CALLBACK() macro. If the token
|
||||
* NO_STREAM_CALLBACKS is passed via the -D option to the compiler, stream callbacks are disabled
|
||||
* and this function has the Callback parameter ommitted.
|
||||
* and this function has the Callback parameter omitted.
|
||||
*
|
||||
* \param Buffer Pointer to the source data buffer to write to.
|
||||
* \param Length Number of bytes to read for the currently selected pipe to read from.
|
||||
* \param Callback Name of a callback routine to call between sucessive USB packet transfers, NULL if no callback
|
||||
* \param Callback Name of a callback routine to call between successive USB packet transfers, NULL if no callback
|
||||
*
|
||||
* \return A value from the Pipe_Stream_RW_ErrorCodes_t enum.
|
||||
*/
|
||||
|
|
@ -694,11 +694,11 @@
|
|||
*
|
||||
* The callback routine should be created using the STREAM_CALLBACK() macro. If the token
|
||||
* NO_STREAM_CALLBACKS is passed via the -D option to the compiler, stream callbacks are disabled
|
||||
* and this function has the Callback parameter ommitted.
|
||||
* and this function has the Callback parameter omitted.
|
||||
*
|
||||
* \param Buffer Pointer to the source data buffer to write to.
|
||||
* \param Length Number of bytes to read for the currently selected pipe to read from.
|
||||
* \param Callback Name of a callback routine to call between sucessive USB packet transfers, NULL if no callback
|
||||
* \param Callback Name of a callback routine to call between successive USB packet transfers, NULL if no callback
|
||||
*
|
||||
* \return A value from the Pipe_Stream_RW_ErrorCodes_t enum.
|
||||
*/
|
||||
|
|
@ -722,27 +722,27 @@
|
|||
#define Pipe_Ignore_DWord() Pipe_Discard_DWord()
|
||||
|
||||
/** Alias for Pipe_Read_Word_LE(). By default USB transfers use little endian format, thus
|
||||
* the command with no endianness specifier indicates little endian mode.
|
||||
* the command with no endianness specified indicates little endian mode.
|
||||
*/
|
||||
#define Pipe_Read_Word() Pipe_Read_Word_LE()
|
||||
|
||||
/** Alias for Pipe_Write_Word_LE(). By default USB transfers use little endian format, thus
|
||||
* the command with no endianness specifier indicates little endian mode.
|
||||
* the command with no endianness specified indicates little endian mode.
|
||||
*/
|
||||
#define Pipe_Write_Word(Word) Pipe_Write_Word_LE(Word)
|
||||
|
||||
/** Alias for Pipe_Read_DWord_LE(). By default USB transfers use little endian format, thus
|
||||
* the command with no endianness specifier indicates little endian mode.
|
||||
* the command with no endianness specified indicates little endian mode.
|
||||
*/
|
||||
#define Pipe_Read_DWord() Pipe_Read_DWord_LE()
|
||||
|
||||
/** Alias for Pipe_Write_DWord_LE(). By default USB transfers use little endian format, thus
|
||||
* the command with no endianness specifier indicates little endian mode.
|
||||
* the command with no endianness specified indicates little endian mode.
|
||||
*/
|
||||
#define Pipe_Write_DWord(DWord) Pipe_Write_DWord_LE(DWord)
|
||||
|
||||
/** Alias for Pipe_Read_Stream_LE(). By default USB transfers use little endian format, thus
|
||||
* the command with no endianness specifier indicates little endian mode.
|
||||
* the command with no endianness specified indicates little endian mode.
|
||||
*/
|
||||
#if !defined(NO_STREAM_CALLBACKS)
|
||||
#define Pipe_Read_Stream(Buffer, Length, Callback) Pipe_Read_Stream_LE(Buffer, Length, Callback)
|
||||
|
|
@ -751,7 +751,7 @@
|
|||
#endif
|
||||
|
||||
/** Alias for Pipe_Write_Stream_LE(). By default USB transfers use little endian format, thus
|
||||
* the command with no endianness specifier indicates little endian mode.
|
||||
* the command with no endianness specified indicates little endian mode.
|
||||
*/
|
||||
#if !defined(NO_STREAM_CALLBACKS)
|
||||
#define Pipe_Write_Stream(Buffer, Length, Callback) Pipe_Read_Stream_LE(Buffer, Length, Callback)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue