@CHIP-RTOS C Library V2.06 - USB API
Header File: #include <USB_API.H>
This documentation describes the low-level software-interrupt-based
API of the IPC@CHIP® RTOS dual-mode USB-driver. The SC123/SC143
disposes of a USB-controller that is compliant with the
USB specification version 1.1.
Though the USB-API hides much of the complexity of the USB, one should
fly over the specification to get a grasp of how USB works.
We also recommend to take notice of the
Requirements and Recommendations for USB Products with Embedded
Hosts and/or Multiple Receptacles.
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 SC123/SC143
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
it.)
- 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
uncommon.
In Host mode a device may also have a different number of
endpoints and different transfer types in Alternate Settings.
Common Functions
Device mode only Functions
Host mode only Functions
Topics
List of C Libraries
@CHIP-RTOS Main Index
End of document
|