Start porting the USB core to the AVR32 UC3B.

pull/1469/head
Dean Camera 15 years ago
parent e11fddfe66
commit 0e6d5cf5b4

@ -47,7 +47,11 @@
#define __CONFIGDESCRIPTOR_H__ #define __CONFIGDESCRIPTOR_H__
/* Includes: */ /* Includes: */
#if defined(__AVR32__)
#include <avr32/io.h>
#elif defined(__AVR__)
#include <avr/io.h> #include <avr/io.h>
#endif
#include "../../../Common/Common.h" #include "../../../Common/Common.h"
#include "../HighLevel/USBMode.h" #include "../HighLevel/USBMode.h"

@ -50,7 +50,11 @@
#define __USBEVENTS_H__ #define __USBEVENTS_H__
/* Includes: */ /* Includes: */
#if defined(__AVR32__)
#include <avr32/io.h>
#elif defined(__AVR__)
#include <avr/io.h> #include <avr/io.h>
#endif
#include "../../../Common/Common.h" #include "../../../Common/Common.h"
#include "USBMode.h" #include "USBMode.h"

@ -41,9 +41,16 @@
#define __USBDESCRIPTORS_H__ #define __USBDESCRIPTORS_H__
/* Includes: */ /* Includes: */
#if defined(__AVR32__)
#include <avr32/io.h>
#include <stdint.h>
#include <stdbool.h>
#include <stddef.h>
#elif defined(__AVR__)
#include <avr/pgmspace.h> #include <avr/pgmspace.h>
#include <stdbool.h> #include <stdbool.h>
#include <stddef.h> #include <stddef.h>
#endif
#include "../../../Common/Common.h" #include "../../../Common/Common.h"
#include "USBMode.h" #include "USBMode.h"

@ -32,8 +32,14 @@
#define __USBINTERRUPT_H__ #define __USBINTERRUPT_H__
/* Includes: */ /* Includes: */
#if defined(__AVR32__)
#include <avr32/io.h>
#include <stdbool.h>
#include <stdint.h>
#elif defined(__AVR__)
#include <avr/io.h> #include <avr/io.h>
#include <stdbool.h> #include <stdbool.h>
#endif
#include "../../../Common/Common.h" #include "../../../Common/Common.h"
#include "../LowLevel/LowLevel.h" #include "../LowLevel/LowLevel.h"

@ -70,6 +70,11 @@
*/ */
#define USB_SERIES_7_AVR #define USB_SERIES_7_AVR
/** Indicates that the target AVR microcontroller belongs to the Series UC3B USB controller
* (i.e. AT32UC3BXXXX) when defined.
*/
#define USB_SERIES_UC3B_AVR
/** Indicates that the target AVR microcontroller and compilation settings allow for the /** Indicates that the target AVR microcontroller and compilation settings allow for the
* target to be configured in USB Device mode when defined. * target to be configured in USB Device mode when defined.
*/ */
@ -95,9 +100,11 @@
#define USB_SERIES_6_AVR #define USB_SERIES_6_AVR
#elif (defined(__AVR_AT90USB647__) || defined(__AVR_AT90USB1287__)) #elif (defined(__AVR_AT90USB647__) || defined(__AVR_AT90USB1287__))
#define USB_SERIES_7_AVR #define USB_SERIES_7_AVR
#elif (defined(__AVR32_UC3B0256__))
#define USB_SERIES_UC3B_AVR
#endif #endif
#if !defined(USB_SERIES_7_AVR) #if !defined(USB_SERIES_7_AVR) && !defined(USB_SERIES_UC3B_AVR)
#if defined(USB_HOST_ONLY) #if defined(USB_HOST_ONLY)
#error USB_HOST_ONLY is not available for the currently selected USB AVR model. #error USB_HOST_ONLY is not available for the currently selected USB AVR model.
#endif #endif

@ -32,9 +32,15 @@
#define __USBTASK_H__ #define __USBTASK_H__
/* Includes: */ /* Includes: */
#if defined(__AVR32__)
#include <avr32/io.h>
#include <stdint.h>
#include <stdbool.h>
#elif defined(__AVR__)
#include <avr/io.h> #include <avr/io.h>
#include <avr/interrupt.h> #include <avr/interrupt.h>
#include <stdbool.h> #include <stdbool.h>
#endif
#include "../LowLevel/LowLevel.h" #include "../LowLevel/LowLevel.h"
#include "Events.h" #include "Events.h"

@ -139,7 +139,7 @@ static void USB_Device_SetAddress(void)
if (DeviceAddress) if (DeviceAddress)
USB_DeviceState = DEVICE_STATE_Addressed; USB_DeviceState = DEVICE_STATE_Addressed;
UDADDR = ((1 << ADDEN) | DeviceAddress); USB_Device_SetDeviceAddress(DeviceAddress);
return; return;
} }

@ -32,10 +32,15 @@
#define __DEVCHAPTER9_H__ #define __DEVCHAPTER9_H__
/* Includes: */ /* Includes: */
#if defined(__AVR32__)
#include <avr32/io.h>
#include <stdint.h>
#elif defined(__AVR__)
#include <avr/io.h> #include <avr/io.h>
#include <avr/pgmspace.h> #include <avr/pgmspace.h>
#include <avr/eeprom.h> #include <avr/eeprom.h>
#include <avr/boot.h> #include <avr/boot.h>
#endif
#include "../HighLevel/StdDescriptors.h" #include "../HighLevel/StdDescriptors.h"
#include "../HighLevel/Events.h" #include "../HighLevel/Events.h"
@ -70,7 +75,11 @@
enum USB_DescriptorMemorySpaces_t enum USB_DescriptorMemorySpaces_t
{ {
MEMSPACE_FLASH = 0, /**< Indicates the requested descriptor is located in FLASH memory */ MEMSPACE_FLASH = 0, /**< Indicates the requested descriptor is located in FLASH memory */
#if defined(__AVR__) || defined(__DOXYGEN__)
MEMSPACE_EEPROM = 1, /**< Indicates the requested descriptor is located in EEPROM memory */ MEMSPACE_EEPROM = 1, /**< Indicates the requested descriptor is located in EEPROM memory */
#endif
MEMSPACE_RAM = 2, /**< Indicates the requested descriptor is located in RAM memory */ MEMSPACE_RAM = 2, /**< Indicates the requested descriptor is located in RAM memory */
}; };
#endif #endif
@ -126,6 +135,10 @@
#error Only one of the USE_*_DESCRIPTORS modes should be selected. #error Only one of the USE_*_DESCRIPTORS modes should be selected.
#endif #endif
#if defined(USE_EEPROM_DESCRIPTORS) && defined(USB_SERIES_UC3B_AVR)
#error USE_EEPROM_DESCRIPTORS is not available on the UC3B series AVRs.
#endif
/* Function Prototypes: */ /* Function Prototypes: */
void USB_Device_ProcessControlRequest(void); void USB_Device_ProcessControlRequest(void);

