diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2011-03-05 11:34:04 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2011-03-05 11:34:04 +0000 |
commit | b763c3f33e8596afe2dd21746890fa9641362c5e (patch) | |
tree | 4253888dedfecf7500b3aaed743c5b0dfd88a840 /LUFA/Common | |
parent | 33a81bffb9e3f856c1d3446d7292795774ae91a8 (diff) | |
download | lufa-b763c3f33e8596afe2dd21746890fa9641362c5e.tar.gz lufa-b763c3f33e8596afe2dd21746890fa9641362c5e.tar.bz2 lufa-b763c3f33e8596afe2dd21746890fa9641362c5e.zip |
Porting updates for the UC3B architecture - get UC3B partially enumerating using a modified mouse demo on the EVK1101. Implement a software FIFO for the endpoint banks; datasheet hints that this can be done through hardware as on the AVR8 architecture, but the correct method to do this not discovered yet.
Diffstat (limited to 'LUFA/Common')
-rw-r--r-- | LUFA/Common/Attributes.h | 9 | ||||
-rw-r--r-- | LUFA/Common/Common.h | 41 |
2 files changed, 45 insertions, 5 deletions
diff --git a/LUFA/Common/Attributes.h b/LUFA/Common/Attributes.h index 8c4006990..62ce9f29e 100644 --- a/LUFA/Common/Attributes.h +++ b/LUFA/Common/Attributes.h @@ -133,6 +133,15 @@ * \param[in] Func Name of the function which the given function name should alias. */ #define ATTR_ALIAS(Func) __attribute__ ((alias( #Func ))) + + /** Marks a variable or struct element for packing into the smallest space available. */ + #define ATTR_PACKED __attribute__ ((packed)) + + /** Indicates the minimum alignment in bytes for a variable or struct element. + * + * \param[in] Bytes Minimum number of bytes the item should be aligned to. + */ + #define ATTR_ALIGNED(Bytes) __attribute__ ((aligned(Bytes))) #endif /** @} */ diff --git a/LUFA/Common/Common.h b/LUFA/Common/Common.h index 76e1be1e2..147ae8ebc 100644 --- a/LUFA/Common/Common.h +++ b/LUFA/Common/Common.h @@ -87,15 +87,50 @@ #include <util/delay.h> typedef uint8_t uint_reg_t; + + #define le16_to_cpu(x) x + #define le32_to_cpu(x) x + #define be16_to_cpu(x) SwapEndian_16(x) + #define be32_to_cpu(x) SwapEndian_32(x) + #define cpu_to_le16(x) x + #define cpu_to_le32(x) x + #define cpu_to_be16(x) SwapEndian_16(x) + #define cpu_to_be32(x) SwapEndian_32(x) + #define LE16_TO_CPU(x) x + #define LE32_TO_CPU(x) x + #define BE16_TO_CPU(x) SWAPENDIAN_16(x) + #define BE32_TO_CPU(x) SWAPENDIAN_32(x) + #define CPU_TO_LE16(x) x + #define CPU_TO_LE32(x) x + #define CPU_TO_BE16(x) SWAPENDIAN_16(x) + #define CPU_TO_BE32(x) SWAPENDIAN_32(x) + #elif (ARCH == ARCH_UC3B) #include <avr32/io.h> typedef uint32_t uint_reg_t; // TODO + #define le16_to_cpu(x) SwapEndian_16(x) + #define le32_to_cpu(x) SwapEndian_32(x) + #define be16_to_cpu(x) x + #define be32_to_cpu(x) x + #define cpu_to_le16(x) SwapEndian_16(x) + #define cpu_to_le32(x) SwapEndian_32(x) + #define cpu_to_be16(x) x + #define cpu_to_be32(x) x + #define LE16_TO_CPU(x) SWAPENDIAN_16(x) + #define LE32_TO_CPU(x) SWAPENDIAN_32(x) + #define BE16_TO_CPU(x) x + #define BE32_TO_CPU(x) x + #define CPU_TO_LE16(x) SWAPENDIAN_16(x) + #define CPU_TO_LE32(x) SWAPENDIAN_32(x) + #define CPU_TO_BE16(x) x + #define CPU_TO_BE32(x) x + + #define ISR(Name) void Name (void) __attribute__((__interrupt__)); void Name (void) #define EEMEM #define PROGMEM const - #define ISR(Name) void Name (void) __attribute__((__interrupt__)); void Name (void) #define ATOMIC_BLOCK(x) if (1) #define ATOMIC_RESTORESTATE #define pgm_read_byte(x) *x @@ -105,10 +140,6 @@ #define _delay_ms(x) #define memcmp_P(...) memcmp(__VA_ARGS__) #define memcpy_P(...) memcpy(__VA_ARGS__) - #define cpu_irq_enable() do { asm volatile("" ::: "memory"); __builtin_csrf(AVR32_SR_GM_OFFSET); } while (0) - #define cpu_irq_disable() do { __builtin_ssrf(AVR32_SR_GM_OFFSET); asm volatile("" ::: "memory"); } while (0) - - #warning The UC3B architecture support is currently experimental and incomplete! #endif /* Public Interface - May be used in end-application: */ |