Instruction manual

Renesas USB MCU and USB ASSP USB Basic Host and Peripheral firmware
R01AN0512EJ0210 Rev.2.10 Page 35 of 157
Apr 1, 2013
R_usb_pstd_TransferEnd
Data transfer forced end request
Format
USB_ER_t R_usb_pstd_TransferEnd(USB_UTR_t *ptr, uint16_t pipe, uint16_t status)
Arguments
*ptr Pointer to a USB transfer structure
pipe Pipe number
status USB communication status
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 forces data transfer via the specified pipe to end.
The function executes a data transfer forced end request to the PCD. After receiving the request, the PCD executes
the data transfer forced end request processing.
When a data transfer is forcibly ended, the function calls the call-back function set in “R_usb_pstd_TransferStart” at
the time the data transfer was requested. The information of the remaining transmit/receive data length, status, error
count and transfer end is set in the parameter of this call-back.
Note
1. Besides above arguments, also set the following members of the USB Transfer Structure.
USB_REGADR_t ipp USB register base address
uint16_t ip USB IP number
2. Call this function from the user application or class driver.
3. This function is not necessary when using an ANSI IO API.
Example
void usb_smp_task(USB_UTR_t *ptr)
{
uint16_t status;
uint16_t pipe;
pipe = USB_PIPE1;
status = USB_DATA_STOP;
/* Transfer end request */
err = R_usb_pstd_TransferEnd(ptr, pipe, status);
return err;
}