Instruction manual
Renesas USB MCU and USB ASSP USB Basic Host and Peripheral firmware
R01AN0512EJ0210 Rev.2.10 Page 17 of 157
Apr 1, 2013
4. Peripheral
4.1 Peripheral Control Driver (PCD)
4.1.1 Basic functions
PCD is a program for controlling the hardware. PCD analyzes requests from PDCD (not part of the USB-BASIC-F/W)
and controls the hardware accordingly. It also sends notification of control results using a user provided call-back
function. PCD also analyzes requests from hardware and notifies PDCD accordingly.
PCD accomplishes the following:
1. Control transfers. (Control Read, Control Write, and control commands without data stage.)
2. Data transfers. (Bulk, interrupt) and result notification.
3. Data transfer suspensions. (All pipes.)
4. USB bus reset signal detection and reset handshake result notifications.
5. Suspend/resume detections.
6. Attach/detach detection using the VBUS interrupt.
7. Hardware control when entering and returning from the clock stopped (low-power sleep mode) state.
4.1.2 Issuing requests to PCD
API functions are used when hardware control requests are issued to the PCD and when performing data transfers. API
functions and library functions can be used to obtain information for managing PCD.
In response to a request from an upper layer task, PCD sends a result notification by means of a call-back function.
PCD has no API functions for class/vendor requests.
4.1.3 USB requests
The following standard requests are supported by PCD.
• GET_STATUS
• GET_DESCRIPTOR
• GET_CONFIGURATION
• GET_INTERFACE
• CLEAR_FEATURE
• SET_FEATURE
• SET_ADDRESS
• SET_CONFIGURATION
• SET_INTERFACE
PCD answers requests other than the above with a STALL response.
When the PCD receives one of the above standard requests, it executes the functions listed in
Table 4-1 according to the
control transfer stage.
Note that, if the received USB request is a device class request or a vender class request, the user needs to create a
program to judge these requests and register the program in the driver.
The following shows the peripheral processes available for the control transfer stage, based on the standard request
received from a host.
Control read : When a valid request is received, data for transmission to the host is
generated, and written to the FIFO
Control write :
When a valid request is received, enables data reception from the host.
Data-less control command : When a valid request is received, returns the status.
Control read status stage : Receives the status from the host.
Control write status stage : Returns the status to the host.
Control transfer end : Sends notification to PDCD of a request received from host.
Actual functions used are shown in the table below.