Lines Matching refs:device

61     uinst_t device;  in rt_usbh_adk_get_protocol()  local
66 RT_ASSERT(intf->device != RT_NULL); in rt_usbh_adk_get_protocol()
68 device = intf->device; in rt_usbh_adk_get_protocol()
77 if(rt_usb_hcd_control_xfer(device->hcd, device, &setup, (void*)protocol, 2, in rt_usbh_adk_get_protocol()
95 uinst_t device; in rt_usbh_adk_send_string() local
100 RT_ASSERT(intf->device != RT_NULL); in rt_usbh_adk_send_string()
102 device = intf->device; in rt_usbh_adk_send_string()
111 if(rt_usb_hcd_control_xfer(device->hcd, device, &setup, (void*)str, in rt_usbh_adk_send_string()
128 uinst_t device; in rt_usbh_adk_start() local
133 RT_ASSERT(intf->device != RT_NULL); in rt_usbh_adk_start()
135 device = intf->device; in rt_usbh_adk_start()
144 if(rt_usb_hcd_control_xfer(device->hcd, device, &setup, RT_NULL, 0, in rt_usbh_adk_start()
156 static rt_ssize_t rt_usbh_adk_read(rt_device_t device, rt_off_t pos, void* buffer, in rt_usbh_adk_read() argument
164 RT_ASSERT(device != RT_NULL); in rt_usbh_adk_read()
167 intf = (struct uintf*)device->user_data; in rt_usbh_adk_read()
170 length = rt_usb_hcd_bulk_xfer(intf->device->hcd, adk->pipe_in, in rt_usbh_adk_read()
184 static rt_ssize_t rt_usbh_adk_write (rt_device_t device, rt_off_t pos, const void* buffer, in rt_usbh_adk_write() argument
193 intf = (struct uintf*)device->user_data; in rt_usbh_adk_write()
196 length = rt_usb_hcd_bulk_xfer(intf->device->hcd, adk->pipe_out, in rt_usbh_adk_write()
240 dev_desc = &intf->device->dev_desc; in rt_usbh_adk_enable()
321 ret = rt_usb_hcd_alloc_pipe(intf->device->hcd, &adk->pipe_in, in rt_usbh_adk_enable()
328 ret = rt_usb_hcd_alloc_pipe(intf->device->hcd, &adk->pipe_out, in rt_usbh_adk_enable()
342 ret = rt_usbh_set_configure(intf->device, 1); in rt_usbh_adk_enable()
346 adk->device.type = RT_Device_Class_Char; in rt_usbh_adk_enable()
348 adk->device.ops = &adk_device_ops; in rt_usbh_adk_enable()
350 adk->device.init = RT_NULL; in rt_usbh_adk_enable()
351 adk->device.open = RT_NULL; in rt_usbh_adk_enable()
352 adk->device.close = RT_NULL; in rt_usbh_adk_enable()
353 adk->device.read = rt_usbh_adk_read; in rt_usbh_adk_enable()
354 adk->device.write = rt_usbh_adk_write; in rt_usbh_adk_enable()
355 adk->device.control = RT_NULL; in rt_usbh_adk_enable()
357 adk->device.user_data = (void*)intf; in rt_usbh_adk_enable()
359 rt_device_register(&adk->device, "adkdev", RT_DEVICE_FLAG_RDWR); in rt_usbh_adk_enable()
389 rt_usb_hcd_free_pipe(intf->device->hcd, adk->pipe_in); in rt_usbh_adk_disable()
392 rt_usb_hcd_free_pipe(intf->device->hcd, adk->pipe_out); in rt_usbh_adk_disable()
395 rt_device_unregister(&adk->device); in rt_usbh_adk_disable()