Commit d9643cf6 authored by Dean Camera's avatar Dean Camera
Browse files

Add start of an architecture port to the Atmel USB XMEGA devices.

parent f5802323
This diff is collapsed.
This diff is collapsed.
......@@ -65,7 +65,10 @@
#define ARCH_AVR8 0
/** Selects the Atmel 32-bit UC3 AVR (AT32UC3* chips) architecture. */
#define ARCH_UC3 1
#define ARCH_UC3 1
/** Selects the Atmel XMEGA AVR (ATXMEGA*U chips) architecture. */
#define ARCH_XMEGA 2
#if !defined(__DOXYGEN__)
#define ARCH_ ARCH_AVR8
......
......@@ -119,6 +119,21 @@
#define ARCH_BIG_ENDIAN
#include "Endianness.h"
#elif (ARCH == ARCH_XMEGA)
#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/pgmspace.h>
#include <avr/eeprom.h>
#include <util/delay.h>
typedef uint8_t uint_reg_t;
#define ARCH_HAS_EEPROM_ADDRESS_SPACE
#define ARCH_HAS_FLASH_ADDRESS_SPACE
#define ARCH_HAS_MULTI_ADDRESS_SPACE
#define ARCH_LITTLE_ENDIAN
#include "Endianness.h"
#else
#error Unknown device architecture specified.
#endif
......@@ -289,6 +304,16 @@
__builtin_mtsr(AVR32_COUNT, 0);
while (__builtin_mfsr(AVR32_COUNT) < (F_CPU / 1000));
}
#elif (ARCH == ARCH_XMEGA)
if (GCC_IS_COMPILE_CONST(Milliseconds))
{
_delay_ms(Milliseconds);
}
else
{
while (Milliseconds--)
_delay_ms(1);
}
#endif
}
......@@ -308,7 +333,9 @@
#if (ARCH == ARCH_AVR8)
return SREG;
#elif (ARCH == ARCH_UC3)
return __builtin_mfsr(AVR32_SR);
return __builtin_mfsr(AVR32_SR);
#elif (ARCH == ARCH_XMEGA)
return SREG;
#endif
GCC_MEMORY_BARRIER();
......@@ -334,6 +361,8 @@
__builtin_ssrf(AVR32_SR_GM_OFFSET);
else
__builtin_csrf(AVR32_SR_GM_OFFSET);
#elif (ARCH == ARCH_XMEGA)
SREG = GlobalIntState;
#endif
GCC_MEMORY_BARRIER();
......@@ -352,6 +381,8 @@
sei();
#elif (ARCH == ARCH_UC3)
__builtin_csrf(AVR32_SR_GM_OFFSET);
#elif (ARCH == ARCH_XMEGA)
sei();
#endif
GCC_MEMORY_BARRIER();
......@@ -370,6 +401,8 @@
cli();
#elif (ARCH == ARCH_UC3)
__builtin_ssrf(AVR32_SR_GM_OFFSET);
#elif (ARCH == ARCH_XMEGA)
cli();
#endif
GCC_MEMORY_BARRIER();
......
......@@ -144,6 +144,8 @@
#include "AVR8/Device_AVR8.h"
#elif (ARCH == ARCH_UC3)
#include "UC3/Device_UC3.h"
#elif (ARCH == ARCH_XMEGA)
#include "XMEGA/Device_XMEGA.h"
#endif
/* Disable C linkage for C++ Compilers: */
......
......@@ -108,6 +108,8 @@
#include "AVR8/Endpoint_AVR8.h"
#elif (ARCH == ARCH_UC3)
#include "UC3/Endpoint_UC3.h"
#elif (ARCH == ARCH_XMEGA)
#include "XMEGA/Endpoint_XMEGA.h"
#endif
/* Disable C linkage for C++ Compilers: */
......
......@@ -109,6 +109,8 @@
#include "AVR8/EndpointStream_AVR8.h"
#elif (ARCH == ARCH_UC3)
#include "UC3/EndpointStream_UC3.h"
#elif (ARCH == ARCH_XMEGA)
#include "XMEGA/EndpointStream_XMEGA.h"
#endif
/* Disable C linkage for C++ Compilers: */
......
......@@ -637,7 +637,7 @@
{
USB_Descriptor_Header_t Header; /**< Descriptor header, including type and size. */
#if (ARCH == ARCH_AVR8)
#if ((ARCH == ARCH_AVR8) || (ARCH == ARCH_XMEGA))
wchar_t UnicodeString[];
#else
uint16_t UnicodeString[]; /**< String data, as unicode characters (alternatively,
......
......@@ -66,7 +66,9 @@
#if (ARCH == ARCH_AVR8)
#include "AVR8/USBController_AVR8.h"
#elif (ARCH == ARCH_UC3)
#include "UC3/USBController_UC3.h"
#include "UC3/USBController_UC3.h"
#elif (ARCH == ARCH_XMEGA)
#include "XMEGA/USBController_XMEGA.h"
#endif
/* Disable C linkage for C++ Compilers: */
......
......@@ -60,6 +60,8 @@
#include "AVR8/USBInterrupt_AVR8.h"
#elif (ARCH == ARCH_UC3)
#include "UC3/USBInterrupt_UC3.h"
#elif (ARCH == ARCH_XMEGA)
#include "XMEGA/USBInterrupt_XMEGA.h"
#endif
/* Disable C linkage for C++ Compilers: */
......
......@@ -174,6 +174,19 @@
#define USB_SERIES_UC3B1_AVR32
#define USB_CAN_BE_DEVICE
#define USB_CAN_BE_HOST
#elif (defined(__AVR_ATxmega128A1U__))
#define USB_SERIES_A1U_XMEGA
#define USB_CAN_BE_DEVICE
#elif (defined(__AVR_ATxmega16A4U__) || defined(__AVR_ATxmega32A4U__))
#define USB_SERIES_A4U_XMEGA
#define USB_CAN_BE_DEVICE
#elif (defined(__AVR_ATxmega64A3U__) || defined(__AVR_ATxmega128A3U__) || \
defined(__AVR_ATxmega192A3U__) || defined(__AVR_ATxmega256A3U__))
#define USB_SERIES_A3U_XMEGA
#define USB_CAN_BE_DEVICE
#elif (defined(__AVR_ATxmega256A3BU__))
#define USB_SERIES_A3BU_XMEGA
#define USB_CAN_BE_DEVICE
#endif
#if (defined(USB_CAN_BE_DEVICE) && defined(USB_CAN_BE_HOST))
......
/*
LUFA Library
Copyright (C) Dean Camera, 2011.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2011 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
permission notice and warranty disclaimer appear in supporting
documentation, and that the name of the author not be used in
advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
software, including all implied warranties of merchantability
and fitness. In no event shall the author be liable for any
special, indirect or consequential damages or any damages
whatsoever resulting from loss of use, data or profits, whether
in an action of contract, negligence or other tortious action,
arising out of or in connection with the use or performance of
this software.
*/
#define __INCLUDE_FROM_USB_DRIVER
#include "../USBMode.h"
#if defined(USB_CAN_BE_DEVICE)
#include "../Device.h"
void USB_Device_SendRemoteWakeup(void)
{
// TODO
}
#endif
/*
LUFA Library
Copyright (C) Dean Camera, 2011.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2011 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
permission notice and warranty disclaimer appear in supporting
documentation, and that the name of the author not be used in
advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
software, including all implied warranties of merchantability
and fitness. In no event shall the author be liable for any
special, indirect or consequential damages or any damages
whatsoever resulting from loss of use, data or profits, whether
in an action of contract, negligence or other tortious action,
arising out of or in connection with the use or performance of
this software.
*/
/** \file
* \brief USB Device definitions for the AVR XMEGA microcontrollers.
* \copydetails Group_Device_XMEGA
*
* \note This file should not be included directly. It is automatically included as needed by the USB driver
* dispatch header located in LUFA/Drivers/USB/USB.h.
*/
/** \ingroup Group_Device
* \defgroup Group_Device_XMEGA Device Management (XMEGA)
* \brief USB Device definitions for the AVR XMEGA microcontrollers.
*
* Architecture specific USB Device definitions for the Atmel AVR XMEGA microcontrollers.
*
* @{
*/
#ifndef __USBDEVICE_XMEGA_H__
#define __USBDEVICE_XMEGA_H__
/* Includes: */
#include "../../../../Common/Common.h"
#include "../StdDescriptors.h"
#include "../USBInterrupt.h"
#include "../Endpoint.h"
/* Enable C linkage for C++ Compilers: */
#if defined(__cplusplus)
extern "C" {
#endif
/* Preprocessor Checks: */
#if !defined(__INCLUDE_FROM_USB_DRIVER)
#error Do not include this file directly. Include LUFA/Drivers/USB/USB.h instead.
#endif
#if (defined(USE_RAM_DESCRIPTORS) && defined(USE_EEPROM_DESCRIPTORS))
#error USE_RAM_DESCRIPTORS and USE_EEPROM_DESCRIPTORS are mutually exclusive.
#endif
/* Public Interface - May be used in end-application: */
/* Macros: */
/** \name USB Device Mode Option Masks */
//@{
/** 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.
*
* \note Low Speed mode is not available on all USB AVR models.
* \n
*
* \note Restrictions apply on the number, size and type of endpoints which can be used
* when running in low speed mode - refer to the USB 2.0 specification.
*/
#define USB_DEVICE_OPT_LOWSPEED (1 << 0)
/** Mask for the Options parameter of the \ref USB_Init() function. This indicates that the
* USB interface should be initialized in full speed (12Mb/s) mode.
*/
#define USB_DEVICE_OPT_FULLSPEED (0 << 0)
//@}
/** String descriptor index for the device's unique serial number string descriptor within the device.
* This unique serial number is used by the host to associate resources to the device (such as drivers or COM port
* number allocations) to a device regardless of the port it is plugged in to on the host. Some microcontrollers contain
* a unique serial number internally, and setting the device descriptors serial number string index to this value
* will cause it to use the internal serial number.
*
* On unsupported devices, this will evaluate to \ref NO_DESCRIPTOR and so will force the host to create a pseudo-serial
* number for the device.
*/
#define USE_INTERNAL_SERIAL NO_DESCRIPTOR
/** Length of the device's unique internal serial number, in bits, if present on the selected microcontroller
* model.
*/
#define INTERNAL_SERIAL_LENGTH_BITS 0
/** Start address of the internal serial number, in the appropriate address space, if present on the selected microcontroller
* model.
*/
#define INTERNAL_SERIAL_START_ADDRESS 0
/* Function Prototypes: */
/** Sends a Remote Wakeup request to the host. This signals to the host that the device should
* be taken out of suspended mode, and communications should resume.
*
* Typically, this is implemented so that HID devices (mice, keyboards, etc.) can wake up the
* host computer when the host has suspended all USB devices to enter a low power state.
*
* \note This macro should only be used if the device has indicated to the host that it
* supports the Remote Wakeup feature in the device descriptors, and should only be
* issued if the host is currently allowing remote wakeup events from the device (i.e.,
* the \ref USB_Device_RemoteWakeupEnabled flag is set). When the \c NO_DEVICE_REMOTE_WAKEUP
* compile time option is used, this macro is unavailable.
* \n\n
*
* \note The USB clock must be running for this function to operate. If the stack is initialized with
* the \ref USB_OPT_MANUAL_PLL option enabled, the user must ensure that the PLL is running
* before attempting to call this function.
*
* \see \ref Group_StdDescriptors for more information on the RMWAKEUP feature and device descriptors.
*/
void USB_Device_SendRemoteWakeup(void);
/* Inline Functions: */
/** Returns the current USB frame number, when in device mode. Every millisecond the USB bus is active (i.e. enumerated to a host)
* the frame number is incremented by one.
*/
static inline uint16_t USB_Device_GetFrameNumber(void) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT;
static inline uint16_t USB_Device_GetFrameNumber(void)
{
return 0; // TODO
}
#if !defined(NO_SOF_EVENTS)
/** Enables the device mode Start Of Frame events. When enabled, this causes the
* \ref EVENT_USB_Device_StartOfFrame() event to fire once per millisecond, synchronized to the USB bus,
* at the start of each USB frame when enumerated in device mode.
*
* \note Not available when the \c NO_SOF_EVENTS compile time token is defined.
*/
static inline void USB_Device_EnableSOFEvents(void) ATTR_ALWAYS_INLINE;
static inline void USB_Device_EnableSOFEvents(void)
{
// TODO
}
/** Disables the device mode Start Of Frame events. When disabled, this stops the firing of the
* \ref EVENT_USB_Device_StartOfFrame() event when enumerated in device mode.
*
* \note Not available when the \c NO_SOF_EVENTS compile time token is defined.
*/
static inline void USB_Device_DisableSOFEvents(void) ATTR_ALWAYS_INLINE;
static inline void USB_Device_DisableSOFEvents(void)
{
// TODO
}
#endif
/* Private Interface - For use in library only: */
#if !defined(__DOXYGEN__)
/* Inline Functions: */
static inline void USB_Device_SetLowSpeed(void) ATTR_ALWAYS_INLINE;
static inline void USB_Device_SetLowSpeed(void)
{
// TODO
}
static inline void USB_Device_SetFullSpeed(void) ATTR_ALWAYS_INLINE;
static inline void USB_Device_SetFullSpeed(void)
{
// TODO
}
static inline void USB_Device_SetDeviceAddress(const uint8_t Address) ATTR_ALWAYS_INLINE;
static inline void USB_Device_SetDeviceAddress(const uint8_t Address)
{
// TODO
}
static inline bool USB_Device_IsAddressSet(void) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT;
static inline bool USB_Device_IsAddressSet(void)
{
return false; // TODO
}
#if (USE_INTERNAL_SERIAL != NO_DESCRIPTOR)
static inline void USB_Device_GetSerialString(uint16_t* const UnicodeString) ATTR_NON_NULL_PTR_ARG(1);
static inline void USB_Device_GetSerialString(uint16_t* const UnicodeString)
{
// TODO
}
#endif
#endif
/* Disable C linkage for C++ Compilers: */
#if defined(__cplusplus)
}
#endif
#endif
/** @} */
/*
LUFA Library
Copyright (C) Dean Camera, 2011.
dean [at] fourwalledcubicle [dot] com
www.lufa-lib.org
*/
/*
Copyright 2011 Dean Camera (dean [at] fourwalledcubicle [dot] com)
Permission to use, copy, modify, distribute, and sell this
software and its documentation for any purpose is hereby granted
without fee, provided that the above copyright notice appear in
all copies and that both that the copyright notice and this
permission notice and warranty disclaimer appear in supporting
documentation, and that the name of the author not be used in
advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
The author disclaim all warranties with regard to this
software, including all implied warranties of merchantability
and fitness. In no event shall the author be liable for any
special, indirect or consequential damages or any damages
whatsoever resulting from loss of use, data or profits, whether
in an action of contract, negligence or other tortious action,
arising out of or in connection with the use or performance of
this software.
*/
#define __INCLUDE_FROM_USB_DRIVER
#include "../USBMode.h"
#if defined(USB_CAN_BE_DEVICE)
#include "EndpointStream_XMEGA.h"
#if !defined(CONTROL_ONLY_DEVICE)
uint8_t Endpoint_Discard_Stream(uint16_t Length,
uint16_t* const BytesProcessed)
{
return 0; // TODO
}
uint8_t Endpoint_Null_Stream(uint16_t Length,
uint16_t* const BytesProcessed)
{
return 0; // TODO
}
#define TEMPLATE_FUNC_NAME Endpoint_Write_Stream_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_8(*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()
#define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1)
#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr -= Amount
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_8(*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()
#define TEMPLATE_BUFFER_OFFSET(Length) 0
#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr += Amount
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) *BufferPtr = Endpoint_Read_8()
#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()
#define TEMPLATE_BUFFER_OFFSET(Length) (Length - 1)
#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr -= Amount
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) *BufferPtr = Endpoint_Read_8()
#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_8(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_8(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_8(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_8(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_8())
#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_8())
#include "Template/Template_Endpoint_RW.c"
#endif
#endif
#define TEMPLATE_FUNC_NAME Endpoint_Write_Control_Stream_LE
#define TEMPLATE_BUFFER_OFFSET(Length) 0
#define TEMPLATE_BUFFER_MOVE(BufferPtr, Amount) BufferPtr += Amount
#define TEMPLATE_TRANSFER_BYTE(BufferPtr) Endpoint_Write_8(*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_8(*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_8()
#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_8()
#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_8(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_8(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_8(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_8(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_8())
#include "Template/Template_Endpoint_Control_R.c"