Instruction manual
Renesas USB MCU and USB ASSP USB Basic Host and Peripheral firmware
R01AN0512EJ0210 Rev.2.10 Page 33 of 157
Apr 1, 2013
R_usb_pstd_TransferStart()
Data transfer request
Format
USB_ER_t R_usb_pstd_TransferStart(USB_UTR_t *ptr)
Arguments
*ptr Pointer to a USB Transfer Structure
Return Value
[non-OS]
USB_E_OK Success
USB_E_ERROR Failure
[RTOS]
- Error code. Please refer to RI600/4 User's manual for RX family Real-time OS.
Description
This function transfers data via the pipe.
This function executes data transfer requests to the PCD. After receiving the request, PCD executes the data transfer
processing based on the transfer information stored in the USB Transfer Structure. Besides above arguments, also set
the following information of this structure:
USB_MH_t msghead : Set to NULL
uint16_t keyword : Pipe number
void* tranadr : Start address of the data buffer
uint32_t tranlen : Data transfer size
uint16_t setup : Set to 0 (zero)
USB_CB_t complete : Pointer to call-back function
uint8_t segment : Status
USB_REGADR_t ipp : USB register base address
uint16_t ip : USB IP number
When data transfer ends (specified data size reached, short packet received, error occurred), the Transfer Structure’s
call-back function is executed. The remaining transmit/receive data length, status, error count and transfer end is set
as the parameters of this call-back function. Please refer to
Table 4-4 R_usb_pstd_TransferStart call-back” about the
call-back function.
Note
Call this function from the user application or class driver.
1. This function is not necessary when using the ANSI IO API.
2. The structure members indicated by the argument include pipe number, transfer data start address, transfer
data length, status, call-back function at end, etc.
3. When the received data is n times of the maximum packet size and less than the expected received data
length, it is considered that the data transfer is not ended and a callback is not generated.