Instruction manual

Renesas USB MCU and USB ASSP USB Basic Host and Peripheral firmware
R01AN0512EJ0210 Rev.2.10 Page 81 of 157
Apr 1, 2013
5.3.3 HCD API
A HDCD module will implement hardware control requests by using the following HCD API. The return values of each
API function are scheduler macro error codes. A list of HCD API functions is shown in
Table 5.2. 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 5.2 List of HCD API Functions
Function Name Description
R_usb_hstd_TransferStart() Data transfer request
R_usb_hstd_TransferEnd() Data transfer forced end request
R_usb_hstd_ChangeDeviceState() USB device state change request
Non-ANSI
R_usb_hstd_MgrChangeDeviceState() Connected device state change request
R_usb_hstd_SetPipeRegistration() Pipe configuration setting request
R_usb_hstd_HcdTask() HCD Task
R_usb_hstd_MgrTask() MGR Task
R_usb_hstd_DriverRegistration() Register HDCD
R_usb_hstd_DriverRelease() Release HDCD
R_usb_hstd_SetPipeInfo() Set of pipes information
R_usb_hstd_DeviceInformation() Fetch the state of a connected peripheral
R_usb_hstd_ChkPipeInfo Create pipe information from endpoint descriptor
R_usb_hstd_ReturnEnuMGR() Enumeration continuation request (non-OS only)
R_usb_hstd_EnuWait() Enumeration priority update request (non-OS only)
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
R_usb_cstd_SetRegPipeCtr() Set the value of PIPExCTR register
R_usb_hstd_HcdOpen() Start HCD Task
R_usb_hstd_HcdClose() End HCD Task
R_usb_hstd_MgrOpen() Start MGR Task
ANSI & Non-ANSI
R_usb_hstd_MgrClose() End MGR Task
[Note]
1. If the 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 used
2. The user can always call the functions in the "ANSI & Non-ANSI" field . These functions are not related to
ANSI 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".