The USB-driver can be used in Device mode to implement a USB device
(resp. function) which will then be connected to e.g. a PC-Host; or
it can be used in Host mode. In this case USB devices can be
connected to the IPC@CHIP® handled by device-specific drivers that
use the USB-API.
The RTOS USB-driver can operate in only one mode at a time. To
implement a USB Function (Device) using this API, an additional
circuit is needed, which manages attach- and speed-detection. A
diagram is included in the hardware manual of the SC1x3/SC2x
showing how to prepare your hardware to operate in both modes.
Any PIO can be used to control this circuit. The API switches the
PIO as needed.
Please note that there's no Hub support in Host mode and that
there are some restrictions regarding data structures handled by
the RTOS USB-driver necessary to keep the driver small and fast.
These mainly concern Configurations, Interfaces and Alternate
Settings. These restrictions should not constrain you much when
implementing a USB-device and most devices connected to an IPC@CHIP®
operating in Host mode will fulfil the conditions too.
There can only be one Configuration. (It is uncommon to use
more than one Configuration though the specification allows
There can be at most 10 Interfaces.
Each interface can have maximal 12 alternate settings.
Alternate settings in Device mode can only be used to alter
the maximum packet size and the polling interval of its
assigned endpoints. It is impossible to change e.g. the
number of assigned endpoints. This would also be very
In Host mode a device may also have a different number of
endpoints and different transfer types in Alternate Settings.