@ -41,8 +41,10 @@
#define __USBDEVICE_H__ #define __USBDEVICE_H__
/* Includes: */ /* Includes: */
#if defined(__AVR__)
#include <avr/pgmspace.h> #include <avr/pgmspace.h>
#include <avr/eeprom.h> #include <avr/eeprom.h>
#endif
#include "../../../Common/Common.h" #include "../../../Common/Common.h"
#include "../HighLevel/StdDescriptors.h" #include "../HighLevel/StdDescriptors.h"
@ -59,7 +61,8 @@
/* Public Interface - May be used in end-application: */ /* Public Interface - May be used in end-application: */
/* Macros: */ /* Macros: */
#if defined(USB_SERIES_4_AVR) || defined(USB_SERIES_6_AVR) || defined(USB_SERIES_7_AVR) || defined(__DOXYGEN__) #if (defined(USB_SERIES_4_AVR) || defined(USB_SERIES_6_AVR) || defined(USB_SERIES_7_AVR) || \
defined(USB_SERIES_UC3B_AVR) || defined(__DOXYGEN__))
/** Mask for the Options parameter of the \ref USB_Init() function. This indicates that the /** Mask for the Options parameter of the \ref USB_Init() function. This indicates that the
* USB interface should be initialized in low speed (1.5Mb/s) mode. * USB interface should be initialized in low speed (1.5Mb/s) mode.
* *
@ -129,6 +132,15 @@
*/ */
static inline bool USB_Device_DisableSOFEvents(void); static inline bool USB_Device_DisableSOFEvents(void);
#else #else
#if defined(__AVR32__)
#if !defined(NO_DEVICE_REMOTE_WAKEUP)
#define USB_Device_SendRemoteWakeup() MACROS{ AVR32_USBB.UDCON.rmwkup = true; }MACROE
#define USB_Device_IsRemoteWakeupSent() AVR32_USBB.UDCON.rmwkup
#endif
#define USB_Device_IsUSBSuspended() AVR32_USBB.UDINT.susp
#elif defined(__AVR__)
#if !defined(NO_DEVICE_REMOTE_WAKEUP) #if !defined(NO_DEVICE_REMOTE_WAKEUP)
#define USB_Device_SendRemoteWakeup() MACROS{ UDCON |= (1 << RMWKUP); }MACROE #define USB_Device_SendRemoteWakeup() MACROS{ UDCON |= (1 << RMWKUP); }MACROE
@ -136,9 +148,9 @@
#endif #endif
#define USB_Device_IsUSBSuspended() ((UDINT & (1 << SUSPI)) ? true : false) #define USB_Device_IsUSBSuspended() ((UDINT & (1 << SUSPI)) ? true : false)
#endif
#define USB_Device_EnableSOFEvents() MACROS{ USB_INT_Enable(USB_INT_SOFI); }MACROE #define USB_Device_EnableSOFEvents() MACROS{ USB_INT_Enable(USB_INT_SOFI); }MACROE
#define USB_Device_DisableSOFEvents() MACROS{ USB_INT_Disable(USB_INT_SOFI); }MACROE #define USB_Device_DisableSOFEvents() MACROS{ USB_INT_Disable(USB_INT_SOFI); }MACROE
#endif #endif
@ -207,8 +219,17 @@
/* Private Interface - For use in library only: */ /* Private Interface - For use in library only: */
#if !defined(__DOXYGEN__) #if !defined(__DOXYGEN__)
/* Macros: */ /* Macros: */
#if defined(__AVR32__)
#define USB_Device_SetLowSpeed() MACROS{ AVR32_USBB.UDCON.ls = true; }MACROE
#define USB_Device_SetFullSpeed() MACROS{ AVR32_USBB.UDCON.ls = false; }MACROE
#define USB_Device_SetDeviceAddress(addr) MACROS{ AVR32_USBB.UDADDR = (AVR32_USBB_UDCON_ADDEN_MASK | DeviceAddress); }MACROE
#elif defined(__AVR__)
#define USB_Device_SetLowSpeed() MACROS{ UDCON |= (1 << LSM); }MACROE #define USB_Device_SetLowSpeed() MACROS{ UDCON |= (1 << LSM); }MACROE
#define USB_Device_SetFullSpeed() MACROS{ UDCON &= ~(1 << LSM); }MACROE #define USB_Device_SetFullSpeed() MACROS{ UDCON &= ~(1 << LSM); }MACROE
#define USB_Device_SetDeviceAddress(addr) MACROS{ UDADDR = ((1 << ADDEN) | DeviceAddress); }MACROE
#endif
#endif #endif
#endif #endif

