aboutsummaryrefslogtreecommitdiff
path: root/LUFA/Drivers/USB
diff options
context:
space:
mode:
authorDean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28>2011-03-21 11:10:02 +0000
committerDean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28>2011-03-21 11:10:02 +0000
commit3d0202abe1124ce89436968dfaebbf5189b15045 (patch)
treeed1db5d5b56343dd26549f3804f08ee6e1975eb9 /LUFA/Drivers/USB
parent2ee4fb0693a55e5c1bc5923ad482fbea383030f1 (diff)
Add in new architecture attribute defines to selectively remove the EEPROM and FLASH memory space functions on architectures which do not have seperate memory address spaces.
git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@1721 d5102386-fcda-11dd-9fdb-3debd5008f28
Diffstat (limited to 'LUFA/Drivers/USB')
-rw-r--r--LUFA/Drivers/USB/Core/Device.h3
-rw-r--r--LUFA/Drivers/USB/Core/DeviceStandardReq.c5
-rw-r--r--LUFA/Drivers/USB/Core/DeviceStandardReq.h7
-rw-r--r--LUFA/Drivers/USB/Core/EndpointStream.c172
-rw-r--r--LUFA/Drivers/USB/Core/EndpointStream.h34
-rw-r--r--LUFA/Drivers/USB/Core/PipeStream.c110
-rw-r--r--LUFA/Drivers/USB/Core/PipeStream.h16
-rw-r--r--LUFA/Drivers/USB/Core/UC3/USBController_UC3.h4
8 files changed, 207 insertions, 144 deletions
diff --git a/LUFA/Drivers/USB/Core/Device.h b/LUFA/Drivers/USB/Core/Device.h
index bbc1b46c..be3dfd11 100644
--- a/LUFA/Drivers/USB/Core/Device.h
+++ b/LUFA/Drivers/USB/Core/Device.h
@@ -121,7 +121,8 @@
uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
const uint8_t wIndex,
const void** const DescriptorAddress
- #if !defined(USE_FLASH_DESCRIPTORS) && !defined(USE_EEPROM_DESCRIPTORS) && !defined(USE_RAM_DESCRIPTORS)
+ #if (defined(ARCH_HAS_MULTI_ADDRESS_SPACE) || defined(__DOXYGEN__)) && \
+ !(defined(USE_FLASH_DESCRIPTORS) || defined(USE_EEPROM_DESCRIPTORS) || defined(USE_RAM_DESCRIPTORS))
, uint8_t* MemoryAddressSpace
#endif
) ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3);
diff --git a/LUFA/Drivers/USB/Core/DeviceStandardReq.c b/LUFA/Drivers/USB/Core/DeviceStandardReq.c
index 2ac6c0a5..f6bedda5 100644
--- a/LUFA/Drivers/USB/Core/DeviceStandardReq.c
+++ b/LUFA/Drivers/USB/Core/DeviceStandardReq.c
@@ -238,7 +238,8 @@ static void USB_Device_GetDescriptor(void)
if ((DescriptorSize = CALLBACK_USB_GetDescriptor(USB_ControlRequest.wValue, USB_ControlRequest.wIndex,
&DescriptorPointer
- #if !defined(USE_FLASH_DESCRIPTORS) && !defined(USE_EEPROM_DESCRIPTORS) && !defined(USE_RAM_DESCRIPTORS)
+ #if defined(ARCH_HAS_MULTI_ADDRESS_SPACE) && \
+ !(defined(USE_FLASH_DESCRIPTORS) || defined(USE_EEPROM_DESCRIPTORS) || defined(USE_RAM_DESCRIPTORS))
, &DescriptorAddressSpace
#endif
)) == NO_DESCRIPTOR)
@@ -248,7 +249,7 @@ static void USB_Device_GetDescriptor(void)
Endpoint_ClearSETUP();
- #if defined(USE_RAM_DESCRIPTORS)
+ #if defined(USE_RAM_DESCRIPTORS) || !defined(ARCH_HAS_MULTI_ADDRESS_SPACE)
Endpoint_Write_Control_Stream_LE(DescriptorPointer, DescriptorSize);
#elif defined(USE_EEPROM_DESCRIPTORS)
Endpoint_Write_Control_EStream_LE(DescriptorPointer, DescriptorSize);
diff --git a/LUFA/Drivers/USB/Core/DeviceStandardReq.h b/LUFA/Drivers/USB/Core/DeviceStandardReq.h
index dbf1ca4a..26a55a4e 100644
--- a/LUFA/Drivers/USB/Core/DeviceStandardReq.h
+++ b/LUFA/Drivers/USB/Core/DeviceStandardReq.h
@@ -61,13 +61,8 @@
#endif
/* Public Interface - May be used in end-application: */
- /* Macros: */
- #if defined(USE_SINGLE_DEVICE_CONFIGURATION)
- #define FIXED_NUM_CONFIGURATIONS 1
- #endif
-
/* Enums: */
- #if !defined(USE_FLASH_DESCRIPTORS) && !defined(USE_EEPROM_DESCRIPTORS) && !defined(USE_RAM_DESCRIPTORS)
+ #if defined(ARCH_HAS_MULTI_ADDRESS_SPACE) || defined(__DOXYGEN__)
/** Enum for the possible descriptor memory spaces, for the \c MemoryAddressSpace parameter of the
* \ref CALLBACK_USB_GetDescriptor() function. This can be used when none of the \c USE_*_DESCRIPTORS
* compile time options are used, to indicate in which memory space the descriptor is stored.
diff --git a/LUFA/Drivers/USB/Core/EndpointStream.c b/LUFA/Drivers/USB/Core/EndpointStream.c
index 974af682..893a6ff3 100644
--- a/LUFA/Drivers/USB/Core/EndpointStream.c
+++ b/LUFA/Drivers/USB/Core/EndpointStream.c
@@ -122,22 +122,6 @@ uint8_t Endpoint_Null_Stream(uint16_t Length,
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(*BufferPtr)
#include "Template/Template_Endpoint_RW.c"
-#define TEMPLATE_FUNC_NAME Endpoint_Write_PStream_LE
-#define TEMPLATE_BUFFER_TYPE const void*
-#define TEMPLATE_CLEAR_ENDPOINT() Endpoint_ClearIN()
-#define TEMPLATE_BUFFER_OFFSET(Length) 0
-#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr += Amount
-#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(pgm_read_byte(BufferPtr))
-#include "Template/Template_Endpoint_RW.c"
-
-#define TEMPLATE_FUNC_NAME Endpoint_Write_EStream_LE
-#define TEMPLATE_BUFFER_TYPE const void*
-#define TEMPLATE_CLEAR_ENDPOINT() Endpoint_ClearIN()
-#define TEMPLATE_BUFFER_OFFSET(Length) 0
-#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr += Amount
-#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(eeprom_read_byte(BufferPtr))
-#include "Template/Template_Endpoint_RW.c"
-
#define TEMPLATE_FUNC_NAME Endpoint_Write_Stream_BE
#define TEMPLATE_BUFFER_TYPE const void*
#define TEMPLATE_CLEAR_ENDPOINT() Endpoint_ClearIN()
@@ -146,22 +130,6 @@ uint8_t Endpoint_Null_Stream(uint16_t Length,
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(*BufferPtr)
#include "Template/Template_Endpoint_RW.c"
-#define TEMPLATE_FUNC_NAME Endpoint_Write_EStream_BE
-#define TEMPLATE_BUFFER_TYPE const void*
-#define TEMPLATE_CLEAR_ENDPOINT() Endpoint_ClearIN()
-#define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1)
-#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr -= Amount
-#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(eeprom_read_byte(BufferPtr))
-#include "Template/Template_Endpoint_RW.c"
-
-#define TEMPLATE_FUNC_NAME Endpoint_Write_PStream_BE
-#define TEMPLATE_BUFFER_TYPE const void*
-#define TEMPLATE_CLEAR_ENDPOINT() Endpoint_ClearIN()
-#define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1)
-#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr -= Amount
-#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(pgm_read_byte(BufferPtr))
-#include "Template/Template_Endpoint_RW.c"
-
#define TEMPLATE_FUNC_NAME Endpoint_Read_Stream_LE
#define TEMPLATE_BUFFER_TYPE void*
#define TEMPLATE_CLEAR_ENDPOINT() Endpoint_ClearOUT()
@@ -170,14 +138,6 @@ uint8_t Endpoint_Null_Stream(uint16_t Length,
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) *BufferPtr = Endpoint_Read_Byte()
#include "Template/Template_Endpoint_RW.c"
-#define TEMPLATE_FUNC_NAME Endpoint_Read_EStream_LE
-#define TEMPLATE_BUFFER_TYPE void*
-#define TEMPLATE_CLEAR_ENDPOINT() Endpoint_ClearOUT()
-#define TEMPLATE_BUFFER_OFFSET(Length) 0
-#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr += Amount
-#define TEMPLATE_TRANSFER_BYTE(BufferPtr) eeprom_update_byte(BufferPtr, Endpoint_Read_Byte())
-#include "Template/Template_Endpoint_RW.c"
-
#define TEMPLATE_FUNC_NAME Endpoint_Read_Stream_BE
#define TEMPLATE_BUFFER_TYPE void*
#define TEMPLATE_CLEAR_ENDPOINT() Endpoint_ClearOUT()
@@ -186,13 +146,57 @@ uint8_t Endpoint_Null_Stream(uint16_t Length,
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) *BufferPtr = Endpoint_Read_Byte()
#include "Template/Template_Endpoint_RW.c"
-#define TEMPLATE_FUNC_NAME Endpoint_Read_EStream_BE
-#define TEMPLATE_BUFFER_TYPE void*
-#define TEMPLATE_CLEAR_ENDPOINT() Endpoint_ClearOUT()
-#define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1)
-#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr -= Amount
-#define TEMPLATE_TRANSFER_BYTE(BufferPtr) eeprom_update_byte(BufferPtr, Endpoint_Read_Byte())
-#include "Template/Template_Endpoint_RW.c"
+#if defined(ARCH_HAS_FLASH_ADDRESS_SPACE)
+ #define TEMPLATE_FUNC_NAME Endpoint_Write_PStream_LE
+ #define TEMPLATE_BUFFER_TYPE const void*
+ #define TEMPLATE_CLEAR_ENDPOINT() Endpoint_ClearIN()
+ #define TEMPLATE_BUFFER_OFFSET(Length) 0
+ #define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr += Amount
+ #define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(pgm_read_byte(BufferPtr))
+ #include "Template/Template_Endpoint_RW.c"
+
+ #define TEMPLATE_FUNC_NAME Endpoint_Write_PStream_BE
+ #define TEMPLATE_BUFFER_TYPE const void*
+ #define TEMPLATE_CLEAR_ENDPOINT() Endpoint_ClearIN()
+ #define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1)
+ #define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr -= Amount
+ #define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(pgm_read_byte(BufferPtr))
+ #include "Template/Template_Endpoint_RW.c"
+#endif
+
+#if defined(ARCH_HAS_EEPROM_ADDRESS_SPACE)
+ #define TEMPLATE_FUNC_NAME Endpoint_Write_EStream_LE
+ #define TEMPLATE_BUFFER_TYPE const void*
+ #define TEMPLATE_CLEAR_ENDPOINT() Endpoint_ClearIN()
+ #define TEMPLATE_BUFFER_OFFSET(Length) 0
+ #define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr += Amount
+ #define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(eeprom_read_byte(BufferPtr))
+ #include "Template/Template_Endpoint_RW.c"
+
+ #define TEMPLATE_FUNC_NAME Endpoint_Write_EStream_BE
+ #define TEMPLATE_BUFFER_TYPE const void*
+ #define TEMPLATE_CLEAR_ENDPOINT() Endpoint_ClearIN()
+ #define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1)
+ #define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr -= Amount
+ #define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(eeprom_read_byte(BufferPtr))
+ #include "Template/Template_Endpoint_RW.c"
+
+ #define TEMPLATE_FUNC_NAME Endpoint_Read_EStream_LE
+ #define TEMPLATE_BUFFER_TYPE void*
+ #define TEMPLATE_CLEAR_ENDPOINT() Endpoint_ClearOUT()
+ #define TEMPLATE_BUFFER_OFFSET(Length) 0
+ #define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr += Amount
+ #define TEMPLATE_TRANSFER_BYTE(BufferPtr) eeprom_update_byte(BufferPtr, Endpoint_Read_Byte())
+ #include "Template/Template_Endpoint_RW.c"
+
+ #define TEMPLATE_FUNC_NAME Endpoint_Read_EStream_BE
+ #define TEMPLATE_BUFFER_TYPE void*
+ #define TEMPLATE_CLEAR_ENDPOINT() Endpoint_ClearOUT()
+ #define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1)
+ #define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr -= Amount
+ #define TEMPLATE_TRANSFER_BYTE(BufferPtr) eeprom_update_byte(BufferPtr, Endpoint_Read_Byte())
+ #include "Template/Template_Endpoint_RW.c"
+#endif
#endif
@@ -202,58 +206,62 @@ uint8_t Endpoint_Null_Stream(uint16_t Length,
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(*BufferPtr)
#include "Template/Template_Endpoint_Control_W.c"
-#define TEMPLATE_FUNC_NAME Endpoint_Write_Control_PStream_LE
-#define TEMPLATE_BUFFER_OFFSET(Length) 0
-#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr += Amount
-#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(pgm_read_byte(BufferPtr))
-#include "Template/Template_Endpoint_Control_W.c"
-
-#define TEMPLATE_FUNC_NAME Endpoint_Write_Control_EStream_LE
-#define TEMPLATE_BUFFER_OFFSET(Length) 0
-#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr += Amount
-#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(eeprom_read_byte(BufferPtr))
-#include "Template/Template_Endpoint_Control_W.c"
-
#define TEMPLATE_FUNC_NAME Endpoint_Write_Control_Stream_BE
#define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1)
#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr -= Amount
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(*BufferPtr)
#include "Template/Template_Endpoint_Control_W.c"
-#define TEMPLATE_FUNC_NAME Endpoint_Write_Control_PStream_BE
-#define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1)
-#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr -= Amount
-#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(pgm_read_byte(BufferPtr))
-#include "Template/Template_Endpoint_Control_W.c"
-
-#define TEMPLATE_FUNC_NAME Endpoint_Write_Control_EStream_BE
-#define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1)
-#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr -= Amount
-#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(eeprom_read_byte(BufferPtr))
-#include "Template/Template_Endpoint_Control_W.c"
-
#define TEMPLATE_FUNC_NAME Endpoint_Read_Control_Stream_LE
#define TEMPLATE_BUFFER_OFFSET(Length) 0
#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr += Amount
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) *BufferPtr = Endpoint_Read_Byte()
#include "Template/Template_Endpoint_Control_R.c"
-#define TEMPLATE_FUNC_NAME Endpoint_Read_Control_EStream_LE
-#define TEMPLATE_BUFFER_OFFSET(Length) 0
-#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr += Amount
-#define TEMPLATE_TRANSFER_BYTE(BufferPtr) eeprom_update_byte(BufferPtr, Endpoint_Read_Byte())
-#include "Template/Template_Endpoint_Control_R.c"
-
#define TEMPLATE_FUNC_NAME Endpoint_Read_Control_Stream_BE
#define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1)
#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr -= Amount
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) *BufferPtr = Endpoint_Read_Byte()
#include "Template/Template_Endpoint_Control_R.c"
-#define TEMPLATE_FUNC_NAME Endpoint_Read_Control_EStream_BE
-#define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1)
-#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr -= Amount
-#define TEMPLATE_TRANSFER_BYTE(BufferPtr) eeprom_update_byte(BufferPtr, Endpoint_Read_Byte())
-#include "Template/Template_Endpoint_Control_R.c"
+#if defined(ARCH_HAS_FLASH_ADDRESS_SPACE)
+ #define TEMPLATE_FUNC_NAME Endpoint_Write_Control_PStream_LE
+ #define TEMPLATE_BUFFER_OFFSET(Length) 0
+ #define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr += Amount
+ #define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(pgm_read_byte(BufferPtr))
+ #include "Template/Template_Endpoint_Control_W.c"
+
+ #define TEMPLATE_FUNC_NAME Endpoint_Write_Control_PStream_BE
+ #define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1)
+ #define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr -= Amount
+ #define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(pgm_read_byte(BufferPtr))
+ #include "Template/Template_Endpoint_Control_W.c"
+#endif
+
+#if defined(ARCH_HAS_EEPROM_ADDRESS_SPACE)
+ #define TEMPLATE_FUNC_NAME Endpoint_Write_Control_EStream_LE
+ #define TEMPLATE_BUFFER_OFFSET(Length) 0
+ #define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr += Amount
+ #define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(eeprom_read_byte(BufferPtr))
+ #include "Template/Template_Endpoint_Control_W.c"
+
+ #define TEMPLATE_FUNC_NAME Endpoint_Write_Control_EStream_BE
+ #define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1)
+ #define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr -= Amount
+ #define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(eeprom_read_byte(BufferPtr))
+ #include "Template/Template_Endpoint_Control_W.c"
+
+ #define TEMPLATE_FUNC_NAME Endpoint_Read_Control_EStream_LE
+ #define TEMPLATE_BUFFER_OFFSET(Length) 0
+ #define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr += Amount
+ #define TEMPLATE_TRANSFER_BYTE(BufferPtr) eeprom_update_byte(BufferPtr, Endpoint_Read_Byte())
+ #include "Template/Template_Endpoint_Control_R.c"
+
+ #define TEMPLATE_FUNC_NAME Endpoint_Read_Control_EStream_BE
+ #define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1)
+ #define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr -= Amount
+ #define TEMPLATE_TRANSFER_BYTE(BufferPtr) eeprom_update_byte(BufferPtr, Endpoint_Read_Byte())
+ #include "Template/Template_Endpoint_Control_R.c"
+#endif
#endif
diff --git a/LUFA/Drivers/USB/Core/EndpointStream.h b/LUFA/Drivers/USB/Core/EndpointStream.h
index 02a34834..b4454a33 100644
--- a/LUFA/Drivers/USB/Core/EndpointStream.h
+++ b/LUFA/Drivers/USB/Core/EndpointStream.h
@@ -467,8 +467,11 @@
/** \name Stream functions for EEPROM source/destination data */
//@{
+ #if defined(ARCH_HAS_EEPROM_ADDRESS_SPACE) || defined(__DOXYGEN__)
/** EEPROM buffer source version of \ref Endpoint_Write_Stream_LE().
*
+ * \note This function is not available on all architectures.
+ *
* \param[in] Buffer Pointer to the source data buffer to read from.
* \param[in] Length Number of bytes to read for the currently selected endpoint into the buffer.
* \param[in] BytesProcessed Pointer to a location where the total number of bytes processed in the current
@@ -482,6 +485,8 @@
/** EEPROM buffer source version of \ref Endpoint_Write_Stream_BE().
*
+ * \note This function is not available on all architectures.
+ *
* \param[in] Buffer Pointer to the source data buffer to read from.
* \param[in] Length Number of bytes to read for the currently selected endpoint into the buffer.
* \param[in] BytesProcessed Pointer to a location where the total number of bytes processed in the current
@@ -495,6 +500,8 @@
/** EEPROM buffer source version of \ref Endpoint_Read_Stream_LE().
*
+ * \note This function is not available on all architectures.
+ *
* \param[out] Buffer Pointer to the destination data buffer to write to, located in EEPROM memory space.
* \param[in] Length Number of bytes to send via the currently selected endpoint.
* \param[in] BytesProcessed Pointer to a location where the total number of bytes processed in the current
@@ -508,6 +515,8 @@
/** EEPROM buffer source version of \ref Endpoint_Read_Stream_BE().
*
+ * \note This function is not available on all architectures.
+ *
* \param[out] Buffer Pointer to the destination data buffer to write to, located in EEPROM memory space.
* \param[in] Length Number of bytes to send via the currently selected endpoint.
* \param[in] BytesProcessed Pointer to a location where the total number of bytes processed in the current
@@ -526,6 +535,9 @@
* \n\n
*
* \note This routine should only be used on CONTROL type endpoints.
+ * \n\n
+ *
+ * \note This function is not available on all architectures.
*
* \warning Unlike the standard stream read/write commands, the control stream commands cannot be chained
* together; i.e. the entire stream data must be read or written at the one time.
@@ -545,6 +557,9 @@
* \n\n
*
* \note This routine should only be used on CONTROL type endpoints.
+ * \n\n
+ *
+ * \note This function is not available on all architectures.
*
* \warning Unlike the standard stream read/write commands, the control stream commands cannot be chained
* together; i.e. the entire stream data must be read or written at the one time.
@@ -564,6 +579,9 @@
* \n\n
*
* \note This routine should only be used on CONTROL type endpoints.
+ * \n\n
+ *
+ * \note This function is not available on all architectures.
*
* \warning Unlike the standard stream read/write commands, the control stream commands cannot be chained
* together; i.e. the entire stream data must be read or written at the one time.
@@ -583,6 +601,9 @@
* \n\n
*
* \note This routine should only be used on CONTROL type endpoints.
+ * \n\n
+ *
+ * \note This function is not available on all architectures.
*
* \warning Unlike the standard stream read/write commands, the control stream commands cannot be chained
* together; i.e. the entire stream data must be read or written at the one time.
@@ -594,15 +615,19 @@
*/
uint8_t Endpoint_Read_Control_EStream_BE(void* const Buffer,
uint16_t Length) ATTR_NON_NULL_PTR_ARG(1);
+ #endif
//@}
/** \name Stream functions for PROGMEM source/destination data */
//@{
+ #if defined(ARCH_HAS_FLASH_ADDRESS_SPACE) || defined(__DOXYGEN__)
/** FLASH buffer source version of \ref Endpoint_Write_Stream_LE().
*
* \pre The FLASH data must be located in the first 64KB of FLASH for this function to work correctly.
*
+ * \note This function is not available on all architectures.
+ *
* \param[in] Buffer Pointer to the source data buffer to read from.
* \param[in] Length Number of bytes to read for the currently selected endpoint into the buffer.
* \param[in] BytesProcessed Pointer to a location where the total number of bytes processed in the current
@@ -618,6 +643,8 @@
*
* \pre The FLASH data must be located in the first 64KB of FLASH for this function to work correctly.
*
+ * \note This function is not available on all architectures.
+ *
* \param[in] Buffer Pointer to the source data buffer to read from.
* \param[in] Length Number of bytes to read for the currently selected endpoint into the buffer.
* \param[in] BytesProcessed Pointer to a location where the total number of bytes processed in the current
@@ -638,6 +665,9 @@
* \n\n
*
* \note This routine should only be used on CONTROL type endpoints.
+ * \n\n
+ *
+ * \note This function is not available on all architectures.
*
* \warning Unlike the standard stream read/write commands, the control stream commands cannot be chained
* together; i.e. the entire stream data must be read or written at the one time.
@@ -659,6 +689,9 @@
* \n\n
*
* \note This routine should only be used on CONTROL type endpoints.
+ * \n\n
+ *
+ * \note This function is not available on all architectures.
*
* \warning Unlike the standard stream read/write commands, the control stream commands cannot be chained
* together; i.e. the entire stream data must be read or written at the one time.
@@ -670,6 +703,7 @@
*/
uint8_t Endpoint_Write_Control_PStream_BE(const void* const Buffer,
uint16_t Length) ATTR_NON_NULL_PTR_ARG(1);
+ #endif
//@}
/* Disable C linkage for C++ Compilers: */
diff --git a/LUFA/Drivers/USB/Core/PipeStream.c b/LUFA/Drivers/USB/Core/PipeStream.c
index 4465471a..66babf4a 100644
--- a/LUFA/Drivers/USB/Core/PipeStream.c
+++ b/LUFA/Drivers/USB/Core/PipeStream.c
@@ -131,24 +131,6 @@ uint8_t Pipe_Null_Stream(uint16_t Length,
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Pipe_Write_Byte(*BufferPtr)
#include "Template/Template_Pipe_RW.c"
-#define TEMPLATE_FUNC_NAME Pipe_Write_PStream_LE
-#define TEMPLATE_BUFFER_TYPE const void*
-#define TEMPLATE_TOKEN PIPE_TOKEN_OUT
-#define TEMPLATE_CLEAR_PIPE() Pipe_ClearOUT()
-#define TEMPLATE_BUFFER_OFFSET(Length) 0
-#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) DataStream += Amount
-#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Pipe_Write_Byte(pgm_read_byte(BufferPtr))
-#include "Template/Template_Pipe_RW.c"
-
-#define TEMPLATE_FUNC_NAME Pipe_Write_EStream_LE
-#define TEMPLATE_BUFFER_TYPE const void*
-#define TEMPLATE_TOKEN PIPE_TOKEN_OUT
-#define TEMPLATE_CLEAR_PIPE() Pipe_ClearOUT()
-#define TEMPLATE_BUFFER_OFFSET(Length) 0
-#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) DataStream += Amount
-#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Pipe_Write_Byte(eeprom_read_byte(BufferPtr))
-#include "Template/Template_Pipe_RW.c"
-
#define TEMPLATE_FUNC_NAME Pipe_Write_Stream_BE
#define TEMPLATE_BUFFER_TYPE const void*
#define TEMPLATE_TOKEN PIPE_TOKEN_OUT
@@ -158,24 +140,6 @@ uint8_t Pipe_Null_Stream(uint16_t Length,
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Pipe_Write_Byte(*BufferPtr)
#include "Template/Template_Pipe_RW.c"
-#define TEMPLATE_FUNC_NAME Pipe_Write_PStream_BE
-#define TEMPLATE_BUFFER_TYPE const void*
-#define TEMPLATE_TOKEN PIPE_TOKEN_OUT
-#define TEMPLATE_CLEAR_PIPE() Pipe_ClearOUT()
-#define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1)
-#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) DataStream -= Amount
-#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Pipe_Write_Byte(pgm_read_byte(BufferPtr))
-#include "Template/Template_Pipe_RW.c"
-
-#define TEMPLATE_FUNC_NAME Pipe_Write_EStream_BE
-#define TEMPLATE_BUFFER_TYPE const void*
-#define TEMPLATE_TOKEN PIPE_TOKEN_OUT
-#define TEMPLATE_CLEAR_PIPE() Pipe_ClearOUT()
-#define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1)
-#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) DataStream -= Amount
-#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Pipe_Write_Byte(eeprom_read_byte(BufferPtr))
-#include "Template/Template_Pipe_RW.c"
-
#define TEMPLATE_FUNC_NAME Pipe_Read_Stream_LE
#define TEMPLATE_BUFFER_TYPE void*
#define TEMPLATE_TOKEN PIPE_TOKEN_IN
@@ -185,15 +149,6 @@ uint8_t Pipe_Null_Stream(uint16_t Length,
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) *BufferPtr = Pipe_Read_Byte()
#include "Template/Template_Pipe_RW.c"
-#define TEMPLATE_FUNC_NAME Pipe_Read_EStream_LE
-#define TEMPLATE_BUFFER_TYPE void*
-#define TEMPLATE_TOKEN PIPE_TOKEN_IN
-#define TEMPLATE_CLEAR_PIPE() Pipe_ClearIN()
-#define TEMPLATE_BUFFER_OFFSET(Length) 0
-#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) DataStream += Amount
-#define TEMPLATE_TRANSFER_BYTE(BufferPtr) eeprom_update_byte(BufferPtr, Pipe_Read_Byte())
-#include "Template/Template_Pipe_RW.c"
-
#define TEMPLATE_FUNC_NAME Pipe_Read_Stream_BE
#define TEMPLATE_BUFFER_TYPE void*
#define TEMPLATE_TOKEN PIPE_TOKEN_IN
@@ -203,14 +158,63 @@ uint8_t Pipe_Null_Stream(uint16_t Length,
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) *BufferPtr = Pipe_Read_Byte()
#include "Template/Template_Pipe_RW.c"
-#define TEMPLATE_FUNC_NAME Pipe_Read_EStream_BE
-#define TEMPLATE_BUFFER_TYPE void*
-#define TEMPLATE_TOKEN PIPE_TOKEN_IN
-#define TEMPLATE_CLEAR_PIPE() Pipe_ClearIN()
-#define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1)
-#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) DataStream -= Amount
-#define TEMPLATE_TRANSFER_BYTE(BufferPtr) eeprom_update_byte(BufferPtr, Pipe_Read_Byte())
-#include "Template/Template_Pipe_RW.c"
+#if defined(ARCH_HAS_FLASH_ADDRESS_SPACE)
+ #define TEMPLATE_FUNC_NAME Pipe_Write_PStream_LE
+ #define TEMPLATE_BUFFER_TYPE const void*
+ #define TEMPLATE_TOKEN PIPE_TOKEN_OUT
+ #define TEMPLATE_CLEAR_PIPE() Pipe_ClearOUT()
+ #define TEMPLATE_BUFFER_OFFSET(Length) 0
+ #define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) DataStream += Amount
+ #define TEMPLATE_TRANSFER_BYTE(BufferPtr) Pipe_Write_Byte(pgm_read_byte(BufferPtr))
+ #include "Template/Template_Pipe_RW.c"
+
+ #define TEMPLATE_FUNC_NAME Pipe_Write_PStream_BE
+ #define TEMPLATE_BUFFER_TYPE const void*
+ #define TEMPLATE_TOKEN PIPE_TOKEN_OUT
+ #define TEMPLATE_CLEAR_PIPE() Pipe_ClearOUT()
+ #define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1)
+ #define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) DataStream -= Amount
+ #define TEMPLATE_TRANSFER_BYTE(BufferPtr) Pipe_Write_Byte(pgm_read_byte(BufferPtr))
+ #include "Template/Template_Pipe_RW.c"
+#endif
+
+#if defined(ARCH_HAS_EEPROM_ADDRESS_SPACE)
+ #define TEMPLATE_FUNC_NAME Pipe_Write_EStream_LE
+ #define TEMPLATE_BUFFER_TYPE const void*
+ #define TEMPLATE_TOKEN PIPE_TOKEN_OUT
+ #define TEMPLATE_CLEAR_PIPE() Pipe_ClearOUT()
+ #define TEMPLATE_BUFFER_OFFSET(Length) 0
+ #define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) DataStream += Amount
+ #define TEMPLATE_TRANSFER_BYTE(BufferPtr) Pipe_Write_Byte(eeprom_read_byte(BufferPtr))
+ #include "Template/Template_Pipe_RW.c"
+
+ #define TEMPLATE_FUNC_NAME Pipe_Write_EStream_BE
+ #define TEMPLATE_BUFFER_TYPE const void*
+ #define TEMPLATE_TOKEN PIPE_TOKEN_OUT
+ #define TEMPLATE_CLEAR_PIPE() Pipe_ClearOUT()
+ #define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1)
+ #define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) DataStream -= Amount
+ #define TEMPLATE_TRANSFER_BYTE(BufferPtr) Pipe_Write_Byte(eeprom_read_byte(BufferPtr))
+ #include "Template/Template_Pipe_RW.c"
+
+ #define TEMPLATE_FUNC_NAME Pipe_Read_EStream_LE
+ #define TEMPLATE_BUFFER_TYPE void*
+ #define TEMPLATE_TOKEN PIPE_TOKEN_IN
+ #define TEMPLATE_CLEAR_PIPE() Pipe_ClearIN()
+ #define TEMPLATE_BUFFER_OFFSET(Length) 0
+ #define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) DataStream += Amount
+ #define TEMPLATE_TRANSFER_BYTE(BufferPtr) eeprom_update_byte(BufferPtr, Pipe_Read_Byte())
+ #include "Template/Template_Pipe_RW.c"
+
+ #define TEMPLATE_FUNC_NAME Pipe_Read_EStream_BE
+ #define TEMPLATE_BUFFER_TYPE void*
+ #define TEMPLATE_TOKEN PIPE_TOKEN_IN
+ #define TEMPLATE_CLEAR_PIPE() Pipe_ClearIN()
+ #define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1)
+ #define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) DataStream -= Amount
+ #define TEMPLATE_TRANSFER_BYTE(BufferPtr) eeprom_update_byte(BufferPtr, Pipe_Read_Byte())
+ #include "Template/Template_Pipe_RW.c"
+#endif
#endif
diff --git a/LUFA/Drivers/USB/Core/PipeStream.h b/LUFA/Drivers/USB/Core/PipeStream.h
index c579631d..c914fc14 100644
--- a/LUFA/Drivers/USB/Core/PipeStream.h
+++ b/LUFA/Drivers/USB/Core/PipeStream.h
@@ -363,8 +363,11 @@
/** \name Stream functions for EEPROM source/destination data */
//@{
+ #if defined(ARCH_HAS_EEPROM_ADDRESS_SPACE) || defined(__DOXYGEN__)
/** EEPROM buffer source version of \ref Pipe_Write_Stream_LE().
*
+ * \note This function is not available on all architectures.
+ *
* \param[in] Buffer Pointer to the source data buffer to read from.
* \param[in] Length Number of bytes to read for the currently selected pipe into the buffer.
* \param[in] BytesProcessed Pointer to a location where the total number of bytes already processed should
@@ -378,6 +381,8 @@
/** EEPROM buffer source version of \ref Pipe_Write_Stream_BE().
*
+ * \note This function is not available on all architectures.
+ *
* \param[in] Buffer Pointer to the source data buffer to read from.
* \param[in] Length Number of bytes to read for the currently selected pipe into the buffer.
* \param[in] BytesProcessed Pointer to a location where the total number of bytes already processed should
@@ -391,6 +396,8 @@
/** EEPROM buffer source version of \ref Pipe_Read_Stream_LE().
*
+ * \note This function is not available on all architectures.
+ *
* \param[out] Buffer Pointer to the source data buffer to write to.
* \param[in] Length Number of bytes to read for the currently selected pipe to read from.
* \param[in] BytesProcessed Pointer to a location where the total number of bytes already processed should
@@ -404,6 +411,8 @@
/** EEPROM buffer source version of \ref Pipe_Read_Stream_BE().
*
+ * \note This function is not available on all architectures.
+ *
* \param[out] Buffer Pointer to the source data buffer to write to.
* \param[in] Length Number of bytes to read for the currently selected pipe to read from.
* \param[in] BytesProcessed Pointer to a location where the total number of bytes already processed should
@@ -414,15 +423,19 @@
uint8_t Pipe_Read_EStream_BE(void* const Buffer,
uint16_t Length,
uint16_t* const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1);
+ #endif
//@}
/** \name Stream functions for PROGMEM source/destination data */
//@{
+ #if defined(ARCH_HAS_FLASH_ADDRESS_SPACE) || defined(__DOXYGEN__)
/** FLASH buffer source version of \ref Pipe_Write_Stream_LE().
*
* \pre The FLASH data must be located in the first 64KB of FLASH for this function to work correctly.
*
+ * \note This function is not available on all architectures.
+ *
* \param[in] Buffer Pointer to the source data buffer to read from.
* \param[in] Length Number of bytes to read for the currently selected pipe into the buffer.
* \param[in] BytesProcessed Pointer to a location where the total number of bytes already processed should
@@ -438,6 +451,8 @@
*
* \pre The FLASH data must be located in the first 64KB of FLASH for this function to work correctly.
*
+ * \note This function is not available on all architectures.
+ *
* \param[in] Buffer Pointer to the source data buffer to read from.
* \param[in] Length Number of bytes to read for the currently selected pipe into the buffer.
* \param[in] BytesProcessed Pointer to a location where the total number of bytes already processed should
@@ -448,6 +463,7 @@
uint8_t Pipe_Write_PStream_BE(const void* const Buffer,
uint16_t Length,
uint16_t* const BytesProcessed) ATTR_NON_NULL_PTR_ARG(1);
+ #endif
//@}
/* Disable C linkage for C++ Compilers: */
diff --git a/LUFA/Drivers/USB/Core/UC3/USBController_UC3.h b/LUFA/Drivers/USB/Core/UC3/USBController_UC3.h
index 8b29628e..da32b3ed 100644
--- a/LUFA/Drivers/USB/Core/UC3/USBController_UC3.h
+++ b/LUFA/Drivers/USB/Core/UC3/USBController_UC3.h
@@ -80,6 +80,10 @@
#error Do not include this file directly. Include LUFA/Drivers/USB/USB.h instead.
#endif
+ #if !defined(F_USB)
+ #error F_USB is not defined. You must define F_USB to the frequency of the clock input to the USB module.
+ #endif
+
/* Public Interface - May be used in end-application: */
/* Macros: */
/** \name USB Controller Option Masks */