Download USB Basic Mini Firmware
Transcript
Renesas USB MCU
USB Basic Mini Firmware
R_usb_pstd_TransferEnd
Data transfer forced end request
Format
usb_er_t
R_usb_pstd_TransferEnd(usb_pipe_t pipe, usb_strct_t_t msginfo)
Arguments
pipe
msginfo
Pipe number
Communication status
Return Value
USB_E_OK
USB_E_ERROR
USB_E_QOVR
Success
Failure, argument error
Overlap (transfer end request for the pipe during transfer end)
Description
Set the following values to the argument msginfo.
USB_DO_TRANSFER_STP: Data transfer forced end
USB_DO_TRANSFER_TMO: Data transfer timeout (The PCD does not call back.)
The transfer end is notified to UPL using the callback function set when the data transfer was requested with
R_usb_pstd_TransferStart The callback will signal forced end with msginfo=USB_DO_TRANSFER_STP. The
remaining data length of transmission and reception, pipe control register value, and transfer status =
USB_DATA_STOP are available in the argument of the callback (usb_utr_t). When a forced end request is issued to
a pipe is not executing any data transfer, USB_E_QOVR is returned.
Notes
1. When data transmission is suspended, the FIFO buffer of the SIE is not cleared.
When the FIFO buffer is transmitted using double buffer, the data that has not been transmitted yet may remain in
the FIFO buffer.
2. When the argument pipes are Pipe 0 to Pipe 3, USB_E_QOVR error is returned and the USB_E_ERROR error is
returned for Pipe 8 or higher in RL78/USB.
Example
void usb_smp_task(void)
{
R_usb_pstd_TransferEnd(USB_PIPE4, USB_DO_TRANSFER_STP);
}
R01AN0326EJ0213 Rev. 2.13
Mar 16, 2015
Page 38 of 107