@ -225,12 +225,14 @@ uint8_t Endpoint_Discard_Stream(uint16_t Length
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(pgm_read_byte((uint8_t*)BufferPtr++)) #define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(pgm_read_byte((uint8_t*)BufferPtr++))
#include "Template/Template_Endpoint_RW.c" #include "Template/Template_Endpoint_RW.c"
#if defined(__AVR__)
#define TEMPLATE_FUNC_NAME Endpoint_Write_EStream_LE #define TEMPLATE_FUNC_NAME Endpoint_Write_EStream_LE
#define TEMPLATE_BUFFER_TYPE const void* #define TEMPLATE_BUFFER_TYPE const void*
#define TEMPLATE_CLEAR_ENDPOINT() Endpoint_ClearIN() #define TEMPLATE_CLEAR_ENDPOINT() Endpoint_ClearIN()
#define TEMPLATE_BUFFER_OFFSET(Length) 0 #define TEMPLATE_BUFFER_OFFSET(Length) 0
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(eeprom_read_byte((uint8_t*)BufferPtr++)) #define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(eeprom_read_byte((uint8_t*)BufferPtr++))
#include "Template/Template_Endpoint_RW.c" #include "Template/Template_Endpoint_RW.c"
#endif
#define TEMPLATE_FUNC_NAME Endpoint_Write_Stream_BE #define TEMPLATE_FUNC_NAME Endpoint_Write_Stream_BE
#define TEMPLATE_BUFFER_TYPE const void* #define TEMPLATE_BUFFER_TYPE const void*
@ -239,12 +241,14 @@ uint8_t Endpoint_Discard_Stream(uint16_t Length
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(*((uint8_t*)BufferPtr--)) #define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(*((uint8_t*)BufferPtr--))
#include "Template/Template_Endpoint_RW.c" #include "Template/Template_Endpoint_RW.c"
#if defined(__AVR__)
#define TEMPLATE_FUNC_NAME Endpoint_Write_EStream_BE #define TEMPLATE_FUNC_NAME Endpoint_Write_EStream_BE
#define TEMPLATE_BUFFER_TYPE const void* #define TEMPLATE_BUFFER_TYPE const void*
#define TEMPLATE_CLEAR_ENDPOINT() Endpoint_ClearIN() #define TEMPLATE_CLEAR_ENDPOINT() Endpoint_ClearIN()
#define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1) #define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1)
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(eeprom_read_byte((uint8_t*)BufferPtr--)) #define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(eeprom_read_byte((uint8_t*)BufferPtr--))
#include "Template/Template_Endpoint_RW.c" #include "Template/Template_Endpoint_RW.c"
#endif
#define TEMPLATE_FUNC_NAME Endpoint_Write_PStream_BE #define TEMPLATE_FUNC_NAME Endpoint_Write_PStream_BE
#define TEMPLATE_BUFFER_TYPE const void* #define TEMPLATE_BUFFER_TYPE const void*
@ -260,12 +264,14 @@ uint8_t Endpoint_Discard_Stream(uint16_t Length
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) *((uint8_t*)BufferPtr++) = Endpoint_Read_Byte() #define TEMPLATE_TRANSFER_BYTE(BufferPtr) *((uint8_t*)BufferPtr++) = Endpoint_Read_Byte()
#include "Template/Template_Endpoint_RW.c" #include "Template/Template_Endpoint_RW.c"
#if defined(__AVR__)
#define TEMPLATE_FUNC_NAME Endpoint_Read_EStream_LE #define TEMPLATE_FUNC_NAME Endpoint_Read_EStream_LE
#define TEMPLATE_BUFFER_TYPE void* #define TEMPLATE_BUFFER_TYPE void*
#define TEMPLATE_CLEAR_ENDPOINT() Endpoint_ClearOUT() #define TEMPLATE_CLEAR_ENDPOINT() Endpoint_ClearOUT()
#define TEMPLATE_BUFFER_OFFSET(Length) 0 #define TEMPLATE_BUFFER_OFFSET(Length) 0
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) eeprom_write_byte((uint8_t*)BufferPtr++, Endpoint_Read_Byte()) #define TEMPLATE_TRANSFER_BYTE(BufferPtr) eeprom_write_byte((uint8_t*)BufferPtr++, Endpoint_Read_Byte())
#include "Template/Template_Endpoint_RW.c" #include "Template/Template_Endpoint_RW.c"
#endif
#define TEMPLATE_FUNC_NAME Endpoint_Read_Stream_BE #define TEMPLATE_FUNC_NAME Endpoint_Read_Stream_BE
#define TEMPLATE_BUFFER_TYPE void* #define TEMPLATE_BUFFER_TYPE void*
@ -274,12 +280,14 @@ uint8_t Endpoint_Discard_Stream(uint16_t Length
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) *((uint8_t*)BufferPtr--) = Endpoint_Read_Byte() #define TEMPLATE_TRANSFER_BYTE(BufferPtr) *((uint8_t*)BufferPtr--) = Endpoint_Read_Byte()
#include "Template/Template_Endpoint_RW.c" #include "Template/Template_Endpoint_RW.c"
#if defined(__AVR__)
#define TEMPLATE_FUNC_NAME Endpoint_Read_EStream_BE #define TEMPLATE_FUNC_NAME Endpoint_Read_EStream_BE
#define TEMPLATE_BUFFER_TYPE void* #define TEMPLATE_BUFFER_TYPE void*
#define TEMPLATE_CLEAR_ENDPOINT() Endpoint_ClearOUT() #define TEMPLATE_CLEAR_ENDPOINT() Endpoint_ClearOUT()
#define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1) #define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1)
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) eeprom_write_byte((uint8_t*)BufferPtr--, Endpoint_Read_Byte()) #define TEMPLATE_TRANSFER_BYTE(BufferPtr) eeprom_write_byte((uint8_t*)BufferPtr--, Endpoint_Read_Byte())
#include "Template/Template_Endpoint_RW.c" #include "Template/Template_Endpoint_RW.c"
#endif
#endif #endif
@ -293,10 +301,12 @@ uint8_t Endpoint_Discard_Stream(uint16_t Length
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(pgm_read_byte((uint8_t*)BufferPtr++)) #define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(pgm_read_byte((uint8_t*)BufferPtr++))
#include "Template/Template_Endpoint_Control_W.c" #include "Template/Template_Endpoint_Control_W.c"
#if defined(__AVR__)
#define TEMPLATE_FUNC_NAME Endpoint_Write_Control_EStream_LE #define TEMPLATE_FUNC_NAME Endpoint_Write_Control_EStream_LE
#define TEMPLATE_BUFFER_OFFSET(Length) 0 #define TEMPLATE_BUFFER_OFFSET(Length) 0
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(eeprom_read_byte((uint8_t*)BufferPtr++)) #define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(eeprom_read_byte((uint8_t*)BufferPtr++))
#include "Template/Template_Endpoint_Control_W.c" #include "Template/Template_Endpoint_Control_W.c"
#endif
#define TEMPLATE_FUNC_NAME Endpoint_Write_Control_Stream_BE #define TEMPLATE_FUNC_NAME Endpoint_Write_Control_Stream_BE
#define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1) #define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1)
@ -308,29 +318,35 @@ uint8_t Endpoint_Discard_Stream(uint16_t Length
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(pgm_read_byte((uint8_t*)BufferPtr--)) #define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(pgm_read_byte((uint8_t*)BufferPtr--))
#include "Template/Template_Endpoint_Control_W.c" #include "Template/Template_Endpoint_Control_W.c"
#if defined(__AVR__)
#define TEMPLATE_FUNC_NAME Endpoint_Write_Control_EStream_BE #define TEMPLATE_FUNC_NAME Endpoint_Write_Control_EStream_BE
#define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1) #define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1)
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(eeprom_read_byte((uint8_t*)BufferPtr--)) #define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_Byte(eeprom_read_byte((uint8_t*)BufferPtr--))
#include "Template/Template_Endpoint_Control_W.c" #include "Template/Template_Endpoint_Control_W.c"
#endif
#define TEMPLATE_FUNC_NAME Endpoint_Read_Control_Stream_LE #define TEMPLATE_FUNC_NAME Endpoint_Read_Control_Stream_LE
#define TEMPLATE_BUFFER_OFFSET(Length) 0 #define TEMPLATE_BUFFER_OFFSET(Length) 0
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) *((uint8_t*)BufferPtr++) = Endpoint_Read_Byte() #define TEMPLATE_TRANSFER_BYTE(BufferPtr) *((uint8_t*)BufferPtr++) = Endpoint_Read_Byte()
#include "Template/Template_Endpoint_Control_R.c" #include "Template/Template_Endpoint_Control_R.c"
#if defined(__AVR__)
#define TEMPLATE_FUNC_NAME Endpoint_Read_Control_EStream_LE #define TEMPLATE_FUNC_NAME Endpoint_Read_Control_EStream_LE
#define TEMPLATE_BUFFER_OFFSET(Length) 0 #define TEMPLATE_BUFFER_OFFSET(Length) 0
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) eeprom_write_byte((uint8_t*)BufferPtr++, Endpoint_Read_Byte()) #define TEMPLATE_TRANSFER_BYTE(BufferPtr) eeprom_write_byte((uint8_t*)BufferPtr++, Endpoint_Read_Byte())
#include "Template/Template_Endpoint_Control_R.c" #include "Template/Template_Endpoint_Control_R.c"
#endif
#define TEMPLATE_FUNC_NAME Endpoint_Read_Control_Stream_BE #define TEMPLATE_FUNC_NAME Endpoint_Read_Control_Stream_BE
#define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1) #define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1)
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) *((uint8_t*)BufferPtr--) = Endpoint_Read_Byte() #define TEMPLATE_TRANSFER_BYTE(BufferPtr) *((uint8_t*)BufferPtr--) = Endpoint_Read_Byte()
#include "Template/Template_Endpoint_Control_R.c" #include "Template/Template_Endpoint_Control_R.c"
#if defined(__AVR__)
#define TEMPLATE_FUNC_NAME Endpoint_Read_Control_EStream_BE #define TEMPLATE_FUNC_NAME Endpoint_Read_Control_EStream_BE
#define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1) #define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1)
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) eeprom_write_byte((uint8_t*)BufferPtr--, Endpoint_Read_Byte()) #define TEMPLATE_TRANSFER_BYTE(BufferPtr) eeprom_write_byte((uint8_t*)BufferPtr--, Endpoint_Read_Byte())
#include "Template/Template_Endpoint_Control_R.c" #include "Template/Template_Endpoint_Control_R.c"
#endif
#endif #endif

