usb host

http://china.cypress.com/?rID=55628&cache=0

At least one host controller is present in a host and it is possible to have more than one host controller.Each controller allows the connection of up to 127 devices with the use of external USB hubs.The root hub is an internal hub that connects to the host controller(s) and acts as the first interface layer to the USB in a system.Currently on your PC, there are multiple USB ports.These ports are part of the root hub in your PC. For simplicity, look at the root hub and host controller from the abstract view of a “black box” that we call the host.

USB devices consist of one or more device functions, such as a mouse, keyboard, or audio device for example.Each device is given an address by the host, which is used in the data communication between that device and the host.USB device communication is done though pipes.These pipes are a connection pathway from the host controller to an addressable buffer called an endpoint.An endpoint stores received data from the host and holds data that is waiting to transmit to the host.A USB device can have multiple endpoints and each endpoint has a pipe associated with it.
There are two types of pipes in a USB system, control pipes and data pipes.The USB specification defines four different data transfer types.Which pipe is used depends on the data transfer type.

  • Control Transfers Used for sending commands to the device, make inquiries, and configure the device.This transfer uses the control pipe.
  • Interrupt Transfers Used for sending small amounts of bursty data that requires a guaranteed minimum latency.This transfer uses a data pipe.
  • Bulk Transfers Used for large data transfers that use all available USB bandwidth with no guarantee on transfer speed or latency.This transfer uses a data pipe.
  • Isochronous Transfers Used for data that requires a guaranteed data delivery rate.Isochronous transfers are capable of this guaranteed delivery time due to their guaranteed latency, guaranteed bus bandwidth, and lack of error correction.Without the error correction, there is no halt in transmission while packets containing errors are resent.This transfer uses a data pipe.
 
Every device has a control pipe and it is through this pipe that control transfers to send and receive messages from the device are performed.Optionally, a device may have data pipes for transferring data through interrupt, bulk, or isochronous transfers.The control pipe is the only bidirectional pipe in the USB system.All the data pipes are unidirectional.Each endpoint is accessed with a device address (assigned by the host) and an endpoint number (assigned by the device).When information is sent to the device the device address and endpoint number are identified with a token packet.The host initiates this token packet before a data transaction.

When a USB device is first connected to a host, the USB enumeration process is initiated.Enumeration is the process of exchanging information between the device and the host that includes learning about the device.Additionally, enumeration includes assigning an address to the device, reading descriptors (which are data structures that provide information about the device), and assigning and loading a device driver.This entire process can occur in seconds.Once this process is complete, the device is ready to transfer data to the host.Two files are affiliated with enumeration and the loading of a driver.These files are the INF and SYS file, and they exist on the host side.

 
After a device has been enumerated, the host directs all traffic flow to the devices on the bus.When implementing USB in a PSoC, all you need to do is configure the USB Full Speed component as described in the component data sheet, and then use the Cypress provided API’s to load data into an IN endpoint and take data out of an OUT endpoint.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值