Instruction manual
Renesas USB MCU and USB ASSP USB Basic Host and Peripheral firmware
R01AN0512EJ0210 Rev.2.10 Page 69 of 157
Apr 1, 2013
5. Host
5.1 Host Control Driver (HCD)
HCD is a program for controlling the hardware. The functions of HCD are shown below.
1. Control transfer (Control Read, Control Write, No-data Control) and result notification.
2. Data transfer (bulk, interrupt) and result notification.
3. Data transfer suspension (all pipes).
4. USB communication error detection and automatic transfer retry
5. USB bus reset signal transmission and reset handshake result notification.
6. Suspend signal and resume signal transmission.
7. Attach/detach detection using ATCH and DTCH interrupts.
8. Hardware control when entering and returning from the clock stopped (low-power sleep mode) state.
(Only R8A66597)
5.1.1 Issuing Requests to HCD
The API functions described below are used by a higher level task (the HDCD or APL) to issue hardware control
requests to HCD. Only HCD may directly control the hardware. For requests to update the state of the connected devices
(Powered, Address, Configured state etc), control may be exercised by HCD either directly or via a USB hub. MGR
determines the device address and issues control requests to the HCD and HUBCD tasks.
In response to a request from upper layer task, HCD sends a result notification by means of a call-back function.
The following points must be considered when using HCD to perform USB communication.
1. Bus possession rate and pipe contention
HCD can perform communication with multiple devices. However, HCD does not calculate the USB bus possession rate
or check for contention between the communication pipes used by HDCD tasks.
When multiple HDCD devices are installed, modifications must be made to prevent contention between pipes. Also note
that the HUBCD provided in the USB-BASIC-F/W uses pipe 9, which may affect operations when using HUBCD in the
user system.
2. Installation of multiple HDCD (class drivers)
Two or more devices and communication are possible using HCD, but MGR cannot proceed with enumeration of
multiple devices simultaneously. The application will have to keep track of the communication if several devices are
running. Enumeration of another device should be avoided until the enumeration of the previously connected device
finishes.
5.2 Host Manager (MGR)
MGR is a task that supplements the functions of HCD and HDCD. The functions of MGR are shown below.
1. Registration of HDCD.
2. State management for connected devices.
3. Enumeration of connected devices.
4. Searching for endpoint information from descriptors.