@ -66,10 +66,16 @@
#define __ENDPOINT_H__ #define __ENDPOINT_H__
/* Includes: */ /* Includes: */
#if defined(__AVR32__)
#include <avr32/io.h>
#include <stdint.h>
#include <stdbool.h>
#elif defined(__AVR__)
#include <avr/io.h> #include <avr/io.h>
#include <avr/pgmspace.h> #include <avr/pgmspace.h>
#include <avr/eeprom.h> #include <avr/eeprom.h>
#include <stdbool.h> #include <stdbool.h>
#endif
#include "../../../Common/Common.h" #include "../../../Common/Common.h"
#include "../HighLevel/USBTask.h" #include "../HighLevel/USBTask.h"
@ -486,7 +492,11 @@
static inline uint8_t Endpoint_Read_Byte(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE; static inline uint8_t Endpoint_Read_Byte(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
static inline uint8_t Endpoint_Read_Byte(void) static inline uint8_t Endpoint_Read_Byte(void)
{ {
#if defined(__AVR32__)
return 0; // TODO
#elif defined(__AVR__)
return UEDATX; return UEDATX;
#endif
} }
/** Writes one byte from the currently selected endpoint's bank, for IN direction endpoints. /** Writes one byte from the currently selected endpoint's bank, for IN direction endpoints.
@ -498,7 +508,11 @@
static inline void Endpoint_Write_Byte(const uint8_t Byte) ATTR_ALWAYS_INLINE; static inline void Endpoint_Write_Byte(const uint8_t Byte) ATTR_ALWAYS_INLINE;
static inline void Endpoint_Write_Byte(const uint8_t Byte) static inline void Endpoint_Write_Byte(const uint8_t Byte)
{ {
#if defined(__AVR32__)
// TODO
#elif defined(__AVR__)
UEDATX = Byte; UEDATX = Byte;
#endif
} }
/** Discards one byte from the currently selected endpoint's bank, for OUT direction endpoints. /** Discards one byte from the currently selected endpoint's bank, for OUT direction endpoints.
@ -510,7 +524,11 @@
{ {
uint8_t Dummy; uint8_t Dummy;
#if defined(__AVR32__)
// TODO
#elif defined(__AVR__)
Dummy = UEDATX; Dummy = UEDATX;
#endif
} }
/** Reads two bytes from the currently selected endpoint's bank in little endian format, for OUT /** Reads two bytes from the currently selected endpoint's bank in little endian format, for OUT
@ -529,8 +547,12 @@
uint8_t Bytes[2]; uint8_t Bytes[2];
} Data; } Data;
#if defined(__AVR32__)
// TODO
#elif defined(__AVR__)
Data.Bytes[0] = UEDATX; Data.Bytes[0] = UEDATX;
Data.Bytes[1] = UEDATX; Data.Bytes[1] = UEDATX;
#endif
return Data.Word; return Data.Word;
} }
@ -551,8 +573,12 @@
uint8_t Bytes[2]; uint8_t Bytes[2];
} Data; } Data;
#if defined(__AVR32__)
// TODO
#elif defined(__AVR__)
Data.Bytes[1] = UEDATX; Data.Bytes[1] = UEDATX;
Data.Bytes[0] = UEDATX; Data.Bytes[0] = UEDATX;
#endif
return Data.Word; return Data.Word;
} }
@ -567,8 +593,12 @@
static inline void Endpoint_Write_Word_LE(const uint16_t Word) ATTR_ALWAYS_INLINE; static inline void Endpoint_Write_Word_LE(const uint16_t Word) ATTR_ALWAYS_INLINE;
static inline void Endpoint_Write_Word_LE(const uint16_t Word) static inline void Endpoint_Write_Word_LE(const uint16_t Word)
{ {
#if defined(__AVR32__)
// TODO
#elif defined(__AVR__)
UEDATX = (Word & 0xFF); UEDATX = (Word & 0xFF);
UEDATX = (Word >> 8); UEDATX = (Word >> 8);
#endif
} }
/** Writes two bytes to the currently selected endpoint's bank in big endian format, for IN /** Writes two bytes to the currently selected endpoint's bank in big endian format, for IN
@ -581,8 +611,12 @@
static inline void Endpoint_Write_Word_BE(const uint16_t Word) ATTR_ALWAYS_INLINE; static inline void Endpoint_Write_Word_BE(const uint16_t Word) ATTR_ALWAYS_INLINE;
static inline void Endpoint_Write_Word_BE(const uint16_t Word) static inline void Endpoint_Write_Word_BE(const uint16_t Word)
{ {
#if defined(__AVR32__)
// TODO
#elif defined(__AVR__)
UEDATX = (Word >> 8); UEDATX = (Word >> 8);
UEDATX = (Word & 0xFF); UEDATX = (Word & 0xFF);
#endif
} }
/** Discards two bytes from the currently selected endpoint's bank, for OUT direction endpoints. /** Discards two bytes from the currently selected endpoint's bank, for OUT direction endpoints.
@ -594,8 +628,12 @@
{ {
uint8_t Dummy; uint8_t Dummy;
#if defined(__AVR32__)
// TODO
#elif defined(__AVR__)
Dummy = UEDATX; Dummy = UEDATX;
Dummy = UEDATX; Dummy = UEDATX;
#endif
} }
/** Reads four bytes from the currently selected endpoint's bank in little endian format, for OUT /** Reads four bytes from the currently selected endpoint's bank in little endian format, for OUT
@ -614,10 +652,14 @@
uint8_t Bytes[4]; uint8_t Bytes[4];
} Data; } Data;
#if defined(__AVR32__)
// TODO
#elif defined(__AVR__)
Data.Bytes[0] = UEDATX; Data.Bytes[0] = UEDATX;
Data.Bytes[1] = UEDATX; Data.Bytes[1] = UEDATX;
Data.Bytes[2] = UEDATX; Data.Bytes[2] = UEDATX;
Data.Bytes[3] = UEDATX; Data.Bytes[3] = UEDATX;
#endif
return Data.DWord; return Data.DWord;
} }
@ -638,10 +680,14 @@
uint8_t Bytes[4]; uint8_t Bytes[4];
} Data; } Data;
#if defined(__AVR32__)
// TODO
#elif defined(__AVR__)
Data.Bytes[3] = UEDATX; Data.Bytes[3] = UEDATX;
Data.Bytes[2] = UEDATX; Data.Bytes[2] = UEDATX;
Data.Bytes[1] = UEDATX; Data.Bytes[1] = UEDATX;
Data.Bytes[0] = UEDATX; Data.Bytes[0] = UEDATX;
#endif
return Data.DWord; return Data.DWord;
} }
@ -656,10 +702,14 @@
static inline void Endpoint_Write_DWord_LE(const uint32_t DWord) ATTR_ALWAYS_INLINE; static inline void Endpoint_Write_DWord_LE(const uint32_t DWord) ATTR_ALWAYS_INLINE;
static inline void Endpoint_Write_DWord_LE(const uint32_t DWord) static inline void Endpoint_Write_DWord_LE(const uint32_t DWord)
{ {
#if defined(__AVR32__)
// TODO
#elif defined(__AVR__)
UEDATX = (DWord & 0xFF); UEDATX = (DWord & 0xFF);
UEDATX = (DWord >> 8); UEDATX = (DWord >> 8);
UEDATX = (DWord >> 16); UEDATX = (DWord >> 16);
UEDATX = (DWord >> 24); UEDATX = (DWord >> 24);
#endif
} }
/** Writes four bytes to the currently selected endpoint's bank in big endian format, for IN /** Writes four bytes to the currently selected endpoint's bank in big endian format, for IN
@ -672,10 +722,14 @@
static inline void Endpoint_Write_DWord_BE(const uint32_t DWord) ATTR_ALWAYS_INLINE; static inline void Endpoint_Write_DWord_BE(const uint32_t DWord) ATTR_ALWAYS_INLINE;
static inline void Endpoint_Write_DWord_BE(const uint32_t DWord) static inline void Endpoint_Write_DWord_BE(const uint32_t DWord)
{ {
#if defined(__AVR32__)
// TODO
#elif defined(__AVR__)
UEDATX = (DWord >> 24); UEDATX = (DWord >> 24);
UEDATX = (DWord >> 16); UEDATX = (DWord >> 16);
UEDATX = (DWord >> 8); UEDATX = (DWord >> 8);
UEDATX = (DWord & 0xFF); UEDATX = (DWord & 0xFF);
#endif
} }
/** Discards four bytes from the currently selected endpoint's bank, for OUT direction endpoints. /** Discards four bytes from the currently selected endpoint's bank, for OUT direction endpoints.
@ -687,10 +741,14 @@
{ {
uint8_t Dummy; uint8_t Dummy;
#if defined(__AVR32__)
// TODO
#elif defined(__AVR__)
Dummy = UEDATX; Dummy = UEDATX;
Dummy = UEDATX; Dummy = UEDATX;
Dummy = UEDATX; Dummy = UEDATX;
Dummy = UEDATX; Dummy = UEDATX;
#endif
} }
/* External Variables: */ /* External Variables: */

@ -41,9 +41,15 @@
#define __USBHOST_H__ #define __USBHOST_H__
/* Includes: */ /* Includes: */
#if defined(__AVR32__)
#include <avr32/io.h>
#include <stdint.h>
#include <stdbool.h>
#elif defined(__AVR__)
#include <avr/io.h> #include <avr/io.h>
#include <stdbool.h> #include <stdbool.h>
#include <util/delay.h> #include <util/delay.h>
#endif
#include "../../../Common/Common.h" #include "../../../Common/Common.h"
#include "../HighLevel/USBInterrupt.h" #include "../HighLevel/USBInterrupt.h"

@ -32,8 +32,14 @@
#define __HOSTCHAPTER9_H__ #define __HOSTCHAPTER9_H__
/* Includes: */ /* Includes: */
#if defined(__AVR32__)
#include <avr32/io.h>
#include <stdint.h>
#include <stdbool.h>
#elif defined(__AVR__)
#include <avr/io.h> #include <avr/io.h>
#include <stdbool.h> #include <stdbool.h>
#endif
#include "LowLevel.h" #include "LowLevel.h"
#include "../HighLevel/USBMode.h" #include "../HighLevel/USBMode.h"

@ -40,9 +40,15 @@
#define __USBLOWLEVEL_H__ #define __USBLOWLEVEL_H__
/* Includes: */ /* Includes: */
#if defined(__AVR32__)
#include <avr32/io.h>
#include <stdint.h>
#include <stdbool.h>
#elif defined(__AVR__)
#include <avr/io.h> #include <avr/io.h>
#include <avr/interrupt.h> #include <avr/interrupt.h>
#include <stdbool.h> #include <stdbool.h>
#endif
#include "../HighLevel/USBMode.h" #include "../HighLevel/USBMode.h"

@ -42,8 +42,14 @@
#define __USBOTG_H__ #define __USBOTG_H__
/* Includes: */ /* Includes: */
#if defined(__AVR32__)
#include <avr32/io.h>
#include <stdint.h>
#include <stdbool.h>
#elif defined(__AVR__)
#include <avr/io.h> #include <avr/io.h>
#include <stdbool.h> #include <stdbool.h>
#endif
#include "../../../Common/Common.h" #include "../../../Common/Common.h"

@ -226,6 +226,7 @@ uint8_t Pipe_Discard_Stream(uint16_t Length
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Pipe_Write_Byte(pgm_read_byte((uint8_t*)BufferPtr++)) #define TEMPLATE_TRANSFER_BYTE(BufferPtr) Pipe_Write_Byte(pgm_read_byte((uint8_t*)BufferPtr++))
#include "Template/Template_Pipe_RW.c" #include "Template/Template_Pipe_RW.c"
#if defined(__AVR__)
#define TEMPLATE_FUNC_NAME Pipe_Write_EStream_LE #define TEMPLATE_FUNC_NAME Pipe_Write_EStream_LE
#define TEMPLATE_BUFFER_TYPE const void* #define TEMPLATE_BUFFER_TYPE const void*
#define TEMPLATE_TOKEN PIPE_TOKEN_OUT #define TEMPLATE_TOKEN PIPE_TOKEN_OUT
@ -233,6 +234,7 @@ uint8_t Pipe_Discard_Stream(uint16_t Length
#define TEMPLATE_BUFFER_OFFSET(Length) 0 #define TEMPLATE_BUFFER_OFFSET(Length) 0
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Pipe_Write_Byte(eeprom_read_byte((uint8_t*)BufferPtr++)) #define TEMPLATE_TRANSFER_BYTE(BufferPtr) Pipe_Write_Byte(eeprom_read_byte((uint8_t*)BufferPtr++))
#include "Template/Template_Pipe_RW.c" #include "Template/Template_Pipe_RW.c"
#endif
#define TEMPLATE_FUNC_NAME Pipe_Write_Stream_BE #define TEMPLATE_FUNC_NAME Pipe_Write_Stream_BE
#define TEMPLATE_BUFFER_TYPE const void* #define TEMPLATE_BUFFER_TYPE const void*
@ -250,6 +252,7 @@ uint8_t Pipe_Discard_Stream(uint16_t Length
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Pipe_Write_Byte(pgm_read_byte((uint8_t*)BufferPtr--)) #define TEMPLATE_TRANSFER_BYTE(BufferPtr) Pipe_Write_Byte(pgm_read_byte((uint8_t*)BufferPtr--))
#include "Template/Template_Pipe_RW.c" #include "Template/Template_Pipe_RW.c"
#if defined(__AVR__)
#define TEMPLATE_FUNC_NAME Pipe_Write_EStream_BE #define TEMPLATE_FUNC_NAME Pipe_Write_EStream_BE
#define TEMPLATE_BUFFER_TYPE const void* #define TEMPLATE_BUFFER_TYPE const void*
#define TEMPLATE_TOKEN PIPE_TOKEN_OUT #define TEMPLATE_TOKEN PIPE_TOKEN_OUT
@ -257,6 +260,7 @@ uint8_t Pipe_Discard_Stream(uint16_t Length
#define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1) #define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1)
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Pipe_Write_Byte(eeprom_read_byte((uint8_t*)BufferPtr--)) #define TEMPLATE_TRANSFER_BYTE(BufferPtr) Pipe_Write_Byte(eeprom_read_byte((uint8_t*)BufferPtr--))
#include "Template/Template_Pipe_RW.c" #include "Template/Template_Pipe_RW.c"
#endif
#define TEMPLATE_FUNC_NAME Pipe_Read_Stream_LE #define TEMPLATE_FUNC_NAME Pipe_Read_Stream_LE
#define TEMPLATE_BUFFER_TYPE void* #define TEMPLATE_BUFFER_TYPE void*
@ -266,6 +270,7 @@ uint8_t Pipe_Discard_Stream(uint16_t Length
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) *((uint8_t*)BufferPtr++) = Pipe_Read_Byte() #define TEMPLATE_TRANSFER_BYTE(BufferPtr) *((uint8_t*)BufferPtr++) = Pipe_Read_Byte()
#include "Template/Template_Pipe_RW.c" #include "Template/Template_Pipe_RW.c"
#if defined(__AVR__)
#define TEMPLATE_FUNC_NAME Pipe_Read_EStream_LE #define TEMPLATE_FUNC_NAME Pipe_Read_EStream_LE
#define TEMPLATE_BUFFER_TYPE void* #define TEMPLATE_BUFFER_TYPE void*
#define TEMPLATE_TOKEN PIPE_TOKEN_IN #define TEMPLATE_TOKEN PIPE_TOKEN_IN
@ -273,6 +278,7 @@ uint8_t Pipe_Discard_Stream(uint16_t Length
#define TEMPLATE_BUFFER_OFFSET(Length) 0 #define TEMPLATE_BUFFER_OFFSET(Length) 0
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) eeprom_write_byte((uint8_t*)BufferPtr++, Pipe_Read_Byte()) #define TEMPLATE_TRANSFER_BYTE(BufferPtr) eeprom_write_byte((uint8_t*)BufferPtr++, Pipe_Read_Byte())
#include "Template/Template_Pipe_RW.c" #include "Template/Template_Pipe_RW.c"
#endif
#define TEMPLATE_FUNC_NAME Pipe_Read_Stream_BE #define TEMPLATE_FUNC_NAME Pipe_Read_Stream_BE
#define TEMPLATE_BUFFER_TYPE void* #define TEMPLATE_BUFFER_TYPE void*
@ -282,6 +288,7 @@ uint8_t Pipe_Discard_Stream(uint16_t Length
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) *((uint8_t*)BufferPtr--) = Pipe_Read_Byte() #define TEMPLATE_TRANSFER_BYTE(BufferPtr) *((uint8_t*)BufferPtr--) = Pipe_Read_Byte()
#include "Template/Template_Pipe_RW.c" #include "Template/Template_Pipe_RW.c"
#if defined(__AVR__)
#define TEMPLATE_FUNC_NAME Pipe_Read_EStream_BE #define TEMPLATE_FUNC_NAME Pipe_Read_EStream_BE
#define TEMPLATE_BUFFER_TYPE void* #define TEMPLATE_BUFFER_TYPE void*
#define TEMPLATE_TOKEN PIPE_TOKEN_IN #define TEMPLATE_TOKEN PIPE_TOKEN_IN
@ -289,5 +296,6 @@ uint8_t Pipe_Discard_Stream(uint16_t Length
#define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1) #define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1)
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) eeprom_write_byte((uint8_t*)BufferPtr--, Pipe_Read_Byte()) #define TEMPLATE_TRANSFER_BYTE(BufferPtr) eeprom_write_byte((uint8_t*)BufferPtr--, Pipe_Read_Byte())
#include "Template/Template_Pipe_RW.c" #include "Template/Template_Pipe_RW.c"
#endif
#endif #endif

@ -74,10 +74,16 @@
#define __PIPE_H__ #define __PIPE_H__
/* Includes: */ /* Includes: */
#if defined(__AVR32__)
#include <avr32/io.h>
#include <stdint.h>
#include <stdbool.h>
#elif defined(__AVR__)
#include <avr/io.h> #include <avr/io.h>
#include <avr/pgmspace.h> #include <avr/pgmspace.h>
#include <avr/eeprom.h> #include <avr/eeprom.h>
#include <stdbool.h> #include <stdbool.h>
#endif
#include "../../../Common/Common.h" #include "../../../Common/Common.h"
#include "../HighLevel/USBTask.h" #include "../HighLevel/USBTask.h"
@ -547,7 +553,11 @@
static inline uint8_t Pipe_Read_Byte(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE; static inline uint8_t Pipe_Read_Byte(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
static inline uint8_t Pipe_Read_Byte(void) static inline uint8_t Pipe_Read_Byte(void)
{ {
#if defined(__AVR32__)
return 0; // TODO
#elif defined(__AVR__)
return UPDATX; return UPDATX;
#endif
} }
/** Writes one byte from the currently selected pipe's bank, for IN direction pipes. /** Writes one byte from the currently selected pipe's bank, for IN direction pipes.
@ -559,7 +569,11 @@
static inline void Pipe_Write_Byte(const uint8_t Byte) ATTR_ALWAYS_INLINE; static inline void Pipe_Write_Byte(const uint8_t Byte) ATTR_ALWAYS_INLINE;
static inline void Pipe_Write_Byte(const uint8_t Byte) static inline void Pipe_Write_Byte(const uint8_t Byte)
{ {
#if defined(__AVR32__)
// TODO
#elif defined(__AVR__)
UPDATX = Byte; UPDATX = Byte;
#endif
} }
/** Discards one byte from the currently selected pipe's bank, for OUT direction pipes. /** Discards one byte from the currently selected pipe's bank, for OUT direction pipes.
@ -571,7 +585,11 @@
{ {
uint8_t Dummy; uint8_t Dummy;
#if defined(__AVR32__)
// TODO
#elif defined(__AVR__)
Dummy = UPDATX; Dummy = UPDATX;
#endif
} }
/** Reads two bytes from the currently selected pipe's bank in little endian format, for OUT /** Reads two bytes from the currently selected pipe's bank in little endian format, for OUT
@ -590,8 +608,12 @@
uint8_t Bytes[2]; uint8_t Bytes[2];
} Data; } Data;
#if defined(__AVR32__)
// TODO
#elif defined(__AVR__)
Data.Bytes[0] = UPDATX; Data.Bytes[0] = UPDATX;
Data.Bytes[1] = UPDATX; Data.Bytes[1] = UPDATX;
#endif
return Data.Word; return Data.Word;
} }
@ -612,8 +634,12 @@
uint8_t Bytes[2]; uint8_t Bytes[2];
} Data; } Data;
#if defined(__AVR32__)
// TODO
#elif defined(__AVR__)
Data.Bytes[1] = UPDATX; Data.Bytes[1] = UPDATX;
Data.Bytes[0] = UPDATX; Data.Bytes[0] = UPDATX;
#endif
return Data.Word; return Data.Word;
} }
@ -628,8 +654,12 @@
static inline void Pipe_Write_Word_LE(const uint16_t Word) ATTR_ALWAYS_INLINE; static inline void Pipe_Write_Word_LE(const uint16_t Word) ATTR_ALWAYS_INLINE;
static inline void Pipe_Write_Word_LE(const uint16_t Word) static inline void Pipe_Write_Word_LE(const uint16_t Word)
{ {
#if defined(__AVR32__)
// TODO
#elif defined(__AVR__)
UPDATX = (Word & 0xFF); UPDATX = (Word & 0xFF);
UPDATX = (Word >> 8); UPDATX = (Word >> 8);
#endif
} }
/** Writes two bytes to the currently selected pipe's bank in big endian format, for IN /** Writes two bytes to the currently selected pipe's bank in big endian format, for IN
@ -642,8 +672,12 @@
static inline void Pipe_Write_Word_BE(const uint16_t Word) ATTR_ALWAYS_INLINE; static inline void Pipe_Write_Word_BE(const uint16_t Word) ATTR_ALWAYS_INLINE;
static inline void Pipe_Write_Word_BE(const uint16_t Word) static inline void Pipe_Write_Word_BE(const uint16_t Word)
{ {
#if defined(__AVR32__)
// TODO
#elif defined(__AVR__)
UPDATX = (Word >> 8); UPDATX = (Word >> 8);
UPDATX = (Word & 0xFF); UPDATX = (Word & 0xFF);
#endif
} }
/** Discards two bytes from the currently selected pipe's bank, for OUT direction pipes. /** Discards two bytes from the currently selected pipe's bank, for OUT direction pipes.
@ -655,8 +689,12 @@
{ {
uint8_t Dummy; uint8_t Dummy;
#if defined(__AVR32__)
// TODO
#elif defined(__AVR__)
Dummy = UPDATX; Dummy = UPDATX;
Dummy = UPDATX; Dummy = UPDATX;
#endif
} }
/** Reads four bytes from the currently selected pipe's bank in little endian format, for OUT /** Reads four bytes from the currently selected pipe's bank in little endian format, for OUT
@ -675,10 +713,14 @@
uint8_t Bytes[4]; uint8_t Bytes[4];
} Data; } Data;
#if defined(__AVR32__)
// TODO
#elif defined(__AVR__)
Data.Bytes[0] = UPDATX; Data.Bytes[0] = UPDATX;
Data.Bytes[1] = UPDATX; Data.Bytes[1] = UPDATX;
Data.Bytes[2] = UPDATX; Data.Bytes[2] = UPDATX;
Data.Bytes[3] = UPDATX; Data.Bytes[3] = UPDATX;
#endif
return Data.DWord; return Data.DWord;
} }
@ -699,6 +741,9 @@
uint8_t Bytes[4]; uint8_t Bytes[4];
} Data; } Data;
#if defined(__AVR32__)
// TODO
#elif defined(__AVR__)
Data.Bytes[3] = UPDATX; Data.Bytes[3] = UPDATX;
Data.Bytes[2] = UPDATX; Data.Bytes[2] = UPDATX;
Data.Bytes[1] = UPDATX; Data.Bytes[1] = UPDATX;
@ -717,10 +762,14 @@
static inline void Pipe_Write_DWord_LE(const uint32_t DWord) ATTR_ALWAYS_INLINE; static inline void Pipe_Write_DWord_LE(const uint32_t DWord) ATTR_ALWAYS_INLINE;
static inline void Pipe_Write_DWord_LE(const uint32_t DWord) static inline void Pipe_Write_DWord_LE(const uint32_t DWord)
{ {
#if defined(__AVR32__)
// TODO
#elif defined(__AVR__)
UPDATX = (DWord & 0xFF); UPDATX = (DWord & 0xFF);
UPDATX = (DWord >> 8); UPDATX = (DWord >> 8);
UPDATX = (DWord >> 16); UPDATX = (DWord >> 16);
UPDATX = (DWord >> 24); UPDATX = (DWord >> 24);
#endif
} }
/** Writes four bytes to the currently selected pipe's bank in big endian format, for IN /** Writes four bytes to the currently selected pipe's bank in big endian format, for IN
@ -733,10 +782,14 @@
static inline void Pipe_Write_DWord_BE(const uint32_t DWord) ATTR_ALWAYS_INLINE; static inline void Pipe_Write_DWord_BE(const uint32_t DWord) ATTR_ALWAYS_INLINE;
static inline void Pipe_Write_DWord_BE(const uint32_t DWord) static inline void Pipe_Write_DWord_BE(const uint32_t DWord)
{ {
#if defined(__AVR32__)
// TODO
#elif defined(__AVR__)
UPDATX = (DWord >> 24); UPDATX = (DWord >> 24);
UPDATX = (DWord >> 16); UPDATX = (DWord >> 16);
UPDATX = (DWord >> 8); UPDATX = (DWord >> 8);
UPDATX = (DWord & 0xFF); UPDATX = (DWord & 0xFF);
#endif
} }
/** Discards four bytes from the currently selected pipe's bank, for OUT direction pipes. /** Discards four bytes from the currently selected pipe's bank, for OUT direction pipes.
@ -748,10 +801,14 @@
{ {
uint8_t Dummy; uint8_t Dummy;
#if defined(__AVR32__)
// TODO
#elif defined(__AVR__)
Dummy = UPDATX; Dummy = UPDATX;
Dummy = UPDATX; Dummy = UPDATX;
Dummy = UPDATX; Dummy = UPDATX;
Dummy = UPDATX; Dummy = UPDATX;
#endif
} }
/* External Variables: */ /* External Variables: */

@ -360,7 +360,8 @@
/* Preprocessor Checks: */ /* Preprocessor Checks: */
#if (!defined(USB_SERIES_2_AVR) && !defined(USB_SERIES_4_AVR) && \ #if (!defined(USB_SERIES_2_AVR) && !defined(USB_SERIES_4_AVR) && \
!defined(USB_SERIES_6_AVR) && !defined(USB_SERIES_7_AVR)) !defined(USB_SERIES_6_AVR) && !defined(USB_SERIES_7_AVR) && \
!defined(USB_SERIES_UC3B_AVR))
#error The currently selected AVR model is not supported under the USB component of the LUFA library. #error The currently selected AVR model is not supported under the USB component of the LUFA library.
#endif #endif

@ -46,11 +46,11 @@
* *
* The following drivers have been partially ported: * The following drivers have been partially ported:
* - SPI Peripheral Driver * - SPI Peripheral Driver
* - USB Driver
* *
* The following drivers have not yet been ported: * The following drivers have not yet been ported:
* - Dataflash Board Driver * - Dataflash Board Driver
* - Serial Peripheral Driver * - Serial Peripheral Driver
* - ADC Peripheral Driver * - ADC Peripheral Driver
* - TWI Peripheral Driver * - TWI Peripheral Driver
* - USB Driver
*/ */

Loading…
Cancel
Save