RT-Thread RTOS 1.2.0
An open source embedded real-time operating system
载入中...
搜索中...
未找到
usb_device.h 文件参考
#include <rtthread.h>
#include "drivers/usb_common.h"
+ usb_device.h 的引用(Include)关系图:

浏览该文件的源代码.

结构体

struct  udcd_ops
 
struct  ep_id
 
struct  uio_request
 
struct  uendpoint
 
struct  udcd
 
struct  ualtsetting
 
struct  uinterface
 
struct  ufunction_ops
 
struct  ufunction
 
struct  uconfig
 
struct  udevice
 
struct  udclass
 
struct  ep_msg
 
struct  udev_msg
 

宏定义

#define _VENDOR_ID   0x0EFF
 
#define _PRODUCT_ID   0x0001
 
#define MAX_INTF_STR   20
 
#define USB_BCD_DEVICE   0x0200 /* USB Specification Release Number in Binary-Coded Decimal */
 
#define USB_BCD_VERSION   0x0200 /* USB 2.0 */
 
#define EP0_IN_ADDR   0x80
 
#define EP0_OUT_ADDR   0x00
 
#define EP_HANDLER(ep, func, size)
 
#define EP_ADDRESS(ep)
 
#define EP_MAXPACKET(ep)
 
#define FUNC_ENABLE(func)
 
#define FUNC_DISABLE(func)
 
#define RT_USBD_CLASS_CTRL_CONNECTED   (RT_DEVICE_CTRL_BASE(USBDevice) + 0)
 

类型定义

typedef rt_err_t(* udep_handler_t) (struct ufunction *func, rt_size_t size)
 
typedef struct uio_requestuio_request_t
 
typedef struct uendpointuep_t
 
typedef struct udcdudcd_t
 
typedef struct ualtsettingualtsetting_t
 
typedef rt_err_t(* uintf_handler_t) (struct ufunction *func, ureq_t setup)
 
typedef struct uinterfaceuintf_t
 
typedef struct ufunction_opsufunction_ops_t
 
typedef struct ufunctionufunction_t
 
typedef struct uconfiguconfig_t
 
typedef struct udeviceudevice_t
 
typedef struct udclassudclass_t
 
typedef enum udev_msg_type udev_msg_type
 
typedef struct udev_msgudev_msg_t
 

枚举

enum  UIO_REQUEST_TYPE { UIO_REQUEST_READ_FULL , UIO_REQUEST_READ_BEST , UIO_REQUEST_WRITE }
 
enum  udev_msg_type {
  USB_MSG_SETUP_NOTIFY , USB_MSG_DATA_NOTIFY , USB_MSG_EP0_OUT , USB_MSG_EP_CLEAR_FEATURE ,
  USB_MSG_SOF , USB_MSG_RESET , USB_MSG_PLUG_IN , USB_MSG_PLUG_OUT
}
 

函数

int rt_usbd_class_list_init (void)
 
udevice_t rt_usbd_device_new (void)
 
uconfig_t rt_usbd_config_new (void)
 
ufunction_t rt_usbd_function_new (udevice_t device, udev_desc_t dev_desc, ufunction_ops_t ops)
 
uintf_t rt_usbd_interface_new (udevice_t device, uintf_handler_t handler)
 
uep_t rt_usbd_endpoint_new (uep_desc_t ep_desc, udep_handler_t handler)
 
ualtsetting_t rt_usbd_altsetting_new (rt_size_t desc_size)
 
rt_err_t rt_usbd_core_init (void)
 
rt_err_t rt_usb_device_init (void)
 
rt_err_t rt_usbd_event_signal (struct udev_msg *msg)
 
rt_err_t rt_usbd_device_set_controller (udevice_t device, udcd_t dcd)
 
rt_err_t rt_usbd_device_set_descriptor (udevice_t device, udev_desc_t dev_desc)
 
rt_err_t rt_usbd_device_set_string (udevice_t device, const char **ustring)
 
rt_err_t rt_usbd_device_set_interface_string (udevice_t device, int index, const char *string)
 
rt_err_t rt_usbd_device_set_qualifier (udevice_t device, struct usb_qualifier_descriptor *qualifier)
 
