Instruction manual

Renesas USB MCU and USB ASSP USB Basic Host and Peripheral firmware
R01AN0512EJ0210 Rev.2.10 Page 30 of 157
Apr 1, 2013
4.2.3 PCD API
A PDCD module (USB class driver) implements hardware control requests by using the PCD API.
The return values of each API function are scheduler macro error codes. A list of PCD API functions is shown in
Table
4-3. Any of the functions can be used with the non-ANSI interface. When compiling “with ANSI”, the first part of the
table should not be used in the user application
Table 4-3 List of PCD API Functions
Function Description
R_usb_pstd_TransferStart() Data transfer execution request
R_usb_pstd_TransferEnd() Data transfer forced end request
R_usb_pstd_PcdChangeDeviceState() USB device state change request
Non-ANSI *1)
R_usb_pstd_DeviceInformation() Get USB device state information
R_usb_pstd_PcdOpen() Start the PCD task
R_usb_pstd_PcdClose() End the PCD task
R_usb_pstd_DriverRegistration() Register the PDCD
R_usb_pstd_PcdTask() The PCD Task
R_usb_pstd_ControlRead() FIFO access execution request for control read
transfer
R_usb_pstd_ControlWrite() FIFO access execution request for control write
transfer
R_usb_pstd_ControlEnd() Control transfer end request
R_usb_pstd_SetStall() Set STALL to PID of PIPE that is specified by
argument and the callback function is called.
R_usb_pstd_SetPipeStall() Set STALL to PID of PIPE that is specified by
argument.
R_usb_cstd_GetUsbIpAdr() Get USB register base address
R_usb_cstd_UsbIpInit()
Initialize USB module
R_usb_cstd_ClearHwFunction() USB-Related Register Initialization Request
R_usb_cstd_SetRegDvstctr0()
Set the value to DVSTCTR0 register
ANSI & Non-ANSI
R_usb_cstd_SetRegPipeCtr() Set the value of PIPExCTR register
[Note]
1. If user selects USB_ANSIIO_USE_PP in the r_usb_usrconfig.h file, the user should not call the functions
described in Non-ANSI field above in the user application.
Example (r_usb_usrconfig.h)
#define USB_ANSIIO_PP USB_ANSIIO_USE_PP ;ANSI I/F
2. User can always call the functions of the "ANSI & Non-ANSI" field . These functions are not related to "Select
ANSI Interface" setting.
The ANSI-type interface described previously is recommended for new projects. Please refer to "
4.9.2 User
Configuration File - r_usb_usrconfig.h" about selecting “ANSI Interface".