119 static constexpr size_t DIR_COUNT = 2;
121 static constexpr size_t SLOT_COUNT =
125 enum class SlotUse : uint8_t
141 Endpoint* slots_[SLOT_COUNT][DIR_COUNT] = {};
142 SlotUse use_[SLOT_COUNT][DIR_COUNT] = {};
USB 端点基类 / USB Endpoint base class.
EPNumber
端点号 Endpoint number
@ EP_MAX_NUM
端点数量上限 / Maximum number of endpoints
Direction
端点方向 Endpoint direction
USB端点池类 / USB endpoint pool class.
EndpointPool(size_t endpoint_num)
构造函数 / Constructor
ErrorCode Put(Endpoint *ep)
登记一个端点到池中 / Register an endpoint into the pool
Endpoint * GetEndpoint0In()
获取端点0的IN对象 / Get Endpoint 0's IN object
void SetEndpoint0(Endpoint *ep0_in, Endpoint *ep0_out)
设置端点0的IN/OUT对象 / Set Endpoint 0 IN/OUT objects
ErrorCode Release(Endpoint *ep_info)
回收端点 / Release endpoint
ErrorCode FindEndpoint(uint8_t ep_addr, Endpoint *&ans)
查找端点/ Lookup endpoint
Endpoint * GetEndpoint0Out()
获取端点0的OUT对象 / Get Endpoint 0's OUT object
ErrorCode Get(Endpoint *&ep_info, Endpoint::Direction direction, Endpoint::EPNumber ep_num)
分配端点 / Allocate endpoint
ErrorCode
定义错误码枚举 / Defines an enumeration for error codes