rt_err_t rt_usbd_device_set_os_comp_id_desc (udevice_t device, usb_os_comp_id_desc_t os_comp_id_desc)
 
rt_err_t rt_usbd_device_add_config (udevice_t device, uconfig_t cfg)
 
rt_err_t rt_usbd_config_add_function (uconfig_t cfg, ufunction_t func)
 
rt_err_t rt_usbd_class_register (udclass_t udclass)
 
rt_err_t rt_usbd_function_add_interface (ufunction_t func, uintf_t intf)
 
rt_err_t rt_usbd_interface_add_altsetting (uintf_t intf, ualtsetting_t setting)
 
rt_err_t rt_usbd_altsetting_add_endpoint (ualtsetting_t setting, uep_t ep)
 
rt_err_t rt_usbd_os_comp_id_desc_add_os_func_comp_id_desc (usb_os_comp_id_desc_t os_comp_id_desc, usb_os_func_comp_id_desc_t os_func_comp_id_desc)
 
rt_err_t rt_usbd_altsetting_config_descriptor (ualtsetting_t setting, const void *desc, rt_off_t intf_pos)
 
rt_err_t rt_usbd_set_config (udevice_t device, rt_uint8_t value)
 
rt_err_t rt_usbd_set_altsetting (uintf_t intf, rt_uint8_t value)
 
udevice_t rt_usbd_find_device (udcd_t dcd)
 
uconfig_t rt_usbd_find_config (udevice_t device, rt_uint8_t value)
 
uintf_t rt_usbd_find_interface (udevice_t device, rt_uint8_t value, ufunction_t *pfunc)
 
uep_t rt_usbd_find_endpoint (udevice_t device, ufunction_t *pfunc, rt_uint8_t ep_addr)
 
rt_size_t rt_usbd_io_request (udevice_t device, uep_t ep, uio_request_t req)
 
rt_size_t rt_usbd_ep0_write (udevice_t device, void *buffer, rt_size_t size)
 
rt_size_t rt_usbd_ep0_read (udevice_t device, void *buffer, rt_size_t size, rt_err_t(*rx_ind)(udevice_t device, rt_size_t size))
 
int rt_usbd_vcom_class_register (void)
 
int rt_usbd_ecm_class_register (void)
 
int rt_usbd_hid_class_register (void)
 
int rt_usbd_msc_class_register (void)
 
int rt_usbd_rndis_class_register (void)
 
int rt_usbd_winusb_class_register (void)
 
rt_err_t rt_usbd_set_feature (udevice_t device, rt_uint16_t value, rt_uint16_t index)
 
rt_err_t rt_usbd_clear_feature (udevice_t device, rt_uint16_t value, rt_uint16_t index)
 
rt_err_t rt_usbd_ep_set_stall (udevice_t device, uep_t ep)
 
rt_err_t rt_usbd_ep_clear_stall (udevice_t device, uep_t ep)
 
rt_err_t rt_usbd_ep0_set_stall (udevice_t device)
 
rt_err_t rt_usbd_ep0_clear_stall (udevice_t device)
 
rt_err_t rt_usbd_ep0_setup_handler (udcd_t dcd, struct urequest *setup)
 
rt_err_t rt_usbd_ep0_in_handler (udcd_t dcd)
 
rt_err_t rt_usbd_ep0_out_handler (udcd_t dcd, rt_size_t size)
 
rt_err_t rt_usbd_ep_in_handler (udcd_t dcd, rt_uint8_t address, rt_size_t size)
 
rt_err_t rt_usbd_ep_out_handler (udcd_t dcd, rt_uint8_t address, rt_size_t size)
 
rt_err_t rt_usbd_reset_handler (udcd_t dcd)
 
rt_err_t rt_usbd_connect_handler (udcd_t dcd)
 
rt_err_t rt_usbd_disconnect_handler (udcd_t dcd)
 
rt_err_t rt_usbd_sof_handler (udcd_t dcd)
 
rt_inline rt_err_t dcd_set_address (udcd_t dcd, rt_uint8_t address)
 
rt_inline rt_err_t dcd_set_config (udcd_t dcd, rt_uint8_t address)
 
