80 #include "../../../Common/Common.h"
84 #if defined(__cplusplus)
89 #if !defined(__INCLUDE_FROM_USB_DRIVER)
90 #error Do not include this file directly. Include lpcroot/libraries/LPCUSBlib/Drivers/USB/USB.h instead.
98 #define PIPE_CONTROLPIPE 0
103 #define PIPE_PIPENUM_MASK 0x0F
108 #define PIPE_EPNUM_MASK 0x0F
113 #define PIPE_EPDIR_MASK 0x80
124 #define PIPE_ERRORFLAG_OVERFLOW (1 << 6)
127 #define PIPE_ERRORFLAG_UNDERFLOW (1 << 5)
130 #define PIPE_ERRORFLAG_CRC16 (1 << 4)
133 #define PIPE_ERRORFLAG_TIMEOUT (1 << 3)
136 #define PIPE_ERRORFLAG_PID (1 << 2)
139 #define PIPE_ERRORFLAG_DATAPID (1 << 1)
142 #define PIPE_ERRORFLAG_DATATGL (1 << 0)
150 #define PIPE_TOKEN_SETUP (0)
155 #define PIPE_TOKEN_IN (1)
160 #define PIPE_TOKEN_OUT (2)
169 #define PIPE_BANK_SINGLE (0 << 1)
176 #define PIPE_BANK_DOUBLE (1 << 1)
182 #define PIPE_CONTROLPIPE_DEFAULT_SIZE 8
188 #define PIPE_TOTAL_PIPES HCD_MAX_ENDPOINT
195 #define PIPE_MAX_SIZE 512
255 return PipeInfo[corenum][pipeselected[corenum]].
ByteTransfered - PipeInfo[corenum][pipeselected[corenum]].
StartIdx;
269 return pipeselected[corenum];
284 pipeselected[corenum] = PipeNumber;
295 static inline void Pipe_ResetPipe(
const uint8_t corenum,
const uint8_t PipeNumber)
297 PipeInfo[corenum][pipeselected[corenum]].
StartIdx = PipeInfo[corenum][pipeselected[corenum]].
ByteTransfered = 0;
343 return (PipeInfo[corenum][pipeselected[corenum]].EndponitAddress &
388 return PipeInfo[corenum][pipeselected[corenum]].
Buffer !=
NULL;
452 static inline void Pipe_Freeze(
void) ATTR_ALWAYS_INLINE;
547 PipeInfo[corenum][pipeselected[corenum]].
BufferSize);
625 PipeInfo[corenum][pipeselected[corenum]].
StartIdx = PipeInfo[corenum][pipeselected[corenum]].
ByteTransfered = 0;
639 PipeInfo[corenum][pipeselected[corenum]].
Buffer,
640 PipeInfo[corenum][pipeselected[corenum]].ByteTransfered,
642 PipeInfo[corenum][pipeselected[corenum]].
StartIdx = PipeInfo[corenum][pipeselected[corenum]].
ByteTransfered = 0;
714 if (PipeInfo[corenum][pipeselected[corenum]].StartIdx < PipeInfo[corenum][pipeselected[corenum]].ByteTransfered ) {
716 PipeInfo[corenum][pipeselected[corenum]].
Buffer[PipeInfo[corenum][pipeselected[corenum]].
StartIdx];
717 PipeInfo[corenum][pipeselected[corenum]].
StartIdx++;
736 static inline void Pipe_Write_8(
const uint8_t corenum,
const uint8_t Data)
738 if (PipeInfo[corenum][pipeselected[corenum]].ByteTransfered <
739 PipeInfo[corenum][pipeselected[corenum]].BufferSize) {
740 PipeInfo[corenum][pipeselected[corenum]].
Buffer[PipeInfo[corenum][pipeselected[corenum]].
ByteTransfered] = Data;
772 tem = (tem2 << 8) | tem1;
794 tem = (tem1 << 8) | tem2;
857 uint8_t tem1, tem2, tem3, tem4;
863 tem = (tem4 << 24) | (tem3 << 16) | (tem2 << 8) | tem1;
881 uint8_t tem1, tem2, tem3, tem4;
887 tem = (tem1 << 24) | (tem2 << 16) | (tem3 << 8) | tem4;
993 const uint8_t Number,
998 const uint8_t Banks);
1023 #if !defined(__DOXYGEN__)
1025 #if !defined(ENDPOINT_CONTROLEP)
1026 #define ENDPOINT_CONTROLEP 0
1030 static inline uint8_t Pipe_BytesToEPSizeMask(
const uint16_t Bytes) ATTR_WARN_UNUSED_RESULT
ATTR_CONST
1033 static inline uint8_t Pipe_BytesToEPSizeMask(
const uint16_t Bytes)
1044 #if defined(__cplusplus)