libxr
1.0
Want to be the best embedded framework
|
Public Member Functions | |
STM32USBDevice (PCD_HandleTypeDef *hpcd, stm32_usb_dev_id_t id, size_t max_ep_num, USB::DeviceDescriptor::PacketSize0 packet_size, uint16_t vid, uint16_t pid, uint16_t bcd, const std::initializer_list< const USB::DescriptorStrings::LanguagePack * > LANG_LIST, const std::initializer_list< const std::initializer_list< USB::ConfigDescriptorItem * > > CONFIGS, USB::Speed speed=USB::Speed::FULL, USB::USBSpec spec=USB::USBSpec::USB_2_0) | |
void | Init () override |
初始化 USB 设备 / Initialize USB device | |
void | Deinit () override |
反初始化 USB 设备 / Deinitialize USB device | |
void | Start () override |
启动 USB 设备 / Start USB device | |
void | Stop () override |
停止 USB 设备 / Stop USB device | |
![]() | |
EndpointPool (size_t endpoint_num) | |
构造函数 / Constructor | |
ErrorCode | Get (Endpoint *&ep_info, Endpoint::Direction direction, Endpoint::EPNumber ep_num=Endpoint::EPNumber::EP_AUTO) |
分配端点 / Allocate endpoint | |
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 | |
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 | |
![]() | |
DeviceCore (EndpointPool &ep_pool, USBSpec spec, Speed speed, DeviceDescriptor::PacketSize0 packet_size, uint16_t vid, uint16_t pid, uint16_t bcd, const std::initializer_list< const DescriptorStrings::LanguagePack * > &lang_list, const std::initializer_list< const std::initializer_list< ConfigDescriptorItem * > > &configs) | |
构造函数 / Constructor | |
void | OnSetupPacket (bool in_isr, const SetupPacket *setup) |
处理主机发送的 SETUP 包 Handle USB setup packet from host | |
Data Fields | |
PCD_HandleTypeDef * | hpcd_ |
stm32_usb_dev_id_t | id_ |
![]() |
Static Public Attributes | |
static STM32USBDevice * | map_ [STM32_USB_DEV_ID_NUM] = {} |
Additional Inherited Members | |
![]() | |
enum | Context : uint8_t { UNKNOW , SETUP , DATA_OUT , STATUS_OUT , DATA_IN , STATUS_IN , ZLP } |
控制传输状态枚举 / Control transfer context enum More... | |
![]() | |
enum | SlotState |
槽状态 / Slot state More... | |
![]() | |
Slot & | operator[] (uint32_t index) |
LockFreePool (uint32_t slot_count) | |
构造对象池 / Constructor for the pool | |
~LockFreePool () | |
析构,释放槽池内存 / Destructor, releasing pool memory | |
ErrorCode | Put (const Endpoint *&data) |
向池中放入一个元素 / Put an element into the pool | |
ErrorCode | Put (const Endpoint *&data, uint32_t &start_index) |
向池中放入一个元素,返回起始槽索引 / Put an element into the pool and return the starting slot index | |
ErrorCode | PutToSlot (const Endpoint *&data, uint32_t index) |
向指定槽放入一个元素 / Put an element into a specific slot | |
ErrorCode | Get (Endpoint *&data) |
从池中取出一个元素 / Retrieve an element from the pool | |
ErrorCode | Get (Endpoint *&data, uint32_t &start_index) |
从指定槽位开始,取出一个元素 / Retrieve an element from the pool | |
ErrorCode | GetFromSlot (Endpoint *&data, uint32_t index) |
从指定槽位开始,取出一个元素 / Retrieve an element from the pool | |
ErrorCode | RecycleSlot (uint32_t index) |
回收指定槽位 / Recycle a slot | |
size_t | Size () const |
查询池中可取元素数量 / Query the number of available elements in the pool | |
size_t | EmptySize () |
查询当前池可用槽数量 / Query the number of writable slots in the pool | |
uint32_t | SlotCount () const |
获取槽总数 / Get the total number of slots in the pool | |
Definition at line 18 of file stm32_usb_dev.hpp.
|
inline |
Definition at line 21 of file stm32_usb_dev.hpp.
|
inlineoverridevirtual |
反初始化 USB 设备 / Deinitialize USB device
Reimplemented from LibXR::USB::DeviceCore.
Definition at line 40 of file stm32_usb_dev.hpp.
|
inlineoverridevirtual |
初始化 USB 设备 / Initialize USB device
Reimplemented from LibXR::USB::DeviceCore.
Definition at line 38 of file stm32_usb_dev.hpp.
|
inlineoverridevirtual |
启动 USB 设备 / Start USB device
Implements LibXR::USB::DeviceCore.
Definition at line 42 of file stm32_usb_dev.hpp.
|
inlineoverridevirtual |
停止 USB 设备 / Stop USB device
Implements LibXR::USB::DeviceCore.
Definition at line 43 of file stm32_usb_dev.hpp.
PCD_HandleTypeDef* LibXR::STM32USBDevice::hpcd_ |
Definition at line 45 of file stm32_usb_dev.hpp.
stm32_usb_dev_id_t LibXR::STM32USBDevice::id_ |
Definition at line 46 of file stm32_usb_dev.hpp.
|
inlinestatic |
Definition at line 47 of file stm32_usb_dev.hpp.