libxr
1.0
Want to be the best embedded framework
|
Public Member Functions | |
CH32EndpointOtgHs (EPNumber ep_num, Direction dir, LibXR::RawData buffer, bool double_buffer) | |
void | Configure (const Config &cfg) override |
二次初始化/配置端点协议参数(由Pool/Manager分配后调用) Configure endpoint protocol parameters (call after pool allocation) | |
void | Close () override |
关闭端点(软禁用/资源复位) Close (soft disable) | |
ErrorCode | Transfer (size_t size) override |
传输数据 Transfer data | |
void | TransferComplete (size_t size) |
ErrorCode | Stall () override |
停止端点传输 Stop endpoint transfer | |
ErrorCode | ClearStall () override |
清除端点停止状态 Clear endpoint stop status | |
void | SwitchBuffer () override |
切换缓冲区 Switch buffer | |
![]() | |
Endpoint (EPNumber number, Direction dir, RawData buffer) | |
构造函数 Constructor | |
~Endpoint ()=default | |
析构函数 Destructor | |
Endpoint (const Endpoint &)=delete | |
Endpoint & | operator= (const Endpoint &)=delete |
EPNumber | GetNumber () const |
获取端点号 Get endpoint number | |
Direction | AvailableDirection () const |
获取允许配置的端点方向 Get allowed endpoint direction | |
Direction | GetDirection () const |
获取端点方向 Get endpoint direction | |
uint8_t | GetAddress () const |
获取端点地址(方向 + 号) Get endpoint address (dir + num) | |
State | GetState () const |
获取端点状态 Get endpoint state | |
void | SetState (State state) |
设置端点状态 Set endpoint state | |
Type | GetType () const |
获取端点类型 Get endpoint type | |
uint16_t | MaxPacketSize () const |
获取最大包长 Get max packet size | |
bool | IsStalled () const |
是否挂起 / Is endpoint stalled | |
bool | UseDoubleBuffer () const |
是否使用双缓冲区 / Use double buffer | |
RawData | GetBuffer () const |
获取端点缓冲区 Get endpoint buffer | |
void | SetOnTransferCompleteCallback (Callback< ConstRawData & > cb) |
设置传输完成回调 / Set transfer complete callback | |
void | SetActiveLength (uint16_t len) |
size_t | GetActiveLength () |
virtual size_t | MaxTransferSize () const |
返回最大可传输字节数 Return the maximum transferable size at this time | |
virtual ErrorCode | TransferZLP () |
传输空包 Transfer zero length packet | |
void | OnTransferCompleteCallback (bool in_isr, size_t actual_transfer_size) |
Data Fields | |
uint8_t | dev_id_ |
bool | tog0_ = false |
bool | tog1_ = false |
bool | hw_double_buffer_ = false |
size_t | last_transfer_size_ = 0 |
RawData | dma_buffer_ |
Additional Inherited Members | |
![]() | |
enum class | Direction : uint8_t { OUT = 0 , IN = 1 , BOTH = 2 } |
端点方向 Endpoint direction More... | |
enum class | EPNumber : uint8_t { EP0 = 0 , EP1 = 1 , EP2 = 2 , EP3 = 3 , EP4 = 4 , EP5 = 5 , EP6 = 6 , EP7 = 7 , EP8 = 8 , EP9 = 9 , EP10 = 10 , EP11 = 11 , EP12 = 12 , EP13 = 13 , EP14 = 14 , EP15 = 15 , EP_MAX_NUM = 16 , EP_AUTO = 0xFE , EP_INVALID = 0xFF } |
端点号 / Endpoint number More... | |
enum class | Type : uint8_t { CONTROL = 0 , ISOCHRONOUS = 1 , BULK = 2 , INTERRUPT = 3 } |
端点类型 Endpoint type More... | |
enum class | State : uint8_t { DISABLED , IDLE , BUSY , STALLED , ERROR } |
端点状态 Endpoint state More... | |
![]() | |
static constexpr uint8_t | EPNumberToInt8 (EPNumber ep) |
端点号转换为uint8_t / Convert endpoint number to uint8_t | |
static constexpr uint8_t | EPNumberToAddr (EPNumber ep, Direction dir) |
端点号转换为端点地址 / Convert endpoint number to endpoint address | |
static constexpr EPNumber | AddrToEPNumber (uint8_t addr, Direction &dir) |
端点地址转换为端点号 / Convert endpoint address to endpoint number | |
static constexpr EPNumber | NextEPNumber (EPNumber ep) |
获取下一个端点号 / Get the next endpoint number | |
![]() | |
Config & | GetConfig () |
获取当前配置 Get endpoint config | |
virtual void | SetActiveBlock (bool active_block) |
设置当前活动缓冲区 Set active buffer | |
Definition at line 37 of file ch32_usb_endpoint.hpp.
|
overridevirtual |
|
overridevirtual |
关闭端点(软禁用/资源复位) Close (soft disable)
Implements LibXR::USB::Endpoint.
|
overridevirtual |
二次初始化/配置端点协议参数(由Pool/Manager分配后调用) Configure endpoint protocol parameters (call after pool allocation)
Implements LibXR::USB::Endpoint.
|
overridevirtual |
|
overridevirtual |
切换缓冲区 Switch buffer
Reimplemented from LibXR::USB::Endpoint.
|
overridevirtual |
传输数据 Transfer data
size | 传输大小 / Transfer size |
Implements LibXR::USB::Endpoint.
uint8_t LibXR::CH32EndpointOtgHs::dev_id_ |
Definition at line 53 of file ch32_usb_endpoint.hpp.
RawData LibXR::CH32EndpointOtgHs::dma_buffer_ |
Definition at line 60 of file ch32_usb_endpoint.hpp.
bool LibXR::CH32EndpointOtgHs::hw_double_buffer_ = false |
Definition at line 56 of file ch32_usb_endpoint.hpp.
size_t LibXR::CH32EndpointOtgHs::last_transfer_size_ = 0 |
Definition at line 58 of file ch32_usb_endpoint.hpp.
bool LibXR::CH32EndpointOtgHs::tog0_ = false |
Definition at line 54 of file ch32_usb_endpoint.hpp.
bool LibXR::CH32EndpointOtgHs::tog1_ = false |
Definition at line 55 of file ch32_usb_endpoint.hpp.