75 #ifndef __PIPE_LPC_H__
76 #define __PIPE_LPC_H__
79 #include "../../../../Common/Common.h"
80 #include "../USBTask.h"
82 #include "../USBMemory.h"
86 #if defined(__cplusplus)
91 #if !defined(__INCLUDE_FROM_USB_DRIVER)
92 #error Do not include this file directly. Include lpcroot/libraries/LPCUSBlib/Drivers/USB/USB.h instead.
100 #define PIPE_ERRORFLAG_OVERFLOW (1 << 6)
103 #define PIPE_ERRORFLAG_UNDERFLOW (1 << 5)
106 #define PIPE_ERRORFLAG_CRC16 (1 << 4)
109 #define PIPE_ERRORFLAG_TIMEOUT (1 << 3)
112 #define PIPE_ERRORFLAG_PID (1 << 2)
115 #define PIPE_ERRORFLAG_DATAPID (1 << 1)
118 #define PIPE_ERRORFLAG_DATATGL (1 << 0)
126 #define PIPE_TOKEN_SETUP (0)
131 #define PIPE_TOKEN_IN (1)
136 #define PIPE_TOKEN_OUT (2)
145 #define PIPE_BANK_SINGLE (0 << 1)
152 #define PIPE_BANK_DOUBLE (1 << 1)
158 #define PIPE_CONTROLPIPE_DEFAULT_SIZE 8
164 #define PIPE_TOTAL_PIPES HCD_MAX_ENDPOINT
171 #define PIPE_MAX_SIZE 512
219 return PipeInfo[corenum][pipeselected[corenum]].
ByteTransfered - PipeInfo[corenum][pipeselected[corenum]].
StartIdx;
233 return pipeselected[corenum];
248 pipeselected[corenum] = PipeNumber;
259 static inline void Pipe_ResetPipe(
const uint8_t corenum,
const uint8_t PipeNumber)
261 PipeInfo[corenum][pipeselected[corenum]].
StartIdx = PipeInfo[corenum][pipeselected[corenum]].
ByteTransfered = 0;
307 return (PipeInfo[corenum][pipeselected[corenum]].EndponitAddress &
352 return PipeInfo[corenum][pipeselected[corenum]].
Buffer !=
NULL;
416 static inline void Pipe_Freeze(
void) ATTR_ALWAYS_INLINE;
511 PipeInfo[corenum][pipeselected[corenum]].
BufferSize);
576 PipeInfo[corenum][pipeselected[corenum]].
StartIdx = PipeInfo[corenum][pipeselected[corenum]].
ByteTransfered = 0;
590 PipeInfo[corenum][pipeselected[corenum]].Buffer,
591 PipeInfo[corenum][pipeselected[corenum]].ByteTransfered,
593 PipeInfo[corenum][pipeselected[corenum]].
StartIdx = PipeInfo[corenum][pipeselected[corenum]].
ByteTransfered = 0;
665 if (PipeInfo[corenum][pipeselected[corenum]].StartIdx < PipeInfo[corenum][pipeselected[corenum]].ByteTransfered ) {
667 PipeInfo[corenum][pipeselected[corenum]].
Buffer[PipeInfo[corenum][pipeselected[corenum]].
StartIdx];
668 PipeInfo[corenum][pipeselected[corenum]].
StartIdx++;
687 static inline void Pipe_Write_8(
const uint8_t corenum,
const uint8_t Data)
689 if (PipeInfo[corenum][pipeselected[corenum]].ByteTransfered <
690 PipeInfo[corenum][pipeselected[corenum]].BufferSize) {
691 PipeInfo[corenum][pipeselected[corenum]].
Buffer[PipeInfo[corenum][pipeselected[corenum]].
ByteTransfered] = Data;
723 tem = (tem2 << 8) | tem1;
745 tem = (tem1 << 8) | tem2;
808 uint8_t tem1, tem2, tem3, tem4;
814 tem = (tem4 << 24) | (tem3 << 16) | (tem2 << 8) | tem1;
832 uint8_t tem1, tem2, tem3, tem4;
838 tem = (tem1 << 24) | (tem2 << 16) | (tem3 << 8) | tem4;
944 const uint8_t Number,
949 const uint8_t Banks);
974 #if !defined(__DOXYGEN__)
976 #if !defined(ENDPOINT_CONTROLEP)
977 #define ENDPOINT_CONTROLEP 0
981 static inline uint8_t Pipe_BytesToEPSizeMask(
const uint16_t Bytes) ATTR_WARN_UNUSED_RESULT
ATTR_CONST
984 static inline uint8_t Pipe_BytesToEPSizeMask(
const uint16_t Bytes)
995 #if defined(__cplusplus)