Namespace out the internal endpoint and pipe globals in the UC3 architecture.
authorDean Camera <dean@fourwalledcubicle.com>
Sun, 30 Oct 2011 14:03:53 +0000 (14:03 +0000)
committerDean Camera <dean@fourwalledcubicle.com>
Sun, 30 Oct 2011 14:03:53 +0000 (14:03 +0000)
LUFA/Drivers/USB/Core/UC3/Endpoint_UC3.c
LUFA/Drivers/USB/Core/UC3/Endpoint_UC3.h
LUFA/Drivers/USB/Core/UC3/Pipe_UC3.c
LUFA/Drivers/USB/Core/UC3/Pipe_UC3.h

index 19a57a1..7cd7ccf 100644 (file)
@@ -39,8 +39,8 @@
 uint8_t USB_Device_ControlEndpointSize = ENDPOINT_CONTROLEP_DEFAULT_SIZE;
 #endif
 
 uint8_t USB_Device_ControlEndpointSize = ENDPOINT_CONTROLEP_DEFAULT_SIZE;
 #endif
 
-volatile uint32_t USB_SelectedEndpoint = ENDPOINT_CONTROLEP;
-volatile uint8_t* USB_EndpointFIFOPos[ENDPOINT_TOTAL_ENDPOINTS];
+volatile uint32_t USB_Endpoint_SelectedEndpoint = ENDPOINT_CONTROLEP;
+volatile uint8_t* USB_Endpoint_FIFOPos[ENDPOINT_TOTAL_ENDPOINTS];
 
 bool Endpoint_ConfigureEndpoint_Prv(const uint8_t Number,
                                     const uint32_t UECFG0Data)
 
 bool Endpoint_ConfigureEndpoint_Prv(const uint8_t Number,
                                     const uint32_t UECFG0Data)
index 3fd0d4c..0e316c8 100644 (file)
                                                            const uint32_t UECFGXData);
                
                /* External Variables: */
                                                            const uint32_t UECFGXData);
                
                /* External Variables: */
