*** Welcome to piglix ***

USB OTG


USB On-The-Go, often abbreviated to USB OTG or just OTG, is a specification first used in late 2001 that allows USB devices, such as tablets or smartphones, to act as a host, allowing other USB devices, such as USB flash drives, digital cameras, mice or keyboards, to be attached to them. Use of USB OTG allows those devices to switch back and forth between the roles of host and device. For instance, a mobile phone may read from removable media as the host device, but present itself as a USB Mass Storage Device when connected to a host computer.

In other words, USB OTG introduces the concept of a device performing both master and slave roles – whenever two USB devices are connected and one of them is a USB OTG device, they establish a communication link. The device controlling the link is called the master or host, while the other is called the slave or peripheral.

Standard USB uses a master/slave architecture; a host acts as the master device for the entire bus, and a USB device acts as a slave. If implementing standard USB, devices must assume one role or the other, with computers generally set up as hosts, while (for example) printers normally function as slaves. In the absence of USB OTG, cell phones often implemented slave functionality to allow easy transfer of data to and from computers. Such phones, as slaves, could not readily be connected to printers as they also implemented the slave role. USB OTG directly addresses this issue.

When a device is plugged into the USB bus, the master device, or host, sets up communications with the device and handles service provisioning (the host's software enables or does the needed data-handling such as file managing or other desired kind of data communication or function). That allows the devices to be greatly simplified compared to the host; for example, a mouse contains very little logic and relies on the host to do almost all of the work. The host controls all data transfers over the bus, with the devices capable only of signalling (when polled) that they require attention. To transfer data between two devices, for example from a phone to a printer, the host first reads the data from one device, then writes it to the other.


...
Wikipedia

...