projects
/
pub
/
lufa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Start porting the USB core to the AVR32 UC3B.
[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
3e25d49
..
08935e1
100644
(file)
--- a/
LUFA/Drivers/USB/LowLevel/Pipe.h
+++ b/
LUFA/Drivers/USB/LowLevel/Pipe.h
@@
-74,10
+74,16
@@
#define __PIPE_H__
\r
\r
/* Includes: */
\r
#define __PIPE_H__
\r
\r
/* Includes: */
\r
- #include <avr/io.h>
\r
- #include <avr/pgmspace.h>
\r
- #include <avr/eeprom.h>
\r
- #include <stdbool.h>
\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
\r
#include "../../../Common/Common.h"
\r
#include "../HighLevel/USBTask.h"
\r
\r
#include "../../../Common/Common.h"
\r
#include "../HighLevel/USBTask.h"
\r
@@
-547,7
+553,11
@@
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 0; // TODO
\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
@@
-559,7
+569,11
@@
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
+ // TODO
\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
@@
-571,7
+585,11
@@
{
\r
uint8_t Dummy;
\r
\r
{
\r
uint8_t Dummy;
\r
\r
+ #if defined(__AVR32__)
\r
+ // TODO
\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
@@
-590,8
+608,12
@@
uint8_t Bytes[2];
\r
} Data;
\r
\r
uint8_t Bytes[2];
\r
} Data;
\r
\r
+ #if defined(__AVR32__)
\r
+ // TODO
\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
@@
-612,8
+634,12
@@
uint8_t Bytes[2];
\r
} Data;
\r
\r
uint8_t Bytes[2];
\r
} Data;
\r
\r
+ #if defined(__AVR32__)
\r
+ // TODO
\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
@@
-628,8
+654,12
@@
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
+ // TODO
\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
@@
-642,8
+672,12
@@
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
+ // TODO
\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
@@
-655,8
+689,12
@@
{
\r
uint8_t Dummy;
\r
\r
{
\r
uint8_t Dummy;
\r
\r
+ #if defined(__AVR32__)
\r
+ // TODO
\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
@@
-675,10
+713,14
@@
uint8_t Bytes[4];
\r
} Data;
\r
\r
uint8_t Bytes[4];
\r
} Data;
\r
\r
+ #if defined(__AVR32__)
\r
+ // TODO
\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
@@
-699,6
+741,9
@@
uint8_t Bytes[4];
\r
} Data;
\r
\r
uint8_t Bytes[4];
\r
} Data;
\r
\r
+ #if defined(__AVR32__)
\r
+ // TODO
\r
+ #elif defined(__AVR__)
\r
Data.Bytes[3] = UPDATX;
\r
Data.Bytes[2] = UPDATX;
\r
Data.Bytes[1] = UPDATX;
\r
Data.Bytes[3] = UPDATX;
\r
Data.Bytes[2] = UPDATX;
\r
Data.Bytes[1] = UPDATX;
\r
@@
-717,10
+762,14
@@
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
+ // TODO
\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
@@
-733,10
+782,14
@@
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
+ // TODO
\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
@@
-748,10
+801,14
@@
{
\r
uint8_t Dummy;
\r
\r
{
\r
uint8_t Dummy;
\r
\r
+ #if defined(__AVR32__)
\r
+ // TODO
\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