-                       extern volatile uint32_t USB_SelectedEndpoint;
-                       extern volatile uint8_t* USB_EndpointFIFOPos[];
+                       extern volatile uint32_t USB_Endpoint_SelectedEndpoint;
+                       extern volatile uint8_t* USB_Endpoint_FIFOPos[];
        #endif
 
        /* Public Interface - May be used in end-application: */
        #endif
 
        /* Public Interface - May be used in end-application: */
                        static inline uint16_t Endpoint_BytesInEndpoint(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline uint16_t Endpoint_BytesInEndpoint(void)
                        {
                        static inline uint16_t Endpoint_BytesInEndpoint(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline uint16_t Endpoint_BytesInEndpoint(void)
                        {
-                               return (&AVR32_USBB.UESTA0)[USB_SelectedEndpoint].byct;
+                               return (&AVR32_USBB.UESTA0)[USB_Endpoint_SelectedEndpoint].byct;
                        }
 
                        /** Get the endpoint address of the currently selected endpoint. This is typically used to save
                        }
 
                        /** Get the endpoint address of the currently selected endpoint. This is typically used to save
                        static inline uint8_t Endpoint_GetCurrentEndpoint(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline uint8_t Endpoint_GetCurrentEndpoint(void)
                        {
                        static inline uint8_t Endpoint_GetCurrentEndpoint(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline uint8_t Endpoint_GetCurrentEndpoint(void)
                        {
-                               return USB_SelectedEndpoint;
+                               return USB_Endpoint_SelectedEndpoint;
                        }
 
                        /** Selects the given endpoint number. If the address from the device descriptors is used, the
                        }
 
                        /** Selects the given endpoint number. If the address from the device descriptors is used, the
                        static inline void Endpoint_SelectEndpoint(const uint8_t EndpointNumber) ATTR_ALWAYS_INLINE;
                        static inline void Endpoint_SelectEndpoint(const uint8_t EndpointNumber)
                        {
                        static inline void Endpoint_SelectEndpoint(const uint8_t EndpointNumber) ATTR_ALWAYS_INLINE;
                        static inline void Endpoint_SelectEndpoint(const uint8_t EndpointNumber)
                        {
-                               USB_SelectedEndpoint = EndpointNumber;
+                               USB_Endpoint_SelectedEndpoint = EndpointNumber;
                        }
 
                        /** Resets the endpoint bank FIFO. This clears all the endpoint banks and resets the USB controller's
                        }
 
                        /** Resets the endpoint bank FIFO. This clears all the endpoint banks and resets the USB controller's
                        {
                                AVR32_USBB.uerst |=  (AVR32_USBB_EPRST0_MASK << EndpointNumber);
                                AVR32_USBB.uerst &= ~(AVR32_USBB_EPRST0_MASK << EndpointNumber);
                        {
                                AVR32_USBB.uerst |=  (AVR32_USBB_EPRST0_MASK << EndpointNumber);
                                AVR32_USBB.uerst &= ~(AVR32_USBB_EPRST0_MASK << EndpointNumber);
-                               USB_EndpointFIFOPos[EndpointNumber] = &AVR32_USBB_SLAVE[EndpointNumber * ENDPOINT_HSB_ADDRESS_SPACE_SIZE];
+                               USB_Endpoint_FIFOPos[EndpointNumber] = &AVR32_USBB_SLAVE[EndpointNumber * ENDPOINT_HSB_ADDRESS_SPACE_SIZE];
                        }
 
                        /** Enables the currently selected endpoint so that data can be sent and received through it to
                        }
 
                        /** Enables the currently selected endpoint so that data can be sent and received through it to
                        static inline void Endpoint_EnableEndpoint(void) ATTR_ALWAYS_INLINE;
                        static inline void Endpoint_EnableEndpoint(void)
                        {
                        static inline void Endpoint_EnableEndpoint(void) ATTR_ALWAYS_INLINE;
                        static inline void Endpoint_EnableEndpoint(void)
                        {
-                               AVR32_USBB.uerst |=  (AVR32_USBB_EPEN0_MASK << USB_SelectedEndpoint);
+                               AVR32_USBB.uerst |=  (AVR32_USBB_EPEN0_MASK << USB_Endpoint_SelectedEndpoint);
                        }
 
                        /** Disables the currently selected endpoint so that data cannot be sent and received through it
                        }
 
                        /** Disables the currently selected endpoint so that data cannot be sent and received through it
                        static inline void Endpoint_DisableEndpoint(void) ATTR_ALWAYS_INLINE;
                        static inline void Endpoint_DisableEndpoint(void)
                        {
                        static inline void Endpoint_DisableEndpoint(void) ATTR_ALWAYS_INLINE;
                        static inline void Endpoint_DisableEndpoint(void)
                        {
-                               AVR32_USBB.uerst &= ~(AVR32_USBB_EPEN0_MASK << USB_SelectedEndpoint);
+                               AVR32_USBB.uerst &= ~(AVR32_USBB_EPEN0_MASK << USB_Endpoint_SelectedEndpoint);
                        }
 
                        /** Determines if the currently selected endpoint is enabled, but not necessarily configured.
                        }
 
                        /** Determines if the currently selected endpoint is enabled, but not necessarily configured.
                        static inline bool Endpoint_IsEnabled(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline bool Endpoint_IsEnabled(void)
                        {
                        static inline bool Endpoint_IsEnabled(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline bool Endpoint_IsEnabled(void)
                        {
-                               return ((AVR32_USBB.uerst & (AVR32_USBB_EPEN0_MASK << USB_SelectedEndpoint)) ? true : false);
+                               return ((AVR32_USBB.uerst & (AVR32_USBB_EPEN0_MASK << USB_Endpoint_SelectedEndpoint)) ? true : false);
                        }
 
                        /** Retrieves the number of busy banks in the currently selected endpoint, which have been queued for
                        }
 
                        /** Retrieves the number of busy banks in the currently selected endpoint, which have been queued for
                        static inline uint8_t Endpoint_GetBusyBanks(void) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT;
                        static inline uint8_t Endpoint_GetBusyBanks(void)
                        {
                        static inline uint8_t Endpoint_GetBusyBanks(void) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT;
                        static inline uint8_t Endpoint_GetBusyBanks(void)
                        {
-                               return (&AVR32_USBB.UESTA0)[USB_SelectedEndpoint].nbusybk;
+                               return (&AVR32_USBB.UESTA0)[USB_Endpoint_SelectedEndpoint].nbusybk;
                        }
 
                        /** Aborts all pending IN transactions on the currently selected endpoint, once the bank
                        }
 
                        /** Aborts all pending IN transactions on the currently selected endpoint, once the bank
                        {
                                while (Endpoint_GetBusyBanks() != 0)
                                {
                        {
                                while (Endpoint_GetBusyBanks() != 0)
                                {
-                                       (&AVR32_USBB.UECON0SET)[USB_SelectedEndpoint].killbks = true;
-                                       while ((&AVR32_USBB.UECON0)[USB_SelectedEndpoint].killbk);
+                                       (&AVR32_USBB.UECON0SET)[USB_Endpoint_SelectedEndpoint].killbks = true;
+                                       while ((&AVR32_USBB.UECON0)[USB_Endpoint_SelectedEndpoint].killbk);
                                }
                        }
                        
                                }
                        }
                        
                        static inline bool Endpoint_IsReadWriteAllowed(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline bool Endpoint_IsReadWriteAllowed(void)
                        {
                        static inline bool Endpoint_IsReadWriteAllowed(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline bool Endpoint_IsReadWriteAllowed(void)
                        {
-                               return (&AVR32_USBB.UESTA0)[USB_SelectedEndpoint].rwall;
+                               return (&AVR32_USBB.UESTA0)[USB_Endpoint_SelectedEndpoint].rwall;
                        }
 
                        /** Determines if the currently selected endpoint is configured.
                        }
 
                        /** Determines if the currently selected endpoint is configured.
                        static inline bool Endpoint_IsConfigured(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline bool Endpoint_IsConfigured(void)
                        {
                        static inline bool Endpoint_IsConfigured(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline bool Endpoint_IsConfigured(void)
                        {
-                               return (&AVR32_USBB.UESTA0)[USB_SelectedEndpoint].cfgok;
+                               return (&AVR32_USBB.UESTA0)[USB_Endpoint_SelectedEndpoint].cfgok;
                        }
 
                        /** Returns a mask indicating which INTERRUPT type endpoints have interrupted - i.e. their
                        }
 
                        /** Returns a mask indicating which INTERRUPT type endpoints have interrupted - i.e. their
                        static inline bool Endpoint_IsINReady(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline bool Endpoint_IsINReady(void)
                        {
                        static inline bool Endpoint_IsINReady(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline bool Endpoint_IsINReady(void)
                        {
-                               return (&AVR32_USBB.UESTA0)[USB_SelectedEndpoint].txini;
+                               return (&AVR32_USBB.UESTA0)[USB_Endpoint_SelectedEndpoint].txini;
                        }
 
                        /** Determines if the selected OUT endpoint has received new packet from the host.
                        }
 
                        /** Determines if the selected OUT endpoint has received new packet from the host.
                        static inline bool Endpoint_IsOUTReceived(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline bool Endpoint_IsOUTReceived(void)
                        {
                        static inline bool Endpoint_IsOUTReceived(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline bool Endpoint_IsOUTReceived(void)
                        {
-                               return (&AVR32_USBB.UESTA0)[USB_SelectedEndpoint].rxouti;
+                               return (&AVR32_USBB.UESTA0)[USB_Endpoint_SelectedEndpoint].rxouti;
                        }
 
                        /** Determines if the current CONTROL type endpoint has received a SETUP packet.
                        }
 
                        /** Determines if the current CONTROL type endpoint has received a SETUP packet.
                        static inline bool Endpoint_IsSETUPReceived(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline bool Endpoint_IsSETUPReceived(void)
                        {
                        static inline bool Endpoint_IsSETUPReceived(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline bool Endpoint_IsSETUPReceived(void)
                        {
-                               return (&AVR32_USBB.UESTA0)[USB_SelectedEndpoint].rxstpi;
+                               return (&AVR32_USBB.UESTA0)[USB_Endpoint_SelectedEndpoint].rxstpi;
                        }
 
                        /** Clears a received SETUP packet on the currently selected CONTROL type endpoint, freeing up the
                        }
 
                        /** Clears a received SETUP packet on the currently selected CONTROL type endpoint, freeing up the
                        static inline void Endpoint_ClearSETUP(void) ATTR_ALWAYS_INLINE;
                        static inline void Endpoint_ClearSETUP(void)
                        {
                        static inline void Endpoint_ClearSETUP(void) ATTR_ALWAYS_INLINE;
                        static inline void Endpoint_ClearSETUP(void)
                        {
-                               (&AVR32_USBB.UESTA0CLR)[USB_SelectedEndpoint].rxstpic = true;
-                               USB_EndpointFIFOPos[USB_SelectedEndpoint] = &AVR32_USBB_SLAVE[USB_SelectedEndpoint * ENDPOINT_HSB_ADDRESS_SPACE_SIZE];
+                               (&AVR32_USBB.UESTA0CLR)[USB_Endpoint_SelectedEndpoint].rxstpic = true;
+                               USB_Endpoint_FIFOPos[USB_Endpoint_SelectedEndpoint] = &AVR32_USBB_SLAVE[USB_Endpoint_SelectedEndpoint * ENDPOINT_HSB_ADDRESS_SPACE_SIZE];
                        }
 
                        /** Sends an IN packet to the host on the currently selected endpoint, freeing up the endpoint for the
                        }
 
                        /** Sends an IN packet to the host on the currently selected endpoint, freeing up the endpoint for the
                        static inline void Endpoint_ClearIN(void) ATTR_ALWAYS_INLINE;
                        static inline void Endpoint_ClearIN(void)
                        {
                        static inline void Endpoint_ClearIN(void) ATTR_ALWAYS_INLINE;
                        static inline void Endpoint_ClearIN(void)
                        {
-                               (&AVR32_USBB.UESTA0CLR)[USB_SelectedEndpoint].txinic   = true;
-                               (&AVR32_USBB.UECON0CLR)[USB_SelectedEndpoint].fifoconc = true;
-                               USB_EndpointFIFOPos[USB_SelectedEndpoint] = &AVR32_USBB_SLAVE[USB_SelectedEndpoint * ENDPOINT_HSB_ADDRESS_SPACE_SIZE];
+                               (&AVR32_USBB.UESTA0CLR)[USB_Endpoint_SelectedEndpoint].txinic   = true;
+                               (&AVR32_USBB.UECON0CLR)[USB_Endpoint_SelectedEndpoint].fifoconc = true;
+                               USB_Endpoint_FIFOPos[USB_Endpoint_SelectedEndpoint] = &AVR32_USBB_SLAVE[USB_Endpoint_SelectedEndpoint * ENDPOINT_HSB_ADDRESS_SPACE_SIZE];
                        }
 
                        /** Acknowledges an OUT packet to the host on the currently selected endpoint, freeing up the endpoint
                        }
 
                        /** Acknowledges an OUT packet to the host on the currently selected endpoint, freeing up the endpoint
                        static inline void Endpoint_ClearOUT(void) ATTR_ALWAYS_INLINE;
                        static inline void Endpoint_ClearOUT(void)
                        {
                        static inline void Endpoint_ClearOUT(void) ATTR_ALWAYS_INLINE;
                        static inline void Endpoint_ClearOUT(void)
                        {
-                               (&AVR32_USBB.UESTA0CLR)[USB_SelectedEndpoint].rxoutic  = true;
-                               (&AVR32_USBB.UECON0CLR)[USB_SelectedEndpoint].fifoconc = true;
-                               USB_EndpointFIFOPos[USB_SelectedEndpoint] = &AVR32_USBB_SLAVE[USB_SelectedEndpoint * ENDPOINT_HSB_ADDRESS_SPACE_SIZE];
+                               (&AVR32_USBB.UESTA0CLR)[USB_Endpoint_SelectedEndpoint].rxoutic  = true;
+                               (&AVR32_USBB.UECON0CLR)[USB_Endpoint_SelectedEndpoint].fifoconc = true;
+                               USB_Endpoint_FIFOPos[USB_Endpoint_SelectedEndpoint] = &AVR32_USBB_SLAVE[USB_Endpoint_SelectedEndpoint * ENDPOINT_HSB_ADDRESS_SPACE_SIZE];
                        }
 
                        /** Stalls the current endpoint, indicating to the host that a logical problem occurred with the
                        }
 
                        /** Stalls the current endpoint, indicating to the host that a logical problem occurred with the
                        static inline void Endpoint_StallTransaction(void) ATTR_ALWAYS_INLINE;
                        static inline void Endpoint_StallTransaction(void)
                        {
                        static inline void Endpoint_StallTransaction(void) ATTR_ALWAYS_INLINE;
                        static inline void Endpoint_StallTransaction(void)
                        {
-                               (&AVR32_USBB.UECON0SET)[USB_SelectedEndpoint].stallrqs = true;
+                               (&AVR32_USBB.UECON0SET)[USB_Endpoint_SelectedEndpoint].stallrqs = true;
                        }
 
                        /** Clears the STALL condition on the currently selected endpoint.
                        }
 
                        /** Clears the STALL condition on the currently selected endpoint.
                        static inline void Endpoint_ClearStall(void) ATTR_ALWAYS_INLINE;
                        static inline void Endpoint_ClearStall(void)
                        {
                        static inline void Endpoint_ClearStall(void) ATTR_ALWAYS_INLINE;
                        static inline void Endpoint_ClearStall(void)
                        {
-                               (&AVR32_USBB.UECON0CLR)[USB_SelectedEndpoint].stallrqc = true;
+                               (&AVR32_USBB.UECON0CLR)[USB_Endpoint_SelectedEndpoint].stallrqc = true;
                        }
 
                        /** Determines if the currently selected endpoint is stalled, false otherwise.
                        }
 
                        /** Determines if the currently selected endpoint is stalled, false otherwise.
                        static inline bool Endpoint_IsStalled(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline bool Endpoint_IsStalled(void)
                        {
                        static inline bool Endpoint_IsStalled(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline bool Endpoint_IsStalled(void)
                        {
-                               return (&AVR32_USBB.UECON0)[USB_SelectedEndpoint].stallrq;
+                               return (&AVR32_USBB.UECON0)[USB_Endpoint_SelectedEndpoint].stallrq;
                        }
 
                        /** Resets the data toggle of the currently selected endpoint. */
                        static inline void Endpoint_ResetDataToggle(void) ATTR_ALWAYS_INLINE;
                        static inline void Endpoint_ResetDataToggle(void)
                        {
                        }
 
                        /** Resets the data toggle of the currently selected endpoint. */
                        static inline void Endpoint_ResetDataToggle(void) ATTR_ALWAYS_INLINE;
                        static inline void Endpoint_ResetDataToggle(void)
                        {
-                               (&AVR32_USBB.UECON0SET)[USB_SelectedEndpoint].rstdts = true;
+                               (&AVR32_USBB.UECON0SET)[USB_Endpoint_SelectedEndpoint].rstdts = true;
                        }
 
                        /** Determines the currently selected endpoint's direction.
                        }
 
                        /** Determines the currently selected endpoint's direction.
                        static inline uint32_t Endpoint_GetEndpointDirection(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline uint32_t Endpoint_GetEndpointDirection(void)
                        {
                        static inline uint32_t Endpoint_GetEndpointDirection(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline uint32_t Endpoint_GetEndpointDirection(void)
                        {
-                               return ((&AVR32_USBB.UECFG0)[USB_SelectedEndpoint].epdir ? ENDPOINT_DIR_IN : ENDPOINT_DIR_OUT);
+                               return ((&AVR32_USBB.UECFG0)[USB_Endpoint_SelectedEndpoint].epdir ? ENDPOINT_DIR_IN : ENDPOINT_DIR_OUT);
                        }
 
                        /** Sets the direction of the currently selected endpoint.
                        }
 
                        /** Sets the direction of the currently selected endpoint.
                        static inline void Endpoint_SetEndpointDirection(const uint32_t DirectionMask) ATTR_ALWAYS_INLINE;
                        static inline void Endpoint_SetEndpointDirection(const uint32_t DirectionMask)
                        {
                        static inline void Endpoint_SetEndpointDirection(const uint32_t DirectionMask) ATTR_ALWAYS_INLINE;
                        static inline void Endpoint_SetEndpointDirection(const uint32_t DirectionMask)
                        {
-                               (&AVR32_USBB.UECFG0)[USB_SelectedEndpoint].epdir = (DirectionMask == ENDPOINT_DIR_IN);
+                               (&AVR32_USBB.UECFG0)[USB_Endpoint_SelectedEndpoint].epdir = (DirectionMask == ENDPOINT_DIR_IN);
                        }
 
                        /** Reads one byte from the currently selected endpoint's bank, for OUT direction endpoints.
                        }
 
                        /** Reads one byte from the currently selected endpoint's bank, for OUT direction endpoints.
                        static inline uint8_t Endpoint_Read_8(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline uint8_t Endpoint_Read_8(void)
                        {
                        static inline uint8_t Endpoint_Read_8(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline uint8_t Endpoint_Read_8(void)
                        {
-                               return *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++);
+                               return *(USB_Endpoint_FIFOPos[USB_Endpoint_SelectedEndpoint]++);
                        }
 
                        /** Writes one byte to the currently selected endpoint's bank, for IN direction endpoints.
                        }
 
                        /** Writes one byte to the currently selected endpoint's bank, for IN direction endpoints.
                        static inline void Endpoint_Write_8(const uint8_t Data) ATTR_ALWAYS_INLINE;
                        static inline void Endpoint_Write_8(const uint8_t Data)
                        {
                        static inline void Endpoint_Write_8(const uint8_t Data) ATTR_ALWAYS_INLINE;
                        static inline void Endpoint_Write_8(const uint8_t Data)
                        {
-                               *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++) = Data;
+                               *(USB_Endpoint_FIFOPos[USB_Endpoint_SelectedEndpoint]++) = Data;
                        }
 
                        /** 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.
                        {
                                uint8_t Dummy;
 
                        {
                                uint8_t Dummy;
 
-                               Dummy = *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++);
+                               Dummy = *(USB_Endpoint_FIFOPos[USB_Endpoint_SelectedEndpoint]++);
 
                                (void)Dummy;
                        }
 
                                (void)Dummy;
                        }
                        static inline uint16_t Endpoint_Read_16_LE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline uint16_t Endpoint_Read_16_LE(void)
                        {
                        static inline uint16_t Endpoint_Read_16_LE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline uint16_t Endpoint_Read_16_LE(void)
                        {
-                               uint16_t Byte0 = *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++);
-                               uint16_t Byte1 = *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++);
+                               uint16_t Byte0 = *(USB_Endpoint_FIFOPos[USB_Endpoint_SelectedEndpoint]++);
+                               uint16_t Byte1 = *(USB_Endpoint_FIFOPos[USB_Endpoint_SelectedEndpoint]++);
 
                                return ((Byte1 << 8) | Byte0);
                        }
 
                                return ((Byte1 << 8) | Byte0);
                        }
                        static inline uint16_t Endpoint_Read_16_BE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline uint16_t Endpoint_Read_16_BE(void)
                        {
                        static inline uint16_t Endpoint_Read_16_BE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline uint16_t Endpoint_Read_16_BE(void)
                        {
-                               uint16_t Byte0 = *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++);
-                               uint16_t Byte1 = *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++);
+                               uint16_t Byte0 = *(USB_Endpoint_FIFOPos[USB_Endpoint_SelectedEndpoint]++);
+                               uint16_t Byte1 = *(USB_Endpoint_FIFOPos[USB_Endpoint_SelectedEndpoint]++);
 
                                return ((Byte0 << 8) | Byte1);
                        }
 
                                return ((Byte0 << 8) | Byte1);
                        }
                        static inline void Endpoint_Write_16_LE(const uint16_t Data) ATTR_ALWAYS_INLINE;
                        static inline void Endpoint_Write_16_LE(const uint16_t Data)
                        {
                        static inline void Endpoint_Write_16_LE(const uint16_t Data) ATTR_ALWAYS_INLINE;
                        static inline void Endpoint_Write_16_LE(const uint16_t Data)
                        {
-                               *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++) = (Data >> 8);
-                               *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++) = (Data & 0xFF);
+                               *(USB_Endpoint_FIFOPos[USB_Endpoint_SelectedEndpoint]++) = (Data >> 8);
+                               *(USB_Endpoint_FIFOPos[USB_Endpoint_SelectedEndpoint]++) = (Data & 0xFF);
                        }
 
                        /** 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
                        static inline void Endpoint_Write_16_BE(const uint16_t Data) ATTR_ALWAYS_INLINE;
                        static inline void Endpoint_Write_16_BE(const uint16_t Data)
                        {
                        static inline void Endpoint_Write_16_BE(const uint16_t Data) ATTR_ALWAYS_INLINE;
                        static inline void Endpoint_Write_16_BE(const uint16_t Data)
                        {
-                               *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++) = (Data & 0xFF);
-                               *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++) = (Data >> 8);
+                               *(USB_Endpoint_FIFOPos[USB_Endpoint_SelectedEndpoint]++) = (Data & 0xFF);
+                               *(USB_Endpoint_FIFOPos[USB_Endpoint_SelectedEndpoint]++) = (Data >> 8);
                        }
 
                        /** 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.
                        {
                                uint8_t Dummy;
 
                        {
                                uint8_t Dummy;
 
-                               Dummy = *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++);
-                               Dummy = *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++);
+                               Dummy = *(USB_Endpoint_FIFOPos[USB_Endpoint_SelectedEndpoint]++);
+                               Dummy = *(USB_Endpoint_FIFOPos[USB_Endpoint_SelectedEndpoint]++);
 
                                (void)Dummy;
                        }
 
                                (void)Dummy;
                        }
                        static inline uint32_t Endpoint_Read_32_LE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline uint32_t Endpoint_Read_32_LE(void)
                        {
                        static inline uint32_t Endpoint_Read_32_LE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline uint32_t Endpoint_Read_32_LE(void)
                        {
-                               uint32_t Byte0 = *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++);
-                               uint32_t Byte1 = *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++);
-                               uint32_t Byte2 = *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++);
-                               uint32_t Byte3 = *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++);
+                               uint32_t Byte0 = *(USB_Endpoint_FIFOPos[USB_Endpoint_SelectedEndpoint]++);
+                               uint32_t Byte1 = *(USB_Endpoint_FIFOPos[USB_Endpoint_SelectedEndpoint]++);
+                               uint32_t Byte2 = *(USB_Endpoint_FIFOPos[USB_Endpoint_SelectedEndpoint]++);
+                               uint32_t Byte3 = *(USB_Endpoint_FIFOPos[USB_Endpoint_SelectedEndpoint]++);
 
                                return ((Byte3 << 24) | (Byte2 << 16) | (Byte1 << 8) | Byte0);
                        }
 
                                return ((Byte3 << 24) | (Byte2 << 16) | (Byte1 << 8) | Byte0);
                        }
                        static inline uint32_t Endpoint_Read_32_BE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline uint32_t Endpoint_Read_32_BE(void)
                        {
                        static inline uint32_t Endpoint_Read_32_BE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline uint32_t Endpoint_Read_32_BE(void)
                        {
-                               uint32_t Byte0 = *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++);
-                               uint32_t Byte1 = *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++);
-                               uint32_t Byte2 = *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++);
-                               uint32_t Byte3 = *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++);
+                               uint32_t Byte0 = *(USB_Endpoint_FIFOPos[USB_Endpoint_SelectedEndpoint]++);
+                               uint32_t Byte1 = *(USB_Endpoint_FIFOPos[USB_Endpoint_SelectedEndpoint]++);
+                               uint32_t Byte2 = *(USB_Endpoint_FIFOPos[USB_Endpoint_SelectedEndpoint]++);
+                               uint32_t Byte3 = *(USB_Endpoint_FIFOPos[USB_Endpoint_SelectedEndpoint]++);
 
                                return ((Byte0 << 24) | (Byte1 << 16) | (Byte2 << 8) | Byte3);
                        }
 
                                return ((Byte0 << 24) | (Byte1 << 16) | (Byte2 << 8) | Byte3);
                        }
                        static inline void Endpoint_Write_32_LE(const uint32_t Data) ATTR_ALWAYS_INLINE;
                        static inline void Endpoint_Write_32_LE(const uint32_t Data)
                        {
                        static inline void Endpoint_Write_32_LE(const uint32_t Data) ATTR_ALWAYS_INLINE;
                        static inline void Endpoint_Write_32_LE(const uint32_t Data)
                        {
-                               *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++) = (Data >> 24);
-                               *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++) = (Data >> 16);
-                               *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++) = (Data >> 8);
-                               *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++) = (Data &  0xFF);
+                               *(USB_Endpoint_FIFOPos[USB_Endpoint_SelectedEndpoint]++) = (Data >> 24);
+                               *(USB_Endpoint_FIFOPos[USB_Endpoint_SelectedEndpoint]++) = (Data >> 16);
+                               *(USB_Endpoint_FIFOPos[USB_Endpoint_SelectedEndpoint]++) = (Data >> 8);
+                               *(USB_Endpoint_FIFOPos[USB_Endpoint_SelectedEndpoint]++) = (Data &  0xFF);
                        }
 
                        /** 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
                        static inline void Endpoint_Write_32_BE(const uint32_t Data) ATTR_ALWAYS_INLINE;
                        static inline void Endpoint_Write_32_BE(const uint32_t Data)
                        {
                        static inline void Endpoint_Write_32_BE(const uint32_t Data) ATTR_ALWAYS_INLINE;
                        static inline void Endpoint_Write_32_BE(const uint32_t Data)
                        {
-                               *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++) = (Data &  0xFF);
-                               *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++) = (Data >> 8);
-                               *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++) = (Data >> 16);
-                               *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++) = (Data >> 24);
+                               *(USB_Endpoint_FIFOPos[USB_Endpoint_SelectedEndpoint]++) = (Data &  0xFF);
+                               *(USB_Endpoint_FIFOPos[USB_Endpoint_SelectedEndpoint]++) = (Data >> 8);
+                               *(USB_Endpoint_FIFOPos[USB_Endpoint_SelectedEndpoint]++) = (Data >> 16);
+                               *(USB_Endpoint_FIFOPos[USB_Endpoint_SelectedEndpoint]++) = (Data >> 24);
                        }
 
                        /** 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.
                        {
                                uint8_t Dummy;
 
                        {
                                uint8_t Dummy;
 
-                               Dummy = *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++);
-                               Dummy = *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++);
-                               Dummy = *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++);
-                               Dummy = *(USB_EndpointFIFOPos[USB_SelectedEndpoint]++);
+                               Dummy = *(USB_Endpoint_FIFOPos[USB_Endpoint_SelectedEndpoint]++);
+                               Dummy = *(USB_Endpoint_FIFOPos[USB_Endpoint_SelectedEndpoint]++);
+                               Dummy = *(USB_Endpoint_FIFOPos[USB_Endpoint_SelectedEndpoint]++);
+                               Dummy = *(USB_Endpoint_FIFOPos[USB_Endpoint_SelectedEndpoint]++);
 
                                (void)Dummy;
                        }
 
                                (void)Dummy;
                        }
index b425d3d..5c9a44f 100644 (file)
@@ -37,8 +37,8 @@
 
 uint8_t USB_Host_ControlPipeSize = PIPE_CONTROLPIPE_DEFAULT_SIZE;
 
 
 uint8_t USB_Host_ControlPipeSize = PIPE_CONTROLPIPE_DEFAULT_SIZE;
 
-volatile uint32_t USB_SelectedPipe = PIPE_CONTROLPIPE;
-volatile uint8_t* USB_PipeFIFOPos[PIPE_TOTAL_PIPES];
+volatile uint32_t USB_Pipe_SelectedPipe = PIPE_CONTROLPIPE;
+volatile uint8_t* USB_Pipe_FIFOPos[PIPE_TOTAL_PIPES];
 
 bool Pipe_ConfigurePipe(const uint8_t Number,
                         const uint8_t Type,
 
 bool Pipe_ConfigurePipe(const uint8_t Number,
                         const uint8_t Type,
index 26346e9..d99cfed 100644 (file)
                        #define PIPE_HSB_ADDRESS_SPACE_SIZE     (64 * 1024UL)
        
                /* External Variables: */
                        #define PIPE_HSB_ADDRESS_SPACE_SIZE     (64 * 1024UL)
        
                /* External Variables: */
-                       extern volatile uint32_t USB_SelectedPipe;
-                       extern volatile uint8_t* USB_PipeFIFOPos[];
+                       extern volatile uint32_t USB_Pipe_SelectedPipe;
+                       extern volatile uint8_t* USB_Pipe_FIFOPos[];
        #endif
 
        /* Public Interface - May be used in end-application: */
        #endif
 
        /* Public Interface - May be used in end-application: */
                        static inline uint16_t Pipe_BytesInPipe(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline uint16_t Pipe_BytesInPipe(void)
                        {
                        static inline uint16_t Pipe_BytesInPipe(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline uint16_t Pipe_BytesInPipe(void)
                        {
-                               return (&AVR32_USBB.UPSTA0)[USB_SelectedPipe].pbyct;
+                               return (&AVR32_USBB.UPSTA0)[USB_Pipe_SelectedPipe].pbyct;
                        }
 
                        /** Returns the pipe address of the currently selected pipe. This is typically used to save the
                        }
 
                        /** Returns the pipe address of the currently selected pipe. This is typically used to save the
                        static inline uint8_t Pipe_GetCurrentPipe(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline uint8_t Pipe_GetCurrentPipe(void)
                        {
                        static inline uint8_t Pipe_GetCurrentPipe(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline uint8_t Pipe_GetCurrentPipe(void)
                        {
-                               return USB_SelectedPipe;
+                               return USB_Pipe_SelectedPipe;
                        }
 
                        /** Selects the given pipe number. Any pipe operations which do not require the pipe number to be
                        }
 
                        /** Selects the given pipe number. Any pipe operations which do not require the pipe number to be
                        static inline void Pipe_SelectPipe(const uint8_t PipeNumber) ATTR_ALWAYS_INLINE;
                        static inline void Pipe_SelectPipe(const uint8_t PipeNumber)
                        {
                        static inline void Pipe_SelectPipe(const uint8_t PipeNumber) ATTR_ALWAYS_INLINE;
                        static inline void Pipe_SelectPipe(const uint8_t PipeNumber)
                        {
-                               USB_SelectedPipe = PipeNumber;
+                               USB_Pipe_SelectedPipe = PipeNumber;
                        }
 
                        /** Resets the desired pipe, including the pipe banks and flags.
                        }
 
                        /** Resets the desired pipe, including the pipe banks and flags.
                        {
                                AVR32_USBB.uprst |=  (AVR32_USBB_PRST0_MASK << PipeNumber);
                                AVR32_USBB.uprst &= ~(AVR32_USBB_PRST0_MASK << PipeNumber);
                        {
                                AVR32_USBB.uprst |=  (AVR32_USBB_PRST0_MASK << PipeNumber);
                                AVR32_USBB.uprst &= ~(AVR32_USBB_PRST0_MASK << PipeNumber);
-                               USB_PipeFIFOPos[USB_SelectedPipe] = &AVR32_USBB_SLAVE[USB_SelectedPipe * PIPE_HSB_ADDRESS_SPACE_SIZE];
+                               USB_Pipe_FIFOPos[USB_Pipe_SelectedPipe] = &AVR32_USBB_SLAVE[USB_Pipe_SelectedPipe * PIPE_HSB_ADDRESS_SPACE_SIZE];
                        }
 
                        /** Enables the currently selected pipe so that data can be sent and received through it to and from
                        }
 
                        /** Enables the currently selected pipe so that data can be sent and received through it to and from
                        static inline void Pipe_EnablePipe(void) ATTR_ALWAYS_INLINE;
                        static inline void Pipe_EnablePipe(void)
                        {
                        static inline void Pipe_EnablePipe(void) ATTR_ALWAYS_INLINE;
                        static inline void Pipe_EnablePipe(void)
                        {
-                               AVR32_USBB.uprst |=  (AVR32_USBB_PEN0_MASK << USB_SelectedPipe);
+                               AVR32_USBB.uprst |=  (AVR32_USBB_PEN0_MASK << USB_Pipe_SelectedPipe);
                        }
 
                        /** Disables the currently selected pipe so that data cannot be sent and received through it to and
                        }
 
                        /** Disables the currently selected pipe so that data cannot be sent and received through it to and
                        static inline void Pipe_DisablePipe(void) ATTR_ALWAYS_INLINE;
                        static inline void Pipe_DisablePipe(void)
                        {
                        static inline void Pipe_DisablePipe(void) ATTR_ALWAYS_INLINE;
                        static inline void Pipe_DisablePipe(void)
                        {
-                               AVR32_USBB.uprst &= ~(AVR32_USBB_PEN0_MASK << USB_SelectedPipe);
+                               AVR32_USBB.uprst &= ~(AVR32_USBB_PEN0_MASK << USB_Pipe_SelectedPipe);
                        }
 
                        /** Determines if the currently selected pipe is enabled, but not necessarily configured.
                        }
 
                        /** Determines if the currently selected pipe is enabled, but not necessarily configured.
                        static inline bool Pipe_IsEnabled(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline bool Pipe_IsEnabled(void)
                        {
                        static inline bool Pipe_IsEnabled(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline bool Pipe_IsEnabled(void)
                        {
-                               return ((AVR32_USBB.uprst & (AVR32_USBB_PEN0_MASK << USB_SelectedPipe)) ? true : false);
+                               return ((AVR32_USBB.uprst & (AVR32_USBB_PEN0_MASK << USB_Pipe_SelectedPipe)) ? true : false);
                        }
 
                        /** Gets the current pipe token, indicating the pipe's data direction and type.
                        }
 
                        /** Gets the current pipe token, indicating the pipe's data direction and type.
                        static inline uint8_t Pipe_GetPipeToken(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline uint8_t Pipe_GetPipeToken(void)
                        {
                        static inline uint8_t Pipe_GetPipeToken(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline uint8_t Pipe_GetPipeToken(void)
                        {
-                               return (&AVR32_USBB.UPCFG0)[USB_SelectedPipe].ptoken;
+                               return (&AVR32_USBB.UPCFG0)[USB_Pipe_SelectedPipe].ptoken;
                        }
 
                        /** Sets the token for the currently selected pipe to one of the tokens specified by the \c PIPE_TOKEN_*
                        }
 
                        /** Sets the token for the currently selected pipe to one of the tokens specified by the \c PIPE_TOKEN_*
                        static inline void Pipe_SetPipeToken(const uint8_t Token) ATTR_ALWAYS_INLINE;
                        static inline void Pipe_SetPipeToken(const uint8_t Token)
                        {
                        static inline void Pipe_SetPipeToken(const uint8_t Token) ATTR_ALWAYS_INLINE;
                        static inline void Pipe_SetPipeToken(const uint8_t Token)
                        {
-                               (&AVR32_USBB.UPCFG0)[USB_SelectedPipe].ptoken = Token;
+                               (&AVR32_USBB.UPCFG0)[USB_Pipe_SelectedPipe].ptoken = Token;
                        }
 
                        /** Configures the currently selected pipe to allow for an unlimited number of IN requests. */
                        static inline void Pipe_SetInfiniteINRequests(void) ATTR_ALWAYS_INLINE;
                        static inline void Pipe_SetInfiniteINRequests(void)
                        {
                        }
 
                        /** Configures the currently selected pipe to allow for an unlimited number of IN requests. */
                        static inline void Pipe_SetInfiniteINRequests(void) ATTR_ALWAYS_INLINE;
                        static inline void Pipe_SetInfiniteINRequests(void)
                        {
-                               (&AVR32_USBB.UPINRQ0)[USB_SelectedPipe].inmode = true;
+                               (&AVR32_USBB.UPINRQ0)[USB_Pipe_SelectedPipe].inmode = true;
                        }
 
                        /** Configures the currently selected pipe to only allow the specified number of IN requests to be
                        }
 
                        /** Configures the currently selected pipe to only allow the specified number of IN requests to be
                        static inline void Pipe_SetFiniteINRequests(const uint8_t TotalINRequests) ATTR_ALWAYS_INLINE;
                        static inline void Pipe_SetFiniteINRequests(const uint8_t TotalINRequests)
                        {
                        static inline void Pipe_SetFiniteINRequests(const uint8_t TotalINRequests) ATTR_ALWAYS_INLINE;
                        static inline void Pipe_SetFiniteINRequests(const uint8_t TotalINRequests)
                        {
-                               (&AVR32_USBB.UPINRQ0)[USB_SelectedPipe].inmode = false;
-                               (&AVR32_USBB.UPINRQ0)[USB_SelectedPipe].inrq   = TotalINRequests;
+                               (&AVR32_USBB.UPINRQ0)[USB_Pipe_SelectedPipe].inmode = false;
+                               (&AVR32_USBB.UPINRQ0)[USB_Pipe_SelectedPipe].inrq   = TotalINRequests;
                        }
 
                        /** Determines if the currently selected pipe is configured.
                        }
 
                        /** Determines if the currently selected pipe is configured.
                        static inline bool Pipe_IsConfigured(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline bool Pipe_IsConfigured(void)
                        {
                        static inline bool Pipe_IsConfigured(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline bool Pipe_IsConfigured(void)
                        {
-                               return (&AVR32_USBB.UPSTA0)[USB_SelectedPipe].cfgok;
+                               return (&AVR32_USBB.UPSTA0)[USB_Pipe_SelectedPipe].cfgok;
                        }
 
                        /** Retrieves the endpoint address of the endpoint within the attached device that the currently selected
                        }
 
                        /** Retrieves the endpoint address of the endpoint within the attached device that the currently selected
                        static inline uint8_t Pipe_GetBoundEndpointAddress(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline uint8_t Pipe_GetBoundEndpointAddress(void)
                        {
                        static inline uint8_t Pipe_GetBoundEndpointAddress(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline uint8_t Pipe_GetBoundEndpointAddress(void)
                        {
-                               return ((&AVR32_USBB.UPCFG0)[USB_SelectedPipe].pepnum |
+                               return ((&AVR32_USBB.UPCFG0)[USB_Pipe_SelectedPipe].pepnum |
                                        ((Pipe_GetPipeToken() == PIPE_TOKEN_IN) ? PIPE_EPDIR_MASK : 0));
                        }
 
                                        ((Pipe_GetPipeToken() == PIPE_TOKEN_IN) ? PIPE_EPDIR_MASK : 0));
                        }
 
                        static inline void Pipe_SetInterruptPeriod(const uint8_t Milliseconds) ATTR_ALWAYS_INLINE;
                        static inline void Pipe_SetInterruptPeriod(const uint8_t Milliseconds)
                        {
                        static inline void Pipe_SetInterruptPeriod(const uint8_t Milliseconds) ATTR_ALWAYS_INLINE;
                        static inline void Pipe_SetInterruptPeriod(const uint8_t Milliseconds)
                        {
-                               (&AVR32_USBB.UPCFG0)[USB_SelectedPipe].intfrq = Milliseconds;
+                               (&AVR32_USBB.UPCFG0)[USB_Pipe_SelectedPipe].intfrq = Milliseconds;
                        }
 
                        /** Returns a mask indicating which pipe's interrupt periods have elapsed, indicating that the pipe should
                        }
 
                        /** Returns a mask indicating which pipe's interrupt periods have elapsed, indicating that the pipe should
                        static inline bool Pipe_HasPipeInterrupted(const uint8_t PipeNumber) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline bool Pipe_HasPipeInterrupted(const uint8_t PipeNumber)
                        {
                        static inline bool Pipe_HasPipeInterrupted(const uint8_t PipeNumber) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline bool Pipe_HasPipeInterrupted(const uint8_t PipeNumber)
                        {
-                               return ((AVR32_USBB.uhint & (AVR32_USBB_P0INTES_MASK << USB_SelectedPipe)) ? true : false);
+                               return ((AVR32_USBB.uhint & (AVR32_USBB_P0INTES_MASK << USB_Pipe_SelectedPipe)) ? true : false);
                        }
 
                        /** Unfreezes the selected pipe, allowing it to communicate with an attached device. */
                        static inline void Pipe_Unfreeze(void) ATTR_ALWAYS_INLINE;
                        static inline void Pipe_Unfreeze(void)
                        {
                        }
 
                        /** Unfreezes the selected pipe, allowing it to communicate with an attached device. */
                        static inline void Pipe_Unfreeze(void) ATTR_ALWAYS_INLINE;
                        static inline void Pipe_Unfreeze(void)
                        {
-                               (&AVR32_USBB.UPCON0CLR)[USB_SelectedPipe].pfreezec = true;
+                               (&AVR32_USBB.UPCON0CLR)[USB_Pipe_SelectedPipe].pfreezec = true;
                        }
 
                        /** Freezes the selected pipe, preventing it from communicating with an attached device. */
                        static inline void Pipe_Freeze(void) ATTR_ALWAYS_INLINE;
                        static inline void Pipe_Freeze(void)
                        {
                        }
 
                        /** Freezes the selected pipe, preventing it from communicating with an attached device. */
                        static inline void Pipe_Freeze(void) ATTR_ALWAYS_INLINE;
                        static inline void Pipe_Freeze(void)
                        {
-                               (&AVR32_USBB.UPCON0SET)[USB_SelectedPipe].pfreezes = true;
+                               (&AVR32_USBB.UPCON0SET)[USB_Pipe_SelectedPipe].pfreezes = true;
                        }
 
                        /** Determines if the currently selected pipe is frozen, and not able to accept data.
                        }
 
                        /** Determines if the currently selected pipe is frozen, and not able to accept data.
                        static inline bool Pipe_IsFrozen(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline bool Pipe_IsFrozen(void)
                        {
                        static inline bool Pipe_IsFrozen(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline bool Pipe_IsFrozen(void)
                        {
-                               return (((&AVR32_USBB.UPCON0)[USB_SelectedPipe].pfreeze) ? true : false);
+                               return (((&AVR32_USBB.UPCON0)[USB_Pipe_SelectedPipe].pfreeze) ? true : false);
                        }
 
                        /** Clears the error flags for the currently selected pipe. */
                        static inline void Pipe_ClearError(void) ATTR_ALWAYS_INLINE;
                        static inline void Pipe_ClearError(void)
                        {
                        }
 
                        /** Clears the error flags for the currently selected pipe. */
                        static inline void Pipe_ClearError(void) ATTR_ALWAYS_INLINE;
                        static inline void Pipe_ClearError(void)
                        {
-                               (&AVR32_USBB.uperr0)[USB_SelectedPipe] = 0;
-                               (&AVR32_USBB.UPSTA0CLR)[USB_SelectedPipe].overfic  = true;
+                               (&AVR32_USBB.uperr0)[USB_Pipe_SelectedPipe] = 0;
+                               (&AVR32_USBB.UPSTA0CLR)[USB_Pipe_SelectedPipe].overfic  = true;
                        }
 
                        /** Determines if the master pipe error flag is set for the currently selected pipe, indicating that
                        }
 
                        /** Determines if the master pipe error flag is set for the currently selected pipe, indicating that
                        static inline bool Pipe_IsError(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline bool Pipe_IsError(void)
                        {
                        static inline bool Pipe_IsError(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline bool Pipe_IsError(void)
                        {
-                               return (((&AVR32_USBB.upsta0)[USB_SelectedPipe] &
+                               return (((&AVR32_USBB.upsta0)[USB_Pipe_SelectedPipe] &
                                        (AVR32_USBB_PERRI_MASK | AVR32_USBB_OVERFI_MASK)) ? true : false);
                        }
 
                                        (AVR32_USBB_PERRI_MASK | AVR32_USBB_OVERFI_MASK)) ? true : false);
                        }
 
                        static inline uint8_t Pipe_GetErrorFlags(void)
                        {
                                
                        static inline uint8_t Pipe_GetErrorFlags(void)
                        {
                                
-                               return (((&AVR32_USBB.uperr0)[USB_SelectedPipe] &
+                               return (((&AVR32_USBB.uperr0)[USB_Pipe_SelectedPipe] &
                                        (PIPE_ERRORFLAG_CRC16 | PIPE_ERRORFLAG_TIMEOUT |
                                         PIPE_ERRORFLAG_PID   | PIPE_ERRORFLAG_DATAPID |
                                         PIPE_ERRORFLAG_DATATGL)) |
                                        (PIPE_ERRORFLAG_CRC16 | PIPE_ERRORFLAG_TIMEOUT |
                                         PIPE_ERRORFLAG_PID   | PIPE_ERRORFLAG_DATAPID |
                                         PIPE_ERRORFLAG_DATATGL)) |
-                                       (((&AVR32_USBB.upsta0)[USB_SelectedPipe] << 8) &
+                                       (((&AVR32_USBB.upsta0)[USB_Pipe_SelectedPipe] << 8) &
                                                 PIPE_ERRORFLAG_OVERFLOW));
                        }
                        
                                                 PIPE_ERRORFLAG_OVERFLOW));
                        }
                        
                        static inline uint8_t Pipe_GetBusyBanks(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline uint8_t Pipe_GetBusyBanks(void)
                        {
                        static inline uint8_t Pipe_GetBusyBanks(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline uint8_t Pipe_GetBusyBanks(void)
                        {
-                               return (&AVR32_USBB.UPSTA0)[USB_SelectedPipe].nbusybk;
+                               return (&AVR32_USBB.UPSTA0)[USB_Pipe_SelectedPipe].nbusybk;
                        }
 
                        /** Determines if the currently selected pipe may be read from (if data is waiting in the pipe
                        }
 
                        /** Determines if the currently selected pipe may be read from (if data is waiting in the pipe
                        static inline bool Pipe_IsReadWriteAllowed(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline bool Pipe_IsReadWriteAllowed(void)
                        {
                        static inline bool Pipe_IsReadWriteAllowed(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline bool Pipe_IsReadWriteAllowed(void)
                        {
-                               return (&AVR32_USBB.UPSTA0)[USB_SelectedPipe].rwall;
+                               return (&AVR32_USBB.UPSTA0)[USB_Pipe_SelectedPipe].rwall;
                        }
 
                        /** Determines if a packet has been received on the currently selected IN pipe from the attached device.
                        }
 
                        /** Determines if a packet has been received on the currently selected IN pipe from the attached device.
                        static inline bool Pipe_IsINReceived(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline bool Pipe_IsINReceived(void)
                        {
                        static inline bool Pipe_IsINReceived(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline bool Pipe_IsINReceived(void)
                        {
-                               return (&AVR32_USBB.UPSTA0)[USB_SelectedPipe].rxini;
+                               return (&AVR32_USBB.UPSTA0)[USB_Pipe_SelectedPipe].rxini;
                        }
 
                        /** Determines if the currently selected OUT pipe is ready to send an OUT packet to the attached device.
                        }
 
                        /** Determines if the currently selected OUT pipe is ready to send an OUT packet to the attached device.
                        static inline bool Pipe_IsOUTReady(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline bool Pipe_IsOUTReady(void)
                        {
                        static inline bool Pipe_IsOUTReady(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline bool Pipe_IsOUTReady(void)
                        {
-                               return (&AVR32_USBB.UPSTA0)[USB_SelectedPipe].txouti;
+                               return (&AVR32_USBB.UPSTA0)[USB_Pipe_SelectedPipe].txouti;
                        }
 
                        /** Determines if no SETUP request is currently being sent to the attached device on the selected
                        }
 
                        /** Determines if no SETUP request is currently being sent to the attached device on the selected
                        static inline bool Pipe_IsSETUPSent(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline bool Pipe_IsSETUPSent(void)
                        {
                        static inline bool Pipe_IsSETUPSent(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline bool Pipe_IsSETUPSent(void)
                        {
-                               return (&AVR32_USBB.UPSTA0)[USB_SelectedPipe].txstpi;
+                               return (&AVR32_USBB.UPSTA0)[USB_Pipe_SelectedPipe].txstpi;
                        }
 
                        /** Sends the currently selected CONTROL type pipe's contents to the device as a SETUP packet.
                        }
 
                        /** Sends the currently selected CONTROL type pipe's contents to the device as a SETUP packet.
                        static inline void Pipe_ClearSETUP(void) ATTR_ALWAYS_INLINE;
                        static inline void Pipe_ClearSETUP(void)
                        {
                        static inline void Pipe_ClearSETUP(void) ATTR_ALWAYS_INLINE;
                        static inline void Pipe_ClearSETUP(void)
                        {
-                               (&AVR32_USBB.UPSTA0CLR)[USB_SelectedPipe].txstpic = true;
-                               USB_PipeFIFOPos[USB_SelectedPipe] = &AVR32_USBB_SLAVE[USB_SelectedPipe * PIPE_HSB_ADDRESS_SPACE_SIZE];
+                               (&AVR32_USBB.UPSTA0CLR)[USB_Pipe_SelectedPipe].txstpic = true;
+                               USB_Pipe_FIFOPos[USB_Pipe_SelectedPipe] = &AVR32_USBB_SLAVE[USB_Pipe_SelectedPipe * PIPE_HSB_ADDRESS_SPACE_SIZE];
                        }
 
                        /** Acknowledges the reception of a setup IN request from the attached device on the currently selected
                        }
 
                        /** Acknowledges the reception of a setup IN request from the attached device on the currently selected
                        static inline void Pipe_ClearIN(void) ATTR_ALWAYS_INLINE;
                        static inline void Pipe_ClearIN(void)
                        {
                        static inline void Pipe_ClearIN(void) ATTR_ALWAYS_INLINE;
                        static inline void Pipe_ClearIN(void)
                        {
-                               (&AVR32_USBB.UPSTA0CLR)[USB_SelectedPipe].rxinic   = true;
-                               (&AVR32_USBB.UPCON0CLR)[USB_SelectedPipe].fifoconc = true;
-                               USB_PipeFIFOPos[USB_SelectedPipe] = &AVR32_USBB_SLAVE[USB_SelectedPipe * PIPE_HSB_ADDRESS_SPACE_SIZE];
+                               (&AVR32_USBB.UPSTA0CLR)[USB_Pipe_SelectedPipe].rxinic   = true;
+                               (&AVR32_USBB.UPCON0CLR)[USB_Pipe_SelectedPipe].fifoconc = true;
+                               USB_Pipe_FIFOPos[USB_Pipe_SelectedPipe] = &AVR32_USBB_SLAVE[USB_Pipe_SelectedPipe * PIPE_HSB_ADDRESS_SPACE_SIZE];
                        }
 
                        /** Sends the currently selected pipe's contents to the device as an OUT packet on the selected pipe, freeing
                        }
 
                        /** Sends the currently selected pipe's contents to the device as an OUT packet on the selected pipe, freeing
                        static inline void Pipe_ClearOUT(void) ATTR_ALWAYS_INLINE;
                        static inline void Pipe_ClearOUT(void)
                        {
                        static inline void Pipe_ClearOUT(void) ATTR_ALWAYS_INLINE;
                        static inline void Pipe_ClearOUT(void)
                        {
-                               (&AVR32_USBB.UPSTA0CLR)[USB_SelectedPipe].txoutic  = true;
-                               (&AVR32_USBB.UPCON0CLR)[USB_SelectedPipe].fifoconc = true;
-                               USB_PipeFIFOPos[USB_SelectedPipe] = &AVR32_USBB_SLAVE[USB_SelectedPipe * PIPE_HSB_ADDRESS_SPACE_SIZE];
+                               (&AVR32_USBB.UPSTA0CLR)[USB_Pipe_SelectedPipe].txoutic  = true;
+                               (&AVR32_USBB.UPCON0CLR)[USB_Pipe_SelectedPipe].fifoconc = true;
+                               USB_Pipe_FIFOPos[USB_Pipe_SelectedPipe] = &AVR32_USBB_SLAVE[USB_Pipe_SelectedPipe * PIPE_HSB_ADDRESS_SPACE_SIZE];
                        }
 
                        /** Determines if the device sent a NAK (Negative Acknowledge) in response to the last sent packet on
                        }
 
                        /** Determines if the device sent a NAK (Negative Acknowledge) in response to the last sent packet on
                        static inline bool Pipe_IsNAKReceived(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline bool Pipe_IsNAKReceived(void)
                        {
                        static inline bool Pipe_IsNAKReceived(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline bool Pipe_IsNAKReceived(void)
                        {
-                               return (&AVR32_USBB.UPSTA0)[USB_SelectedPipe].nakedi;
+                               return (&AVR32_USBB.UPSTA0)[USB_Pipe_SelectedPipe].nakedi;
                        }
 
                        /** Clears the NAK condition on the currently selected pipe.
                        }
 
                        /** Clears the NAK condition on the currently selected pipe.
                        static inline void Pipe_ClearNAKReceived(void) ATTR_ALWAYS_INLINE;
                        static inline void Pipe_ClearNAKReceived(void)
                        {
                        static inline void Pipe_ClearNAKReceived(void) ATTR_ALWAYS_INLINE;
                        static inline void Pipe_ClearNAKReceived(void)
                        {
-                               (&AVR32_USBB.UPSTA0CLR)[USB_SelectedPipe].nakedic = true;
+                               (&AVR32_USBB.UPSTA0CLR)[USB_Pipe_SelectedPipe].nakedic = true;
                        }
 
                        /** Determines if the currently selected pipe has had the STALL condition set by the attached device.
                        }
 
                        /** Determines if the currently selected pipe has had the STALL condition set by the attached device.
                        static inline bool Pipe_IsStalled(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline bool Pipe_IsStalled(void)
                        {
                        static inline bool Pipe_IsStalled(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline bool Pipe_IsStalled(void)
                        {
-                               return (&AVR32_USBB.UPSTA0)[USB_SelectedPipe].rxstalldi;
+                               return (&AVR32_USBB.UPSTA0)[USB_Pipe_SelectedPipe].rxstalldi;
                        }
 
                        /** Clears the STALL condition detection flag on the currently selected pipe, but does not clear the
                        }
 
                        /** Clears the STALL condition detection flag on the currently selected pipe, but does not clear the
                        static inline void Pipe_ClearStall(void) ATTR_ALWAYS_INLINE;
                        static inline void Pipe_ClearStall(void)
                        {
                        static inline void Pipe_ClearStall(void) ATTR_ALWAYS_INLINE;
                        static inline void Pipe_ClearStall(void)
                        {
-                               (&AVR32_USBB.UPSTA0CLR)[USB_SelectedPipe].rxstalldic = true;
-                               USB_PipeFIFOPos[USB_SelectedPipe] = &AVR32_USBB_SLAVE[USB_SelectedPipe * PIPE_HSB_ADDRESS_SPACE_SIZE];
+                               (&AVR32_USBB.UPSTA0CLR)[USB_Pipe_SelectedPipe].rxstalldic = true;
+                               USB_Pipe_FIFOPos[USB_Pipe_SelectedPipe] = &AVR32_USBB_SLAVE[USB_Pipe_SelectedPipe * PIPE_HSB_ADDRESS_SPACE_SIZE];
                        }
 
                        /** Reads one byte from the currently selected pipe's bank, for OUT direction pipes.
                        }
 
                        /** Reads one byte from the currently selected pipe's bank, for OUT direction pipes.
                        static inline uint8_t Pipe_Read_8(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline uint8_t Pipe_Read_8(void)
                        {
                        static inline uint8_t Pipe_Read_8(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline uint8_t Pipe_Read_8(void)
                        {
-                               return *(USB_PipeFIFOPos[USB_SelectedPipe]++);
+                               return *(USB_Pipe_FIFOPos[USB_Pipe_SelectedPipe]++);
                        }
 
                        /** Writes one byte to the currently selected pipe's bank, for IN direction pipes.
                        }
 
                        /** Writes one byte to the currently selected pipe's bank, for IN direction pipes.
                        static inline void Pipe_Write_8(const uint8_t Data) ATTR_ALWAYS_INLINE;
                        static inline void Pipe_Write_8(const uint8_t Data)
                        {
                        static inline void Pipe_Write_8(const uint8_t Data) ATTR_ALWAYS_INLINE;
                        static inline void Pipe_Write_8(const uint8_t Data)
                        {
-                               *(USB_PipeFIFOPos[USB_SelectedPipe]++) = Data;
+                               *(USB_Pipe_FIFOPos[USB_Pipe_SelectedPipe]++) = Data;
                        }
 
                        /** 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.
                        {
                                uint8_t Dummy;
 
                        {
                                uint8_t Dummy;
 
-                               Dummy = *(USB_PipeFIFOPos[USB_SelectedPipe]++);
+                               Dummy = *(USB_Pipe_FIFOPos[USB_Pipe_SelectedPipe]++);
 
                                (void)Dummy;
                        }
 
                                (void)Dummy;
                        }
                        static inline uint16_t Pipe_Read_16_LE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline uint16_t Pipe_Read_16_LE(void)
                        {
                        static inline uint16_t Pipe_Read_16_LE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline uint16_t Pipe_Read_16_LE(void)
                        {
-                               uint16_t Byte0 = *(USB_PipeFIFOPos[USB_SelectedPipe]++);
-                               uint16_t Byte1 = *(USB_PipeFIFOPos[USB_SelectedPipe]++);
+                               uint16_t Byte0 = *(USB_Pipe_FIFOPos[USB_Pipe_SelectedPipe]++);
+                               uint16_t Byte1 = *(USB_Pipe_FIFOPos[USB_Pipe_SelectedPipe]++);
 
                                return ((Byte1 << 8) | Byte0);
                        }
 
                                return ((Byte1 << 8) | Byte0);
                        }
                        static inline uint16_t Pipe_Read_16_BE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline uint16_t Pipe_Read_16_BE(void)
                        {
                        static inline uint16_t Pipe_Read_16_BE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline uint16_t Pipe_Read_16_BE(void)
                        {
-                               uint16_t Byte0 = *(USB_PipeFIFOPos[USB_SelectedPipe]++);
-                               uint16_t Byte1 = *(USB_PipeFIFOPos[USB_SelectedPipe]++);
+                               uint16_t Byte0 = *(USB_Pipe_FIFOPos[USB_Pipe_SelectedPipe]++);
+                               uint16_t Byte1 = *(USB_Pipe_FIFOPos[USB_Pipe_SelectedPipe]++);
 
                                return ((Byte0 << 8) | Byte1);
                        }
 
                                return ((Byte0 << 8) | Byte1);
                        }
                        static inline void Pipe_Write_16_LE(const uint16_t Data) ATTR_ALWAYS_INLINE;
                        static inline void Pipe_Write_16_LE(const uint16_t Data)
                        {
                        static inline void Pipe_Write_16_LE(const uint16_t Data) ATTR_ALWAYS_INLINE;
                        static inline void Pipe_Write_16_LE(const uint16_t Data)
                        {
-                               *(USB_PipeFIFOPos[USB_SelectedPipe]++) = (Data >> 8);
-                               *(USB_PipeFIFOPos[USB_SelectedPipe]++) = (Data & 0xFF);
+                               *(USB_Pipe_FIFOPos[USB_Pipe_SelectedPipe]++) = (Data >> 8);
+                               *(USB_Pipe_FIFOPos[USB_Pipe_SelectedPipe]++) = (Data & 0xFF);
                        }
 
                        /** 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
                        static inline void Pipe_Write_16_BE(const uint16_t Data) ATTR_ALWAYS_INLINE;
                        static inline void Pipe_Write_16_BE(const uint16_t Data)
                        {
                        static inline void Pipe_Write_16_BE(const uint16_t Data) ATTR_ALWAYS_INLINE;
                        static inline void Pipe_Write_16_BE(const uint16_t Data)
                        {
-                               *(USB_PipeFIFOPos[USB_SelectedPipe]++) = (Data & 0xFF);
-                               *(USB_PipeFIFOPos[USB_SelectedPipe]++) = (Data >> 8);
+                               *(USB_Pipe_FIFOPos[USB_Pipe_SelectedPipe]++) = (Data & 0xFF);
+                               *(USB_Pipe_FIFOPos[USB_Pipe_SelectedPipe]++) = (Data >> 8);
                        }
 
                        /** 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.
                        {
                                uint8_t Dummy;
 
                        {
                                uint8_t Dummy;
 
-                               Dummy = *(USB_PipeFIFOPos[USB_SelectedPipe]++);
-                               Dummy = *(USB_PipeFIFOPos[USB_SelectedPipe]++);
+                               Dummy = *(USB_Pipe_FIFOPos[USB_Pipe_SelectedPipe]++);
+                               Dummy = *(USB_Pipe_FIFOPos[USB_Pipe_SelectedPipe]++);
 
                                (void)Dummy;
                        }
 
                                (void)Dummy;
                        }
                        static inline uint32_t Pipe_Read_32_LE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline uint32_t Pipe_Read_32_LE(void)
                        {
                        static inline uint32_t Pipe_Read_32_LE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline uint32_t Pipe_Read_32_LE(void)
                        {
-                               uint32_t Byte0 = *(USB_PipeFIFOPos[USB_SelectedPipe]++);
-                               uint32_t Byte1 = *(USB_PipeFIFOPos[USB_SelectedPipe]++);
-                               uint32_t Byte2 = *(USB_PipeFIFOPos[USB_SelectedPipe]++);
-                               uint32_t Byte3 = *(USB_PipeFIFOPos[USB_SelectedPipe]++);
+                               uint32_t Byte0 = *(USB_Pipe_FIFOPos[USB_Pipe_SelectedPipe]++);
+                               uint32_t Byte1 = *(USB_Pipe_FIFOPos[USB_Pipe_SelectedPipe]++);
+                               uint32_t Byte2 = *(USB_Pipe_FIFOPos[USB_Pipe_SelectedPipe]++);
+                               uint32_t Byte3 = *(USB_Pipe_FIFOPos[USB_Pipe_SelectedPipe]++);
 
                                return ((Byte3 << 24) | (Byte2 << 16) | (Byte1 << 8) | Byte0);
                        }
 
                                return ((Byte3 << 24) | (Byte2 << 16) | (Byte1 << 8) | Byte0);
                        }
                        static inline uint32_t Pipe_Read_32_BE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline uint32_t Pipe_Read_32_BE(void)
                        {
                        static inline uint32_t Pipe_Read_32_BE(void) ATTR_WARN_UNUSED_RESULT ATTR_ALWAYS_INLINE;
                        static inline uint32_t Pipe_Read_32_BE(void)
                        {
-                               uint32_t Byte0 = *(USB_PipeFIFOPos[USB_SelectedPipe]++);
-                               uint32_t Byte1 = *(USB_PipeFIFOPos[USB_SelectedPipe]++);
-                               uint32_t Byte2 = *(USB_PipeFIFOPos[USB_SelectedPipe]++);
-                               uint32_t Byte3 = *(USB_PipeFIFOPos[USB_SelectedPipe]++);
+                               uint32_t Byte0 = *(USB_Pipe_FIFOPos[USB_Pipe_SelectedPipe]++);
+                               uint32_t Byte1 = *(USB_Pipe_FIFOPos[USB_Pipe_SelectedPipe]++);
+                               uint32_t Byte2 = *(USB_Pipe_FIFOPos[USB_Pipe_SelectedPipe]++);
+                               uint32_t Byte3 = *(USB_Pipe_FIFOPos[USB_Pipe_SelectedPipe]++);
 
                                return ((Byte0 << 24) | (Byte1 << 16) | (Byte2 << 8) | Byte3);
                        }
 
                                return ((Byte0 << 24) | (Byte1 << 16) | (Byte2 << 8) | Byte3);
                        }
                        static inline void Pipe_Write_32_LE(const uint32_t Data) ATTR_ALWAYS_INLINE;
                        static inline void Pipe_Write_32_LE(const uint32_t Data)
                        {
                        static inline void Pipe_Write_32_LE(const uint32_t Data) ATTR_ALWAYS_INLINE;
                        static inline void Pipe_Write_32_LE(const uint32_t Data)
                        {
-                               *(USB_PipeFIFOPos[USB_SelectedPipe]++) = (Data >> 24);
-                               *(USB_PipeFIFOPos[USB_SelectedPipe]++) = (Data >> 16);
-                               *(USB_PipeFIFOPos[USB_SelectedPipe]++) = (Data >> 8);
-                               *(USB_PipeFIFOPos[USB_SelectedPipe]++) = (Data &  0xFF);
+                               *(USB_Pipe_FIFOPos[USB_Pipe_SelectedPipe]++) = (Data >> 24);
+                               *(USB_Pipe_FIFOPos[USB_Pipe_SelectedPipe]++) = (Data >> 16);
+                               *(USB_Pipe_FIFOPos[USB_Pipe_SelectedPipe]++) = (Data >> 8);
+                               *(USB_Pipe_FIFOPos[USB_Pipe_SelectedPipe]++) = (Data &  0xFF);
                        }
 
                        /** 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
                        static inline void Pipe_Write_32_BE(const uint32_t Data) ATTR_ALWAYS_INLINE;
                        static inline void Pipe_Write_32_BE(const uint32_t Data)
                        {
                        static inline void Pipe_Write_32_BE(const uint32_t Data) ATTR_ALWAYS_INLINE;
                        static inline void Pipe_Write_32_BE(const uint32_t Data)
                        {
-                               *(USB_PipeFIFOPos[USB_SelectedPipe]++) = (Data &  0xFF);
-                               *(USB_PipeFIFOPos[USB_SelectedPipe]++) = (Data >> 8);
-                               *(USB_PipeFIFOPos[USB_SelectedPipe]++) = (Data >> 16);
-                               *(USB_PipeFIFOPos[USB_SelectedPipe]++) = (Data >> 24);
+                               *(USB_Pipe_FIFOPos[USB_Pipe_SelectedPipe]++) = (Data &  0xFF);
+                               *(USB_Pipe_FIFOPos[USB_Pipe_SelectedPipe]++) = (Data >> 8);
+                               *(USB_Pipe_FIFOPos[USB_Pipe_SelectedPipe]++) = (Data >> 16);
+                               *(USB_Pipe_FIFOPos[USB_Pipe_SelectedPipe]++) = (Data >> 24);
                        }
 
                        /** 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.
                        {
                                uint8_t Dummy;
 
                        {
                                uint8_t Dummy;
 
-                               Dummy = *(USB_PipeFIFOPos[USB_SelectedPipe]++);
-                               Dummy = *(USB_PipeFIFOPos[USB_SelectedPipe]++);
-                               Dummy = *(USB_PipeFIFOPos[USB_SelectedPipe]++);
-                               Dummy = *(USB_PipeFIFOPos[USB_SelectedPipe]++);
+                               Dummy = *(USB_Pipe_FIFOPos[USB_Pipe_SelectedPipe]++);
+                               Dummy = *(USB_Pipe_FIFOPos[USB_Pipe_SelectedPipe]++);
+                               Dummy = *(USB_Pipe_FIFOPos[USB_Pipe_SelectedPipe]++);
+                               Dummy = *(USB_Pipe_FIFOPos[USB_Pipe_SelectedPipe]++);
 
                                (void)Dummy;
                        }
 
                                (void)Dummy;
                        }