rt_inline rt_err_t dcd_ep_enable (udcd_t dcd, uep_t ep)
 
rt_inline rt_err_t dcd_ep_disable (udcd_t dcd, uep_t ep)
 
rt_inline rt_size_t dcd_ep_read_prepare (udcd_t dcd, rt_uint8_t address, void *buffer, rt_size_t size)
 
rt_inline rt_size_t dcd_ep_read (udcd_t dcd, rt_uint8_t address, void *buffer)
 
rt_inline rt_size_t dcd_ep_write (udcd_t dcd, rt_uint8_t address, void *buffer, rt_size_t size)
 
rt_inline rt_err_t dcd_ep0_send_status (udcd_t dcd)
 
rt_inline rt_err_t dcd_ep_set_stall (udcd_t dcd, rt_uint8_t address)
 
rt_inline rt_err_t dcd_ep_clear_stall (udcd_t dcd, rt_uint8_t address)
 
rt_inline void usbd_os_proerty_descriptor_send (ufunction_t func, ureq_t setup, usb_os_proerty_t usb_os_proerty, rt_uint8_t number_of_proerty)
 

宏定义说明

◆ _VENDOR_ID

#define _VENDOR_ID   0x0EFF

在文件 usb_device.h29 行定义.

◆ _PRODUCT_ID

#define _PRODUCT_ID   0x0001

在文件 usb_device.h35 行定义.

◆ MAX_INTF_STR

#define MAX_INTF_STR   20

在文件 usb_device.h39 行定义.

◆ USB_BCD_DEVICE

#define USB_BCD_DEVICE   0x0200 /* USB Specification Release Number in Binary-Coded Decimal */

在文件 usb_device.h42 行定义.

◆ USB_BCD_VERSION

#define USB_BCD_VERSION   0x0200 /* USB 2.0 */

在文件 usb_device.h43 行定义.

◆ EP0_IN_ADDR

#define EP0_IN_ADDR   0x80

在文件 usb_device.h44 行定义.

◆ EP0_OUT_ADDR

#define EP0_OUT_ADDR   0x00

在文件 usb_device.h45 行定义.

◆ EP_HANDLER

#define EP_HANDLER ( ep,
func,
size )
值:
RT_ASSERT(ep != RT_NULL); ep->handler(func, size)
#define RT_ASSERT(EX)
#define RT_NULL

在文件 usb_device.h46 行定义.

◆ EP_ADDRESS

#define EP_ADDRESS ( ep)
值:
ep->ep_desc->bEndpointAddress

在文件 usb_device.h47 行定义.

◆ EP_MAXPACKET

#define EP_MAXPACKET ( ep)
值:
ep->ep_desc->wMaxPacketSize

在文件 usb_device.h48 行定义.

◆ FUNC_ENABLE

#define FUNC_ENABLE ( func)
值:
do{ \
if(func->ops->enable != RT_NULL && \
func->enabled == RT_FALSE) \
{ \
if(func->ops->enable(func) == RT_EOK) \
func->enabled = RT_TRUE; \
} \
}while(0)
#define RT_TRUE
#define RT_FALSE

在文件 usb_device.h49 行定义.

49#define FUNC_ENABLE(func) do{ \
50 if(func->ops->enable != RT_NULL && \
51 func->enabled == RT_FALSE) \
52 { \
53 if(func->ops->enable(func) == RT_EOK) \
54 func->enabled = RT_TRUE; \
55 } \
56 }while(0)

◆ FUNC_DISABLE

#define FUNC_DISABLE ( func)
值:
do{ \
if(func->ops->disable != RT_NULL && \
func->enabled == RT_TRUE) \
{ \
func->enabled = RT_FALSE; \
func->ops->disable(func); \
} \
}while(0)

在文件 usb_device.h57 行定义.

57#define FUNC_DISABLE(func) do{ \
58 if(func->ops->disable != RT_NULL && \
59 func->enabled == RT_TRUE) \
60 { \
61 func->enabled = RT_FALSE; \
62 func->ops->disable(func); \
63 } \
64 }while(0)

◆ RT_USBD_CLASS_CTRL_CONNECTED

