projects
/
pub
/
lufa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Revert changes made for the partial port to the AVR32 architecture.
[pub/lufa.git]
/
LUFA
/
Drivers
/
USB
/
LowLevel
/
Pipe.h
diff --git
a/LUFA/Drivers/USB/LowLevel/Pipe.h
b/LUFA/Drivers/USB/LowLevel/Pipe.h
index
ab11a55
..
3e25d49
100644
(file)
--- a/
LUFA/Drivers/USB/LowLevel/Pipe.h
+++ b/
LUFA/Drivers/USB/LowLevel/Pipe.h
@@
-74,19
+74,12
@@
#define __PIPE_H__
\r
\r
/* Includes: */
\r
#define __PIPE_H__
\r
\r
/* Includes: */
\r
- #if defined(__AVR32__)
\r
- #include <avr32/io.h>
\r
- #include <stdint.h>
\r
- #include <stdbool.h>
\r
- #elif defined(__AVR__)
\r
- #include <avr/io.h>
\r
- #include <avr/pgmspace.h>
\r
- #include <avr/eeprom.h>
\r
- #include <stdbool.h>
\r
- #endif
\r
+ #include <avr/io.h>
\r
+ #include <avr/pgmspace.h>
\r
+ #include <avr/eeprom.h>
\r
+ #include <stdbool.h>
\r
\r
#include "../../../Common/Common.h"
\r
\r
#include "../../../Common/Common.h"
\r
- #include "LowLevel.h"
\r
#include "../HighLevel/USBTask.h"
\r
\r
#if !defined(NO_STREAM_CALLBACKS) || defined(__DOXYGEN__)
\r
#include "../HighLevel/USBTask.h"
\r
\r
#if !defined(NO_STREAM_CALLBACKS) || defined(__DOXYGEN__)
\r
@@
-100,13
+93,9
@@
\r
/* Preprocessor Checks: */
\r
#if !defined(__INCLUDE_FROM_USB_DRIVER)
\r
\r
/* Preprocessor Checks: */
\r
#if !defined(__INCLUDE_FROM_USB_DRIVER)
\r
- #error Do not include this file directly. Include LUFA/Drivers/USB
/USB
.h instead.
\r
+ #error Do not include this file directly. Include LUFA/Drivers/USB.h instead.
\r
#endif
\r
\r
#endif
\r
\r
- #if defined(__AVR32__) && !defined(__AVR32_EPREG_X)
\r
- #define __AVR32_EPREG_X(x) ((volatile uint32_t*)AVR32_USBB_ ## x)[USB_SelectedEPNumber]
\r
- #endif
\r
-
\r
/* Public Interface - May be used in end-application: */
\r
/* Macros: */
\r
/** Mask for \ref Pipe_GetErrorFlags(), indicating that an overflow error occurred in the pipe on the received data. */
\r
/* Public Interface - May be used in end-application: */
\r
/* Macros: */
\r
/** Mask for \ref Pipe_GetErrorFlags(), indicating that an overflow error occurred in the pipe on the received data. */
\r
@@
-558,11
+547,7
@@
static inline uint8_t Pipe_Read_Byte(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
\r
static inline uint8_t Pipe_Read_Byte(void)
\r
{
\r
static inline uint8_t Pipe_Read_Byte(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
\r
static inline uint8_t Pipe_Read_Byte(void)
\r
{
\r
- #if defined(__AVR32__)
\r
- return __AVR32_EPREG_X(UEDAT0);
\r
- #elif defined(__AVR__)
\r
return UPDATX;
\r
return UPDATX;
\r
- #endif
\r
}
\r
\r
/** Writes one byte from the currently selected pipe's bank, for IN direction pipes.
\r
}
\r
\r
/** Writes one byte from the currently selected pipe's bank, for IN direction pipes.
\r
@@
-574,11
+559,7
@@
static inline void Pipe_Write_Byte(const uint8_t Byte) ATTR_ALWAYS_INLINE;
\r
static inline void Pipe_Write_Byte(const uint8_t Byte)
\r
{
\r
static inline void Pipe_Write_Byte(const uint8_t Byte) ATTR_ALWAYS_INLINE;
\r
static inline void Pipe_Write_Byte(const uint8_t Byte)
\r
{
\r
- #if defined(__AVR32__)
\r
- __AVR32_EPREG_X(UEDAT0) = Byte;
\r
- #elif defined(__AVR__)
\r
UPDATX = Byte;
\r
UPDATX = Byte;
\r
- #endif
\r
}
\r
\r
/** Discards one byte from the currently selected pipe's bank, for OUT direction pipes.
\r
}
\r
\r
/** Discards one byte from the currently selected pipe's bank, for OUT direction pipes.
\r
@@
-590,11
+571,7
@@
{
\r
uint8_t Dummy;
\r
\r
{
\r
uint8_t Dummy;
\r
\r
- #if defined(__AVR32__)
\r
- Dummy = __AVR32_EPREG_X(UEDAT0);
\r
- #elif defined(__AVR__)
\r
Dummy = UPDATX;
\r
Dummy = UPDATX;
\r
- #endif
\r
}
\r
\r
/** Reads two bytes from the currently selected pipe's bank in little endian format, for OUT
\r
}
\r
\r
/** Reads two bytes from the currently selected pipe's bank in little endian format, for OUT
\r
@@
-613,13
+590,8
@@
uint8_t Bytes[2];
\r
} Data;
\r
\r
uint8_t Bytes[2];
\r
} Data;
\r
\r
- #if defined(__AVR32__)
\r
- Data.Bytes[0] = __AVR32_EPREG_X(UEDAT0);
\r
- Data.Bytes[1] = __AVR32_EPREG_X(UEDAT0);
\r
- #elif defined(__AVR__)
\r
Data.Bytes[0] = UPDATX;
\r
Data.Bytes[1] = UPDATX;
\r
Data.Bytes[0] = UPDATX;
\r
Data.Bytes[1] = UPDATX;
\r
- #endif
\r
\r
return Data.Word;
\r
}
\r
\r
return Data.Word;
\r
}
\r
@@
-640,13
+612,8
@@
uint8_t Bytes[2];
\r
} Data;
\r
\r
uint8_t Bytes[2];
\r
} Data;
\r
\r
- #if defined(__AVR32__)
\r
- Data.Bytes[1] = __AVR32_EPREG_X(UEDAT0);
\r
- Data.Bytes[0] = __AVR32_EPREG_X(UEDAT0);
\r
- #elif defined(__AVR__)
\r
Data.Bytes[1] = UPDATX;
\r
Data.Bytes[0] = UPDATX;
\r
Data.Bytes[1] = UPDATX;
\r
Data.Bytes[0] = UPDATX;
\r
- #endif
\r
\r
return Data.Word;
\r
}
\r
\r
return Data.Word;
\r
}
\r
@@
-661,13
+628,8
@@
static inline void Pipe_Write_Word_LE(const uint16_t Word) ATTR_ALWAYS_INLINE;
\r
static inline void Pipe_Write_Word_LE(const uint16_t Word)
\r
{
\r
static inline void Pipe_Write_Word_LE(const uint16_t Word) ATTR_ALWAYS_INLINE;
\r
static inline void Pipe_Write_Word_LE(const uint16_t Word)
\r
{
\r
- #if defined(__AVR32__)
\r
- __AVR32_EPREG_X(UEDAT0) = (Word & 0xFF);
\r
- __AVR32_EPREG_X(UEDAT0) = (Word >> 8);
\r
- #elif defined(__AVR__)
\r
UPDATX = (Word & 0xFF);
\r
UPDATX = (Word >> 8);
\r
UPDATX = (Word & 0xFF);
\r
UPDATX = (Word >> 8);
\r
- #endif
\r
}
\r
\r
/** Writes two bytes to the currently selected pipe's bank in big endian format, for IN
\r
}
\r
\r
/** Writes two bytes to the currently selected pipe's bank in big endian format, for IN
\r
@@
-680,13
+642,8
@@
static inline void Pipe_Write_Word_BE(const uint16_t Word) ATTR_ALWAYS_INLINE;
\r
static inline void Pipe_Write_Word_BE(const uint16_t Word)
\r
{
\r
static inline void Pipe_Write_Word_BE(const uint16_t Word) ATTR_ALWAYS_INLINE;
\r
static inline void Pipe_Write_Word_BE(const uint16_t Word)
\r
{
\r
- #if defined(__AVR32__)
\r
- __AVR32_EPREG_X(UEDAT0) = (Word >> 8);
\r
- __AVR32_EPREG_X(UEDAT0) = (Word & 0xFF);
\r
- #elif defined(__AVR__)
\r
UPDATX = (Word >> 8);
\r
UPDATX = (Word & 0xFF);
\r
UPDATX = (Word >> 8);
\r
UPDATX = (Word & 0xFF);
\r
- #endif
\r
}
\r
\r
/** Discards two bytes from the currently selected pipe's bank, for OUT direction pipes.
\r
}
\r
\r
/** Discards two bytes from the currently selected pipe's bank, for OUT direction pipes.
\r
@@
-698,13
+655,8
@@
{
\r
uint8_t Dummy;
\r
\r
{
\r
uint8_t Dummy;
\r
\r
- #if defined(__AVR32__)
\r
- Dummy = __AVR32_EPREG_X(UEDAT0);
\r
- Dummy = __AVR32_EPREG_X(UEDAT0);
\r
- #elif defined(__AVR__)
\r
Dummy = UPDATX;
\r
Dummy = UPDATX;
\r
Dummy = UPDATX;
\r
Dummy = UPDATX;
\r
- #endif
\r
}
\r
\r
/** Reads four bytes from the currently selected pipe's bank in little endian format, for OUT
\r
}
\r
\r
/** Reads four bytes from the currently selected pipe's bank in little endian format, for OUT
\r
@@
-723,17
+675,10
@@
uint8_t Bytes[4];
\r
} Data;
\r
\r
uint8_t Bytes[4];
\r
} Data;
\r
\r
- #if defined(__AVR32__)
\r
- Data.Bytes[0] = __AVR32_EPREG_X(UEDAT0);
\r
- Data.Bytes[1] = __AVR32_EPREG_X(UEDAT0);
\r
- Data.Bytes[2] = __AVR32_EPREG_X(UEDAT0);
\r
- Data.Bytes[3] = __AVR32_EPREG_X(UEDAT0);
\r
- #elif defined(__AVR__)
\r
Data.Bytes[0] = UPDATX;
\r
Data.Bytes[1] = UPDATX;
\r
Data.Bytes[2] = UPDATX;
\r
Data.Bytes[3] = UPDATX;
\r
Data.Bytes[0] = UPDATX;
\r
Data.Bytes[1] = UPDATX;
\r
Data.Bytes[2] = UPDATX;
\r
Data.Bytes[3] = UPDATX;
\r
- #endif
\r
\r
return Data.DWord;
\r
}
\r
\r
return Data.DWord;
\r
}
\r
@@
-754,17
+699,10
@@
uint8_t Bytes[4];
\r
} Data;
\r
\r
uint8_t Bytes[4];
\r
} Data;
\r
\r
- #if defined(__AVR32__)
\r
- Data.Bytes[3] = __AVR32_EPREG_X(UEDAT0);
\r
- Data.Bytes[2] = __AVR32_EPREG_X(UEDAT0);
\r
- Data.Bytes[1] = __AVR32_EPREG_X(UEDAT0);
\r
- Data.Bytes[0] = __AVR32_EPREG_X(UEDAT0);
\r
- #elif defined(__AVR__)
\r
Data.Bytes[3] = UPDATX;
\r
Data.Bytes[2] = UPDATX;
\r
Data.Bytes[1] = UPDATX;
\r
Data.Bytes[0] = UPDATX;
\r
Data.Bytes[3] = UPDATX;
\r
Data.Bytes[2] = UPDATX;
\r
Data.Bytes[1] = UPDATX;
\r
Data.Bytes[0] = UPDATX;
\r
- #endif
\r
\r
return Data.DWord;
\r
}
\r
\r
return Data.DWord;
\r
}
\r
@@
-779,17
+717,10
@@
static inline void Pipe_Write_DWord_LE(const uint32_t DWord) ATTR_ALWAYS_INLINE;
\r
static inline void Pipe_Write_DWord_LE(const uint32_t DWord)
\r
{
\r
static inline void Pipe_Write_DWord_LE(const uint32_t DWord) ATTR_ALWAYS_INLINE;
\r
static inline void Pipe_Write_DWord_LE(const uint32_t DWord)
\r
{
\r
- #if defined(__AVR32__)
\r
- __AVR32_EPREG_X(UEDAT0) = (DWord & 0xFF);
\r
- __AVR32_EPREG_X(UEDAT0) = (DWord >> 8);
\r
- __AVR32_EPREG_X(UEDAT0) = (DWord >> 16);
\r
- __AVR32_EPREG_X(UEDAT0) = (DWord >> 24);
\r
- #elif defined(__AVR__)
\r
UPDATX = (DWord & 0xFF);
\r
UPDATX = (DWord >> 8);
\r
UPDATX = (DWord >> 16);
\r
UPDATX = (DWord >> 24);
\r
UPDATX = (DWord & 0xFF);
\r
UPDATX = (DWord >> 8);
\r
UPDATX = (DWord >> 16);
\r
UPDATX = (DWord >> 24);
\r
- #endif
\r
}
\r
\r
/** Writes four bytes to the currently selected pipe's bank in big endian format, for IN
\r
}
\r
\r
/** Writes four bytes to the currently selected pipe's bank in big endian format, for IN
\r
@@
-802,17
+733,10
@@
static inline void Pipe_Write_DWord_BE(const uint32_t DWord) ATTR_ALWAYS_INLINE;
\r
static inline void Pipe_Write_DWord_BE(const uint32_t DWord)
\r
{
\r
static inline void Pipe_Write_DWord_BE(const uint32_t DWord) ATTR_ALWAYS_INLINE;
\r
static inline void Pipe_Write_DWord_BE(const uint32_t DWord)
\r
{
\r
- #if defined(__AVR32__)
\r
- __AVR32_EPREG_X(UEDAT0) = (DWord >> 24);
\r
- __AVR32_EPREG_X(UEDAT0) = (DWord >> 16);
\r
- __AVR32_EPREG_X(UEDAT0) = (DWord >> 8);
\r
- __AVR32_EPREG_X(UEDAT0) = (DWord & 0xFF);
\r
- #elif defined(__AVR__)
\r
UPDATX = (DWord >> 24);
\r
UPDATX = (DWord >> 16);
\r
UPDATX = (DWord >> 8);
\r
UPDATX = (DWord & 0xFF);
\r
UPDATX = (DWord >> 24);
\r
UPDATX = (DWord >> 16);
\r
UPDATX = (DWord >> 8);
\r
UPDATX = (DWord & 0xFF);
\r
- #endif
\r
}
\r
\r
/** Discards four bytes from the currently selected pipe's bank, for OUT direction pipes.
\r
}
\r
\r
/** Discards four bytes from the currently selected pipe's bank, for OUT direction pipes.
\r
@@
-824,17
+748,10
@@
{
\r
uint8_t Dummy;
\r
\r
{
\r
uint8_t Dummy;
\r
\r
- #if defined(__AVR32__)
\r
- Dummy = __AVR32_EPREG_X(UEDAT0);
\r
- Dummy = __AVR32_EPREG_X(UEDAT0);
\r
- Dummy = __AVR32_EPREG_X(UEDAT0);
\r
- Dummy = __AVR32_EPREG_X(UEDAT0);
\r
- #elif defined(__AVR__)
\r
Dummy = UPDATX;
\r
Dummy = UPDATX;
\r
Dummy = UPDATX;
\r
Dummy = UPDATX;
\r
Dummy = UPDATX;
\r
Dummy = UPDATX;
\r
Dummy = UPDATX;
\r
Dummy = UPDATX;
\r
- #endif
\r
}
\r
\r
/* External Variables: */
\r
}
\r
\r
/* External Variables: */
\r
@@
-958,8
+875,6
@@
* \param[in] Length Number of bytes to read for the currently selected pipe into the buffer.
\r
* \param[in] Callback Name of a callback routine to call between successive USB packet transfers, NULL if no callback
\r
*
\r
* \param[in] Length Number of bytes to read for the currently selected pipe into the buffer.
\r
* \param[in] Callback Name of a callback routine to call between successive USB packet transfers, NULL if no callback
\r
*
\r
- * \note Not available on AVR32 UC3B targets.
\r
- *
\r
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum.
\r
*/
\r
uint8_t Pipe_Write_EStream_LE(const void* Buffer, uint16_t Length __CALLBACK_PARAM) ATTR_NON_NULL_PTR_ARG(1);
\r
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum.
\r
*/
\r
uint8_t Pipe_Write_EStream_LE(const void* Buffer, uint16_t Length __CALLBACK_PARAM) ATTR_NON_NULL_PTR_ARG(1);
\r
@@
-1009,8
+924,6
@@
* \param[in] Length Number of bytes to read for the currently selected pipe into the buffer.
\r
* \param[in] Callback Name of a callback routine to call between successive USB packet transfers, NULL if no callback
\r
*
\r
* \param[in] Length Number of bytes to read for the currently selected pipe into the buffer.
\r
* \param[in] Callback Name of a callback routine to call between successive USB packet transfers, NULL if no callback
\r
*
\r
- * \note Not available on AVR32 UC3B targets.
\r
- *
\r
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum.
\r
*/
\r
uint8_t Pipe_Write_EStream_BE(const void* Buffer, uint16_t Length __CALLBACK_PARAM) ATTR_NON_NULL_PTR_ARG(1);
\r
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum.
\r
*/
\r
uint8_t Pipe_Write_EStream_BE(const void* Buffer, uint16_t Length __CALLBACK_PARAM) ATTR_NON_NULL_PTR_ARG(1);
\r
@@
-1060,8
+973,6
@@
* \param[in] Length Number of bytes to read for the currently selected pipe to read from.
\r
* \param[in] Callback Name of a callback routine to call between successive USB packet transfers, NULL if no callback
\r
*
\r
* \param[in] Length Number of bytes to read for the currently selected pipe to read from.
\r
* \param[in] Callback Name of a callback routine to call between successive USB packet transfers, NULL if no callback
\r
*
\r
- * \note Not available on AVR32 UC3B targets.
\r
- *
\r
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum.
\r
*/
\r
uint8_t Pipe_Read_EStream_LE(void* Buffer, uint16_t Length __CALLBACK_PARAM) ATTR_NON_NULL_PTR_ARG(1);
\r
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum.
\r
*/
\r
uint8_t Pipe_Read_EStream_LE(void* Buffer, uint16_t Length __CALLBACK_PARAM) ATTR_NON_NULL_PTR_ARG(1);
\r
@@
-1097,8
+1008,6
@@
* \param[in] Length Number of bytes to read for the currently selected pipe to read from.
\r
* \param[in] Callback Name of a callback routine to call between successive USB packet transfers, NULL if no callback
\r
*
\r
* \param[in] Length Number of bytes to read for the currently selected pipe to read from.
\r
* \param[in] Callback Name of a callback routine to call between successive USB packet transfers, NULL if no callback
\r
*
\r
- * \note Not available on AVR32 UC3B targets.
\r
- *
\r
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum.
\r
*/
\r
uint8_t Pipe_Read_EStream_BE(void* Buffer, uint16_t Length __CALLBACK_PARAM) ATTR_NON_NULL_PTR_ARG(1);
\r
* \return A value from the \ref Pipe_Stream_RW_ErrorCodes_t enum.
\r
*/
\r
uint8_t Pipe_Read_EStream_BE(void* Buffer, uint16_t Length __CALLBACK_PARAM) ATTR_NON_NULL_PTR_ARG(1);
\r
@@
-1119,13
+1028,9
@@
void Pipe_ClearPipes(void);
\r
\r
/* Inline Functions: */
\r
void Pipe_ClearPipes(void);
\r
\r
/* Inline Functions: */
\r
- static inline uint
N
_t Pipe_BytesToEPSizeMask(uint16_t Bytes) ATTR_WARN_UNUSED_RESULT ATTR_CONST ATTR_ALWAYS_INLINE;
\r
- static inline uint
N
_t Pipe_BytesToEPSizeMask(uint16_t Bytes)
\r
+ static inline uint
8
_t Pipe_BytesToEPSizeMask(uint16_t Bytes) ATTR_WARN_UNUSED_RESULT ATTR_CONST ATTR_ALWAYS_INLINE;
\r
+ static inline uint
8
_t Pipe_BytesToEPSizeMask(uint16_t Bytes)
\r
{
\r
{
\r
- #if defined(__AVR32__)
\r
- // TODO
\r
- return 0;
\r
- #elif defined(__AVR__)
\r
if (Bytes <= 8)
\r
return (0 << EPSIZE0);
\r
else if (Bytes <= 16)
\r
if (Bytes <= 8)
\r
return (0 << EPSIZE0);
\r
else if (Bytes <= 16)
\r
@@
-1138,7
+1043,6
@@
return (4 << EPSIZE0);
\r
else
\r
return (5 << EPSIZE0);
\r
return (4 << EPSIZE0);
\r
else
\r
return (5 << EPSIZE0);
\r
- #endif
\r
}
\r
\r
#endif
\r
}
\r
\r
#endif
\r