How to configure and use OTG / USB
Detection of connected device
is automatic. It can distinguish between connection to a host computer (client mode) or USB charger and a USB host cable (an adapter cable that pulls down the ID pin).
You can read the status of the connection through
USB charge pump
For powering external devices, a built in charge pump can provide 5V with up to 100 mA. This should be sufficient for typical memory devices but is not enough for others (WiFi stick, UMTS stick). In that case you need an Y cable and a external power supply.
configuring Ethernet Gadget (IP over USB)
This mode allows to connect the device as a client to a host computer and use that to forward IP traffic.
configuring mass storage mode
This mode allows to connect the device to a host and make it be recognized as a mass storage device.