diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2009-04-05 06:27:49 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2009-04-05 06:27:49 +0000 |
commit | 7d4cccc22d60125fac111819df48af1873d11018 (patch) | |
tree | d288ebae796fda45a59122f81c09e43d368de571 /LUFA/Drivers/USB/LowLevel | |
parent | 01d388f293ba531008122ebb4cfcf7113a228398 (diff) | |
download | lufa-7d4cccc22d60125fac111819df48af1873d11018.tar.gz lufa-7d4cccc22d60125fac111819df48af1873d11018.tar.bz2 lufa-7d4cccc22d60125fac111819df48af1873d11018.zip |
Move StdRequestType.h, StreamCallbacks.h, USBMode.h from the LowLevel USB driver directory to the HighLevel USB driver directory, where they are more suited.
Diffstat (limited to 'LUFA/Drivers/USB/LowLevel')
-rw-r--r-- | LUFA/Drivers/USB/LowLevel/DevChapter9.c | 3 | ||||
-rw-r--r-- | LUFA/Drivers/USB/LowLevel/DevChapter9.h | 2 | ||||
-rw-r--r-- | LUFA/Drivers/USB/LowLevel/Endpoint.c | 3 | ||||
-rw-r--r-- | LUFA/Drivers/USB/LowLevel/Endpoint.h | 2 | ||||
-rw-r--r-- | LUFA/Drivers/USB/LowLevel/Host.c | 3 | ||||
-rw-r--r-- | LUFA/Drivers/USB/LowLevel/HostChapter9.c | 3 | ||||
-rw-r--r-- | LUFA/Drivers/USB/LowLevel/HostChapter9.h | 3 | ||||
-rw-r--r-- | LUFA/Drivers/USB/LowLevel/LowLevel.c | 2 | ||||
-rw-r--r-- | LUFA/Drivers/USB/LowLevel/LowLevel.h | 4 | ||||
-rw-r--r-- | LUFA/Drivers/USB/LowLevel/Pipe.c | 4 | ||||
-rw-r--r-- | LUFA/Drivers/USB/LowLevel/Pipe.h | 2 | ||||
-rw-r--r-- | LUFA/Drivers/USB/LowLevel/StdRequestType.h | 191 | ||||
-rw-r--r-- | LUFA/Drivers/USB/LowLevel/StreamCallbacks.h | 87 | ||||
-rw-r--r-- | LUFA/Drivers/USB/LowLevel/USBMode.h | 77 |
14 files changed, 19 insertions, 367 deletions
diff --git a/LUFA/Drivers/USB/LowLevel/DevChapter9.c b/LUFA/Drivers/USB/LowLevel/DevChapter9.c index 44493e698..765627b15 100644 --- a/LUFA/Drivers/USB/LowLevel/DevChapter9.c +++ b/LUFA/Drivers/USB/LowLevel/DevChapter9.c @@ -28,7 +28,8 @@ this software.
*/
-#include "USBMode.h"
+#include "../HighLevel/USBMode.h"
+
#if defined(USB_CAN_BE_DEVICE)
#define INCLUDE_FROM_DEVCHAPTER9_C
diff --git a/LUFA/Drivers/USB/LowLevel/DevChapter9.h b/LUFA/Drivers/USB/LowLevel/DevChapter9.h index 543c1a940..2b425e7e6 100644 --- a/LUFA/Drivers/USB/LowLevel/DevChapter9.h +++ b/LUFA/Drivers/USB/LowLevel/DevChapter9.h @@ -46,8 +46,8 @@ #include "../HighLevel/StdDescriptors.h"
#include "../HighLevel/Events.h"
+ #include "../HighLevel/StdRequestType.h"
#include "LowLevel.h"
- #include "StdRequestType.h"
/* Enable C linkage for C++ Compilers: */
#if defined(__cplusplus)
diff --git a/LUFA/Drivers/USB/LowLevel/Endpoint.c b/LUFA/Drivers/USB/LowLevel/Endpoint.c index 3376098ed..aa18358c8 100644 --- a/LUFA/Drivers/USB/LowLevel/Endpoint.c +++ b/LUFA/Drivers/USB/LowLevel/Endpoint.c @@ -28,7 +28,8 @@ this software.
*/
-#include "USBMode.h"
+#include "../HighLevel/USBMode.h"
+
#if defined(USB_CAN_BE_DEVICE)
#define INCLUDE_FROM_ENDPOINT_C
diff --git a/LUFA/Drivers/USB/LowLevel/Endpoint.h b/LUFA/Drivers/USB/LowLevel/Endpoint.h index 8c22bb7f7..009d8622d 100644 --- a/LUFA/Drivers/USB/LowLevel/Endpoint.h +++ b/LUFA/Drivers/USB/LowLevel/Endpoint.h @@ -46,7 +46,7 @@ #include "../HighLevel/USBTask.h"
#if !defined(NO_STREAM_CALLBACKS) || defined(__DOXYGEN__)
- #include "StreamCallbacks.h"
+ #include "../HighLevel/StreamCallbacks.h"
#endif
/* Enable C linkage for C++ Compilers: */
diff --git a/LUFA/Drivers/USB/LowLevel/Host.c b/LUFA/Drivers/USB/LowLevel/Host.c index 04b06b3da..52f19a5fd 100644 --- a/LUFA/Drivers/USB/LowLevel/Host.c +++ b/LUFA/Drivers/USB/LowLevel/Host.c @@ -28,7 +28,8 @@ this software.
*/
-#include "USBMode.h"
+#include "../HighLevel/USBMode.h"
+
#if defined(USB_CAN_BE_HOST)
#include "Host.h"
diff --git a/LUFA/Drivers/USB/LowLevel/HostChapter9.c b/LUFA/Drivers/USB/LowLevel/HostChapter9.c index fe168b724..123a1d25f 100644 --- a/LUFA/Drivers/USB/LowLevel/HostChapter9.c +++ b/LUFA/Drivers/USB/LowLevel/HostChapter9.c @@ -28,7 +28,8 @@ this software.
*/
-#include "USBMode.h"
+#include "../HighLevel/USBMode.h"
+
#if defined(USB_CAN_BE_HOST)
#define INCLUDE_FROM_HOSTCHAPTER9_C
diff --git a/LUFA/Drivers/USB/LowLevel/HostChapter9.h b/LUFA/Drivers/USB/LowLevel/HostChapter9.h index 4e4fa4f08..84ee8ae8a 100644 --- a/LUFA/Drivers/USB/LowLevel/HostChapter9.h +++ b/LUFA/Drivers/USB/LowLevel/HostChapter9.h @@ -44,7 +44,8 @@ #include <stdbool.h>
#include "LowLevel.h"
- #include "StdRequestType.h"
+ #include "../HighLevel/USBMode.h"
+ #include "../HighLevel/StdRequestType.h"
/* Enable C linkage for C++ Compilers: */
#if defined(__cplusplus)
diff --git a/LUFA/Drivers/USB/LowLevel/LowLevel.c b/LUFA/Drivers/USB/LowLevel/LowLevel.c index 61acf6def..4df8eee3b 100644 --- a/LUFA/Drivers/USB/LowLevel/LowLevel.c +++ b/LUFA/Drivers/USB/LowLevel/LowLevel.c @@ -28,8 +28,6 @@ this software.
*/
-#include "USBMode.h"
-
#include "LowLevel.h"
#if (!defined(USB_HOST_ONLY) && !defined(USB_DEVICE_ONLY))
diff --git a/LUFA/Drivers/USB/LowLevel/LowLevel.h b/LUFA/Drivers/USB/LowLevel/LowLevel.h index 253d0180e..94d8c83c9 100644 --- a/LUFA/Drivers/USB/LowLevel/LowLevel.h +++ b/LUFA/Drivers/USB/LowLevel/LowLevel.h @@ -42,8 +42,10 @@ #include <avr/interrupt.h>
#include <stdbool.h>
- #include "USBMode.h"
+ #include "../HighLevel/USBMode.h"
+
#include "../../../Common/Common.h"
+ #include "../HighLevel/USBMode.h"
#include "../HighLevel/Events.h"
#include "../HighLevel/USBTask.h"
#include "../HighLevel/USBInterrupt.h"
diff --git a/LUFA/Drivers/USB/LowLevel/Pipe.c b/LUFA/Drivers/USB/LowLevel/Pipe.c index 1bc08e1fb..1218d2f24 100644 --- a/LUFA/Drivers/USB/LowLevel/Pipe.c +++ b/LUFA/Drivers/USB/LowLevel/Pipe.c @@ -27,7 +27,9 @@ arising out of or in connection with the use or performance of
this software.
*/
-#include "USBMode.h"
+
+#include "../HighLevel/USBMode.h"
+
#if defined(USB_CAN_BE_HOST)
#define INCLUDE_FROM_PIPE_C
diff --git a/LUFA/Drivers/USB/LowLevel/Pipe.h b/LUFA/Drivers/USB/LowLevel/Pipe.h index 9a59dbca8..a4fdcfd20 100644 --- a/LUFA/Drivers/USB/LowLevel/Pipe.h +++ b/LUFA/Drivers/USB/LowLevel/Pipe.h @@ -46,7 +46,7 @@ #include "../HighLevel/USBTask.h"
#if !defined(NO_STREAM_CALLBACKS) || defined(__DOXYGEN__)
- #include "StreamCallbacks.h"
+ #include "../HighLevel/StreamCallbacks.h"
#endif
/* Enable C linkage for C++ Compilers: */
diff --git a/LUFA/Drivers/USB/LowLevel/StdRequestType.h b/LUFA/Drivers/USB/LowLevel/StdRequestType.h deleted file mode 100644 index 02d4fdc58..000000000 --- a/LUFA/Drivers/USB/LowLevel/StdRequestType.h +++ /dev/null @@ -1,191 +0,0 @@ -/*
- LUFA Library
- Copyright (C) Dean Camera, 2009.
-
- dean [at] fourwalledcubicle [dot] com
- www.fourwalledcubicle.com
-*/
-
-/*
- Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
-
- Permission to use, copy, modify, and distribute this software
- and its documentation for any purpose and without fee is hereby
- granted, provided that the above copyright notice appear in all
- copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
- software without specific, written prior permission.
-
- The author disclaim all warranties with regard to this
- software, including all implied warranties of merchantability
- and fitness. In no event shall the author be liable for any
- special, indirect or consequential damages or any damages
- whatsoever resulting from loss of use, data or profits, whether
- in an action of contract, negligence or other tortious action,
- arising out of or in connection with the use or performance of
- this software.
-*/
-
-/** \file
- *
- * Contains definitions for the various control request parameters, so that the request details (such as data
- * direction, request recipient, etc.) can be extracted via masking.
- */
-
-#ifndef __STDREQTYPE_H__
-#define __STDREQTYPE_H__
-
- /* Public Interface - May be used in end-application: */
- /* Macros: */
- /** Mask for the request type parameter, to indicate the direction of the request data (Host to Device
- * or Device to Host). The result of this mask should then be compared to the request direction masks.
- *
- * \see REQDIR_* macros for masks indicating the request data direction.
- */
- #define CONTROL_REQTYPE_DIRECTION 0b10000000
-
- /** Mask for the request type parameter, to indicate the type of request (Device, Class or Vendor
- * Specific). The result of this mask should then be compared to the request type masks.
- *
- * \see REQTYPE_* macros for masks indicating the request type.
- */
- #define CONTROL_REQTYPE_TYPE 0b01100000
-
- /** Mask for the request type parameter, to indicate the recipient of the request (Standard, Class
- * or Vendor Specific). The result of this mask should then be compared to the request recipient
- * masks.
- *
- * \see REQREC_* macros for masks indicating the request recipient.
- */
- #define CONTROL_REQTYPE_RECIPIENT 0b00011111
-
- /** Request data direction mask, indicating that the request data will flow from host to device.
- *
- * \see CONTROL_REQTYPE_DIRECTION macro.
- */
- #define REQDIR_HOSTTODEVICE (0 << 7)
-
- /** Request data direction mask, indicating that the request data will flow from device to host.
- *
- * \see CONTROL_REQTYPE_DIRECTION macro.
- */
- #define REQDIR_DEVICETOHOST (1 << 7)
-
- /** Request type mask, indicating that the request is a standard request.
- *
- * \see CONTROL_REQTYPE_TYPE macro.
- */
- #define REQTYPE_STANDARD (0 << 5)
-
- /** Request type mask, indicating that the request is a class-specific request.
- *
- * \see CONTROL_REQTYPE_TYPE macro.
- */
- #define REQTYPE_CLASS (1 << 5)
-
- /** Request type mask, indicating that the request is a vendor specific request.
- *
- * \see CONTROL_REQTYPE_TYPE macro.
- */
- #define REQTYPE_VENDOR (2 << 5)
-
- /** Request recipient mask, indicating that the request is to be issued to the device as a whole.
- *
- * \see CONTROL_REQTYPE_RECIPIENT macro.
- */
- #define REQREC_DEVICE (0 << 0)
-
- /** Request recipient mask, indicating that the request is to be issued to an interface in the
- * currently selected configuration.
- *
- * \see CONTROL_REQTYPE_RECIPIENT macro.
- */
- #define REQREC_INTERFACE (1 << 0)
-
- /** Request recipient mask, indicating that the request is to be issued to an endpoint in the
- * currently selected configuration.
- *
- * \see CONTROL_REQTYPE_RECIPIENT macro.
- */
- #define REQREC_ENDPOINT (2 << 0)
-
- /** Request recipient mask, indicating that the request is to be issued to an unspecified element
- * in the currently selected configuration.
- *
- * \see CONTROL_REQTYPE_RECIPIENT macro.
- */
- #define REQREC_OTHER (3 << 0)
-
- /** Feature indicator for Clear Feature or Set Feature commands. When used in a Clear Feature
- * request this indicates that an endpoint (whose address is given elsewhere in the request
- * should have its stall condition cleared. If used in a similar manner inside a Set Feature
- * request, this stalls an endpoint.
- */
- #define FEATURE_ENDPOINT_HALT 0x00
-
- /** Feature indicator for Clear Feature or Set Feature commands. When used in a Clear Feature
- * request this indicates that the remote wakeup enabled device should not issue remote
- * wakeup requests until further notice. If used in a similar manner inside a Set Feature
- * request, this re-enabled the remote wakeup feature on the device.
- */
- #define FEATURE_REMOTE_WAKEUP 0x01
-
- /* Enums: */
- /** Enumeration for the various standard request commands. These commands are applicable when the
- * request type is REQTYPE_STANDARD (with the exception of REQ_GetDescriptor, which is always
- * handled regardless of the request type value).
- *
- * \see Chapter 9 of the USB 2.0 Specification.
- */
- enum USB_Control_Request_t
- {
- REQ_GetStatus = 0, /**< Implemented in the library for device, endpoint and interface
- * recipients. Passed to the user application for other recipients
- * via the USB_UnhandledControlPacket() event when received in
- * device mode. */
- REQ_ClearFeature = 1, /**< Implemented in the library for device, endpoint and interface
- * recipients. Passed to the user application for other recipients
- * via the USB_UnhandledControlPacket() event when received in
- * device mode. */
- REQ_SetFeature = 3, /**< Implemented in the library for device, endpoint and interface
- * recipients. Passed to the user application for other recipients
- * via the USB_UnhandledControlPacket() event when received in
- * device mode. */
- REQ_SetAddress = 5, /**< Implemented in the library for the device recipient. Passed
- * to the user application for other recipients via the
- * USB_UnhandledControlPacket() event when received in
- * device mode. */
- REQ_GetDescriptor = 6, /**< Implemented in the library for all recipients and all request
- * types. */
- REQ_SetDescriptor = 7, /**< Not implemented in the library, passed to the user application
- * via the USB_UnhandledControlPacket() event when received in
- * device mode. */
- REQ_GetConfiguration = 8, /**< Implemented in the library for the device recipient. Passed
- * to the user application for other recipients via the
- * USB_UnhandledControlPacket() event when received in
- * device mode. */
- REQ_SetConfiguration = 9, /**< Implemented in the library for the device recipient. Passed
- * to the user application for other recipients via the
- * USB_UnhandledControlPacket() event when received in
- * device mode. */
- REQ_GetInterface = 10, /**< Not implemented in the library, passed to the user application
- * via the USB_UnhandledControlPacket() event when received in
- * device mode. */
- REQ_SetInterface = 11, /**< Not implemented in the library, passed to the user application
- * via the USB_UnhandledControlPacket() event when received in
- * device mode. */
- REQ_SynchFrame = 12, /**< Not implemented in the library, passed to the user application
- * via the USB_UnhandledControlPacket() event when received in
- * device mode. */
- };
-
-/* Private Interface - For use in library only: */
- #if !defined(__DOXYGEN__)
- /* Macros: */
- #define FEATURE_SELFPOWERED_ENABLED (1 << 0)
- #define FEATURE_REMOTE_WAKEUP_ENABLED (1 << 1)
- #endif
-
-#endif
diff --git a/LUFA/Drivers/USB/LowLevel/StreamCallbacks.h b/LUFA/Drivers/USB/LowLevel/StreamCallbacks.h deleted file mode 100644 index 5c2dad637..000000000 --- a/LUFA/Drivers/USB/LowLevel/StreamCallbacks.h +++ /dev/null @@ -1,87 +0,0 @@ -/*
- LUFA Library
- Copyright (C) Dean Camera, 2009.
-
- dean [at] fourwalledcubicle [dot] com
- www.fourwalledcubicle.com
-*/
-
-/*
- Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
-
- Permission to use, copy, modify, and distribute this software
- and its documentation for any purpose and without fee is hereby
- granted, provided that the above copyright notice appear in all
- copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
- software without specific, written prior permission.
-
- The author disclaim all warranties with regard to this
- software, including all implied warranties of merchantability
- and fitness. In no event shall the author be liable for any
- special, indirect or consequential damages or any damages
- whatsoever resulting from loss of use, data or profits, whether
- in an action of contract, negligence or other tortious action,
- arising out of or in connection with the use or performance of
- this software.
-*/
-
-/** \file
- *
- * Macros and enums for the stream callback routines in Endpoint.h and Pipe.c. This module contains the
- * code required to easily set up stream callback functions which can be used to force early abort of a
- * stream read/write process.
- */
-
-#ifndef __STREAMCALLBACK_H__
-#define __STREAMCALLBACK_H__
-
- /* Public Interface - May be used in end-application: */
- /* Macros: */
- /** Creates a prototype for or begins a stream callback routine. Stream callback routines are small
- * routines which are executed during stream read or writes (if the callback-enabled versions of
- * these functions are used) which allow the user application to abort the transfer when certain
- * arbitrary conditions are met.
- *
- * Stream callback functions should return a value from the StreamCallback_Return_ErrorCodes_t
- * enum.
- *
- * Usage Example (Device Endpoint, but applicable for Host Pipes also):
- * \code
- * STREAM_CALLBACK(GlobalNotSet); // Callback Prototype
- *
- * STREAM_CALLBACK(GlobalNotSet)
- * {
- * if (MyGlobal == false)
- * return ENDPOINT_STREAMCALLBACK_Continue;
- * else
- * return ENDPOINT_STREAMCALLBACK_Abort;
- * }
- *
- * //...
- * // Inside some routine:
- * if (Endpoint_Write_Stream_LE(DataBuffer, sizeof(DataBuffer), GlobalNotSet) ==
- * ENDPOINT_RWSTREAM_ERROR_CallbackAborted)
- * {
- * // Do something when the callback aborted the transfer early
- * }
- * \endcode
- */
- #define STREAM_CALLBACK(name) uint8_t name (void)
-
- /** Used with the Endpoint and Pipe stream functions as the callback function parameter, indicating that the stream
- * call has no callback function to be called between USB packets.
- */
- #define NO_STREAM_CALLBACK NULL
-
- /* Enums: */
- /** Enum for the possible error return codes of a stream callback function */
- enum StreamCallback_Return_ErrorCodes_t
- {
- STREAMCALLBACK_Continue = 0, /**< Continue sending or receiving the stream. */
- STREAMCALLBACK_Abort = 1, /**< Abort the stream send or receiving process. */
- };
-
-#endif
diff --git a/LUFA/Drivers/USB/LowLevel/USBMode.h b/LUFA/Drivers/USB/LowLevel/USBMode.h deleted file mode 100644 index 138af9ed0..000000000 --- a/LUFA/Drivers/USB/LowLevel/USBMode.h +++ /dev/null @@ -1,77 +0,0 @@ -/*
- LUFA Library
- Copyright (C) Dean Camera, 2009.
-
- dean [at] fourwalledcubicle [dot] com
- www.fourwalledcubicle.com
-*/
-
-/*
- Copyright 2009 Dean Camera (dean [at] fourwalledcubicle [dot] com)
-
- Permission to use, copy, modify, and distribute this software
- and its documentation for any purpose and without fee is hereby
- granted, provided that the above copyright notice appear in all
- copies and that both that the copyright notice and this
- permission notice and warranty disclaimer appear in supporting
- documentation, and that the name of the author not be used in
- advertising or publicity pertaining to distribution of the
- software without specific, written prior permission.
-
- The author disclaim all warranties with regard to this
- software, including all implied warranties of merchantability
- and fitness. In no event shall the author be liable for any
- special, indirect or consequential damages or any damages
- whatsoever resulting from loss of use, data or profits, whether
- in an action of contract, negligence or other tortious action,
- arising out of or in connection with the use or performance of
- this software.
-*/
-
-#ifndef __USBMODE_H__
-#define __USBMODE_H__
-
- /* Private Interface - For use in library only: */
- #if !defined(__DOXYGEN__)
- /* Macros: */
- #if ((defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB646__) || \
- defined(__AVR_AT90USB162__) || defined(__AVR_AT90USB82__) || \
- defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__) || \
- defined(__AVR_ATmega32U6__)) && !defined(USB_DEVICE_ONLY))
- #define USB_DEVICE_ONLY
- #endif
-
- #if (defined(__AVR_AT90USB162__) || defined(__AVR_AT90USB82__))
- #define USB_LIMITED_CONTROLLER
- #elif (defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__))
- #define USB_MODIFIED_FULL_CONTROLLER
- #else
- #define USB_FULL_CONTROLLER
- #endif
-
- #if (!defined(USB_DEVICE_ONLY) && !defined(USB_HOST_ONLY))
- #define USB_CAN_BE_BOTH
- #define USB_CAN_BE_HOST
- #define USB_CAN_BE_DEVICE
- #elif defined(USB_HOST_ONLY)
- #define USB_CAN_BE_HOST
- #define USB_CurrentMode USB_MODE_HOST
- #elif defined(USB_DEVICE_ONLY)
- #define USB_CAN_BE_DEVICE
- #define USB_CurrentMode USB_MODE_DEVICE
- #endif
-
- #if (defined(USB_HOST_ONLY) && defined(USB_DEVICE_ONLY))
- #error USB_HOST_ONLY and USB_DEVICE_ONLY are mutually exclusive.
- #endif
-
- #if (defined(USE_RAM_DESCRIPTORS) && defined(USE_EEPROM_DESCRIPTORS))
- #error USE_RAM_DESCRIPTORS and USE_EEPROM_DESCRIPTORS are mutually exclusive.
- #endif
-
- #if defined(USE_STATIC_OPTIONS)
- #define USB_Options USE_STATIC_OPTIONS
- #endif
- #endif
-
-#endif
|