#define RT_USBD_CLASS_CTRL_CONNECTED   (RT_DEVICE_CTRL_BASE(USBDevice) + 0)

在文件 usb_device.h66 行定义.

类型定义说明

◆ udep_handler_t

typedef rt_err_t(* udep_handler_t) (struct ufunction *func, rt_size_t size)

在文件 usb_device.h107 行定义.

◆ uio_request_t

typedef struct uio_request* uio_request_t

在文件 usb_device.h117 行定义.

◆ uep_t

typedef struct uendpoint* uep_t

在文件 usb_device.h131 行定义.

◆ udcd_t

typedef struct udcd* udcd_t

在文件 usb_device.h142 行定义.

◆ ualtsetting_t

typedef struct ualtsetting* ualtsetting_t

在文件 usb_device.h152 行定义.

◆ uintf_handler_t

typedef rt_err_t(* uintf_handler_t) (struct ufunction *func, ureq_t setup)

在文件 usb_device.h154 行定义.

◆ uintf_t

typedef struct uinterface* uintf_t

在文件 usb_device.h164 行定义.

◆ ufunction_ops_t

typedef struct ufunction_ops* ufunction_ops_t

在文件 usb_device.h172 行定义.

◆ ufunction_t

typedef struct ufunction* ufunction_t

在文件 usb_device.h185 行定义.

◆ uconfig_t

typedef struct uconfig* uconfig_t

在文件 usb_device.h193 行定义.

◆ udevice_t

typedef struct udevice* udevice_t

在文件 usb_device.h211 行定义.

◆ udclass_t

typedef struct udclass* udclass_t

在文件 usb_device.h218 行定义.

◆ udev_msg_type

在文件 usb_device.h235 行定义.

◆ udev_msg_t

typedef struct udev_msg* udev_msg_t

在文件 usb_device.h253 行定义.

枚举类型说明

◆ UIO_REQUEST_TYPE

枚举值
UIO_REQUEST_READ_FULL 
UIO_REQUEST_READ_BEST 
UIO_REQUEST_WRITE 

在文件 usb_device.h72 行定义.

73{
74 /* request to read full count */
76 /* request to read any count */
78 /* request to write full count */
UIO_REQUEST_TYPE
@ UIO_REQUEST_READ_FULL
@ UIO_REQUEST_WRITE
@ UIO_REQUEST_READ_BEST

◆ udev_msg_type

枚举值
USB_MSG_SETUP_NOTIFY 
USB_MSG_DATA_NOTIFY 
USB_MSG_EP0_OUT 
USB_MSG_EP_CLEAR_FEATURE 
USB_MSG_SOF 
USB_MSG_RESET 
USB_MSG_PLUG_IN 
USB_MSG_PLUG_OUT 

在文件 usb_device.h220 行定义.

221{
229 /* we don't need to add a "PLUG_IN" event because after the cable is
230 * plugged in(before any SETUP) the classed have nothing to do. If the host
231 * is ready, it will send RESET and we will have USB_MSG_RESET. So, a RESET
232 * should reset and run the class while plug_in is not. */
234};
@ USB_MSG_SOF
@ USB_MSG_PLUG_OUT
@ USB_MSG_RESET
@ USB_MSG_PLUG_IN
@ USB_MSG_DATA_NOTIFY
@ USB_MSG_EP_CLEAR_FEATURE
@ USB_MSG_EP0_OUT
@ USB_MSG_SETUP_NOTIFY

函数说明

◆ rt_usbd_class_list_init()

int rt_usbd_class_list_init ( void )

◆ rt_usbd_device_new()

udevice_t rt_usbd_device_new ( void )

◆ rt_usbd_config_new()

uconfig_t rt_usbd_config_new ( void )

◆ rt_usbd_function_new()

ufunction_t rt_usbd_function_new ( udevice_t device,
udev_desc_t dev_desc,
ufunction_ops_t ops )

◆ rt_usbd_interface_new()

uintf_t rt_usbd_interface_new ( udevice_t device,
uintf_handler_t handler )

◆ rt_usbd_endpoint_new()

uep_t rt_usbd_endpoint_new ( uep_desc_t ep_desc,
udep_handler_t handler )

◆ rt_usbd_altsetting_new()

ualtsetting_t rt_usbd_altsetting_new ( rt_size_t desc_size)

◆ rt_usbd_core_init()

rt_err_t rt_usbd_core_init ( void )

◆ rt_usb_device_init()

rt_err_t rt_usb_device_init ( void )

◆ rt_usbd_event_signal()

rt_err_t rt_usbd_event_signal ( struct udev_msg * msg)

◆ rt_usbd_device_set_controller()

rt_err_t rt_usbd_device_set_controller ( udevice_t device,
udcd_t dcd )

◆ rt_usbd_device_set_descriptor()

rt_err_t rt_usbd_device_set_descriptor ( udevice_t device,
udev_desc_t dev_desc )

◆ rt_usbd_device_set_string()

rt_err_t rt_usbd_device_set_string ( udevice_t device,
const char ** ustring )

◆ rt_usbd_device_set_interface_string()

rt_err_t rt_usbd_device_set_interface_string ( udevice_t device,
int index,
const char * string )

◆ rt_usbd_device_set_qualifier()

rt_err_t rt_usbd_device_set_qualifier ( udevice_t device,
struct usb_qualifier_descriptor * qualifier )

◆ rt_usbd_device_set_os_comp_id_desc()

rt_err_t rt_usbd_device_set_os_comp_id_desc ( udevice_t device,
usb_os_comp_id_desc_t os_comp_id_desc )

◆ rt_usbd_device_add_config()

rt_err_t rt_usbd_device_add_config ( udevice_t device,
uconfig_t cfg )

◆ rt_usbd_config_add_function()

rt_err_t rt_usbd_config_add_function ( uconfig_t cfg,
ufunction_t func )

◆ rt_usbd_class_register()

rt_err_t rt_usbd_class_register ( udclass_t udclass)

◆ rt_usbd_function_add_interface()

rt_err_t rt_usbd_function_add_interface ( ufunction_t func,
uintf_t intf )

◆ rt_usbd_interface_add_altsetting()

rt_err_t rt_usbd_interface_add_altsetting ( uintf_t intf,
ualtsetting_t setting )

◆ rt_usbd_altsetting_add_endpoint()

rt_err_t rt_usbd_altsetting_add_endpoint ( ualtsetting_t setting,
uep_t ep )

◆ rt_usbd_os_comp_id_desc_add_os_func_comp_id_desc()

rt_err_t rt_usbd_os_comp_id_desc_add_os_func_comp_id_desc ( usb_os_comp_id_desc_t os_comp_id_desc,
usb_os_func_comp_id_desc_t os_func_comp_id_desc )

◆ rt_usbd_altsetting_config_descriptor()

rt_err_t rt_usbd_altsetting_config_descriptor ( ualtsetting_t setting,
const void * desc,
rt_off_t intf_pos )

◆ rt_usbd_set_config()

rt_err_t rt_usbd_set_config ( udevice_t device,
rt_uint8_t value )

◆ rt_usbd_set_altsetting()

rt_err_t rt_usbd_set_altsetting ( uintf_t intf,
rt_uint8_t value )

◆ rt_usbd_find_device()

udevice_t rt_usbd_find_device ( udcd_t dcd)

◆ rt_usbd_find_config()

uconfig_t rt_usbd_find_config ( udevice_t device,
rt_uint8_t value )

◆ rt_usbd_find_interface()

uintf_t rt_usbd_find_interface ( udevice_t device,
rt_uint8_t value,
ufunction_t * pfunc )

◆ rt_usbd_find_endpoint()

uep_t rt_usbd_find_endpoint ( udevice_t device,
ufunction_t * pfunc,
rt_uint8_t ep_addr )

◆ rt_usbd_io_request()

rt_size_t rt_usbd_io_request ( udevice_t device,
uep_t ep,
uio_request_t req )

◆ rt_usbd_ep0_write()

rt_size_t rt_usbd_ep0_write ( udevice_t device,
void * buffer,
rt_size_t size )
+ 这是这个函数的调用关系图:

◆ rt_usbd_ep0_read()

rt_size_t rt_usbd_ep0_read ( udevice_t device,
void * buffer,
rt_size_t size,
rt_err_t(* rx_ind )(udevice_t device, rt_size_t size) )

◆ rt_usbd_vcom_class_register()

int rt_usbd_vcom_class_register ( void )

◆ rt_usbd_ecm_class_register()

int rt_usbd_ecm_class_register ( void )

◆ rt_usbd_hid_class_register()

int rt_usbd_hid_class_register ( void )

◆ rt_usbd_msc_class_register()

int rt_usbd_msc_class_register ( void )

◆ rt_usbd_rndis_class_register()

int rt_usbd_rndis_class_register ( void )

◆ rt_usbd_winusb_class_register()

int rt_usbd_winusb_class_register ( void )

◆ rt_usbd_set_feature()

rt_err_t rt_usbd_set_feature ( udevice_t device,
rt_uint16_t value,
rt_uint16_t index )

◆ rt_usbd_clear_feature()

rt_err_t rt_usbd_clear_feature ( udevice_t device,
rt_uint16_t value,
rt_uint16_t index )

◆ rt_usbd_ep_set_stall()

rt_err_t rt_usbd_ep_set_stall ( udevice_t device,
uep_t ep )

◆ rt_usbd_ep_clear_stall()

rt_err_t rt_usbd_ep_clear_stall ( udevice_t device,
uep_t ep )

◆ rt_usbd_ep0_set_stall()

rt_err_t rt_usbd_ep0_set_stall ( udevice_t device)

◆ rt_usbd_ep0_clear_stall()

rt_err_t rt_usbd_ep0_clear_stall ( udevice_t device)

◆ rt_usbd_ep0_setup_handler()

rt_err_t rt_usbd_ep0_setup_handler ( udcd_t dcd,
struct urequest * setup )

◆ rt_usbd_ep0_in_handler()

rt_err_t rt_usbd_ep0_in_handler ( udcd_t dcd)

◆ rt_usbd_ep0_out_handler()

rt_err_t rt_usbd_ep0_out_handler ( udcd_t dcd,
rt_size_t size )

◆ rt_usbd_ep_in_handler()

rt_err_t rt_usbd_ep_in_handler ( udcd_t dcd,
rt_uint8_t address,
rt_size_t size )

◆ rt_usbd_ep_out_handler()

rt_err_t rt_usbd_ep_out_handler ( udcd_t dcd,
rt_uint8_t address,
rt_size_t size )

◆ rt_usbd_reset_handler()

rt_err_t rt_usbd_reset_handler ( udcd_t dcd)

◆ rt_usbd_connect_handler()

rt_err_t rt_usbd_connect_handler ( udcd_t dcd)

◆ rt_usbd_disconnect_handler()

rt_err_t rt_usbd_disconnect_handler ( udcd_t dcd)

◆ rt_usbd_sof_handler()

rt_err_t rt_usbd_sof_handler ( udcd_t dcd)

◆ dcd_set_address()

rt_inline rt_err_t dcd_set_address ( udcd_t dcd,
rt_uint8_t address )

在文件 usb_device.h320 行定义.

321{
322 RT_ASSERT(dcd != RT_NULL);
323 RT_ASSERT(dcd->ops != RT_NULL);
325
326 return dcd->ops->set_address(address);
327}
rt_err_t(* set_address)(rt_uint8_t address)
const struct udcd_ops * ops

引用了 udev_msg::dcd, udcd::ops, RT_ASSERT, RT_NULL , 以及 udcd_ops::set_address.

◆ dcd_set_config()

rt_inline rt_err_t dcd_set_config ( udcd_t dcd,
rt_uint8_t address )

在文件 usb_device.h329 行定义.

330{
331 RT_ASSERT(dcd != RT_NULL);
332 RT_ASSERT(dcd->ops != RT_NULL);
334
335 return dcd->ops->set_config(address);
336}
rt_err_t(* set_config)(rt_uint8_t address)

引用了 udev_msg::dcd, udcd::ops, RT_ASSERT, RT_NULL , 以及 udcd_ops::set_config.

◆ dcd_ep_enable()

rt_inline rt_err_t dcd_ep_enable ( udcd_t dcd,
uep_t ep )

在文件 usb_device.h338 行定义.

339{
340 RT_ASSERT(dcd != RT_NULL);
341 RT_ASSERT(dcd->ops != RT_NULL);
342 RT_ASSERT(dcd->ops->ep_enable != RT_NULL);
343
344 return dcd->ops->ep_enable(ep);
345}
rt_err_t(* ep_enable)(struct uendpoint *ep)

引用了 udev_msg::dcd, udcd_ops::ep_enable, udcd::ops, RT_ASSERT , 以及 RT_NULL.

◆ dcd_ep_disable()

rt_inline rt_err_t dcd_ep_disable ( udcd_t dcd,
uep_t ep )

在文件 usb_device.h347 行定义.

348{
349 RT_ASSERT(dcd != RT_NULL);
350 RT_ASSERT(dcd->ops != RT_NULL);
352
353 return dcd->ops->ep_disable(ep);
354}
rt_err_t(* ep_disable)(struct uendpoint *ep)

引用了 udev_msg::dcd, udcd_ops::ep_disable, udcd::ops, RT_ASSERT , 以及 RT_NULL.

◆ dcd_ep_read_prepare()

rt_inline rt_size_t dcd_ep_read_prepare ( udcd_t dcd,
rt_uint8_t address,
void * buffer,
rt_size_t size )

在文件 usb_device.h356 行定义.

358{
359 RT_ASSERT(dcd != RT_NULL);
360 RT_ASSERT(dcd->ops != RT_NULL);
361
362 if(dcd->ops->ep_read_prepare != RT_NULL)
363 {
364 return dcd->ops->ep_read_prepare(address, buffer, size);
365 }
366 else
367 {
368 return 0;
369 }
370}
rt_ssize_t(* ep_read_prepare)(rt_uint8_t address, void *buffer, rt_size_t size)

引用了 udev_msg::dcd, udcd_ops::ep_read_prepare, udcd::ops, RT_ASSERT , 以及 RT_NULL.

◆ dcd_ep_read()

rt_inline rt_size_t dcd_ep_read ( udcd_t dcd,
rt_uint8_t address,
void * buffer )

在文件 usb_device.h372 行定义.

373{
374 RT_ASSERT(dcd != RT_NULL);
375 RT_ASSERT(dcd->ops != RT_NULL);
376
377 if(dcd->ops->ep_read != RT_NULL)
378 {
379 return dcd->ops->ep_read(address, buffer);
380 }
381 else
382 {
383 return 0;
384 }
385}
rt_ssize_t(* ep_read)(rt_uint8_t address, void *buffer)

引用了 udev_msg::dcd, udcd_ops::ep_read, udcd::ops, RT_ASSERT , 以及 RT_NULL.

◆ dcd_ep_write()

rt_inline rt_size_t dcd_ep_write ( udcd_t dcd,
rt_uint8_t address,
void * buffer,
rt_size_t size )

在文件 usb_device.h387 行定义.

389{
390 RT_ASSERT(dcd != RT_NULL);
391 RT_ASSERT(dcd->ops != RT_NULL);
392 RT_ASSERT(dcd->ops->ep_write != RT_NULL);
393
394 return dcd->ops->ep_write(address, buffer, size);
395}
rt_ssize_t(* ep_write)(rt_uint8_t address, void *buffer, rt_size_t size)

引用了 udev_msg::dcd, udcd_ops::ep_write, udcd::ops, RT_ASSERT , 以及 RT_NULL.

◆ dcd_ep0_send_status()

rt_inline rt_err_t dcd_ep0_send_status ( udcd_t dcd)

在文件 usb_device.h397 行定义.

398{
399 RT_ASSERT(dcd != RT_NULL);
400 RT_ASSERT(dcd->ops != RT_NULL);
402
403 return dcd->ops->ep0_send_status();
404}
rt_err_t(* ep0_send_status)(void)

引用了 udev_msg::dcd, udcd_ops::ep0_send_status, udcd::ops, RT_ASSERT , 以及 RT_NULL.

◆ dcd_ep_set_stall()

rt_inline rt_err_t dcd_ep_set_stall ( udcd_t dcd,
rt_uint8_t address )

在文件 usb_device.h406 行定义.

407{
408 RT_ASSERT(dcd != RT_NULL);
409 RT_ASSERT(dcd->ops != RT_NULL);
411
412 return dcd->ops->ep_set_stall(address);
413}
rt_err_t(* ep_set_stall)(rt_uint8_t address)

引用了 udev_msg::dcd, udcd_ops::ep_set_stall, udcd::ops, RT_ASSERT , 以及 RT_NULL.

◆ dcd_ep_clear_stall()

rt_inline rt_err_t dcd_ep_clear_stall ( udcd_t dcd,
rt_uint8_t address )

在文件 usb_device.h415 行定义.

416{
417 RT_ASSERT(dcd != RT_NULL);
418 RT_ASSERT(dcd->ops != RT_NULL);
420
421 return dcd->ops->ep_clear_stall(address);
422}
rt_err_t(* ep_clear_stall)(rt_uint8_t address)

引用了 udev_msg::dcd, udcd_ops::ep_clear_stall, udcd::ops, RT_ASSERT , 以及 RT_NULL.

◆ usbd_os_proerty_descriptor_send()

rt_inline void usbd_os_proerty_descriptor_send ( ufunction_t func,
ureq_t setup,
usb_os_proerty_t usb_os_proerty,
rt_uint8_t number_of_proerty )

在文件 usb_device.h423 行定义.

424{
425 struct usb_os_property_header header;
426 static rt_uint8_t * data;
427 rt_uint8_t * pdata;
428 rt_uint8_t index,i;
429 if(data == RT_NULL)
430 {
431 header.dwLength = sizeof(struct usb_os_property_header);
432 header.bcdVersion = 0x0100;
433 header.wIndex = 0x05;
434 header.wCount = number_of_proerty;
435 for(index = 0;index < number_of_proerty;index++)
436 {
437 header.dwLength += usb_os_proerty[index].dwSize;
438 }
439 data = (rt_uint8_t *)rt_malloc(header.dwLength);
440 RT_ASSERT(data != RT_NULL);
441 pdata = data;
442 rt_memcpy((void *)pdata,(void *)&header,sizeof(struct usb_os_property_header));
443 pdata += sizeof(struct usb_os_property_header);
444 for(index = 0;index < number_of_proerty;index++)
445 {
446 rt_memcpy((void *)pdata,(void *)&usb_os_proerty[index],10);
447 pdata += 10;
448 for(i = 0;i < usb_os_proerty[index].wPropertyNameLength/2;i++)
449 {
450 *pdata = usb_os_proerty[index].bPropertyName[i];
451 pdata++;
452 *pdata = 0;
453 pdata++;
454 }
456 pdata += 4;
457 for(i = 0;i < usb_os_proerty[index].dwPropertyDataLength/2;i++)
458 {
459 *pdata = usb_os_proerty[index].bPropertyData[i];
460 pdata++;
461 *pdata = 0;
462 pdata++;
463 }
464 }
465 }
466 rt_usbd_ep0_write(func->device, data, setup->wLength);
467}
rt_weak void * rt_malloc(rt_size_t size)
Allocate a block of memory with a minimum of 'size' bytes.
unsigned char rt_uint8_t
unsigned int rt_uint32_t
struct udevice * device
rt_uint16_t wLength
const char * bPropertyData
rt_uint32_t dwPropertyDataLength
const char * bPropertyName
rt_uint16_t wPropertyNameLength
rt_size_t rt_usbd_ep0_write(udevice_t device, void *buffer, rt_size_t size)

引用了 usb_os_property_header::bcdVersion, usb_os_proerty::bPropertyData, usb_os_proerty::bPropertyName, ufunction::device, usb_os_property_header::dwLength, usb_os_proerty::dwPropertyDataLength, usb_os_proerty::dwSize, RT_ASSERT, rt_malloc(), RT_NULL, rt_usbd_ep0_write(), usb_os_property_header::wCount, usb_os_property_header::wIndex, urequest::wLength , 以及 usb_os_proerty::wPropertyNameLength.

+ 函数调用图: