Instruction manual
Renesas USB MCU and USB ASSP USB Basic Host and Peripheral firmware
R01AN0512EJ0210 Rev.2.10 Page 119 of 157
Apr 1, 2013
5.8.6 Notes on Data Reception
Use a transaction counter for the receive pipe.
When a short packet is received, the expected remaining receive data length is stored in tranlen of USBC_UTR_t
structure and transfer ends. When the received data exceeds the buffer size, data read from the FIFO buffer up to the
buffer size and transfer ends. When the user buffer area is insufficient to accommodate the transfer size, the
usb_cstd_DataEnd() function may clear the receive packet in some cases.
When using DTC, the buffer size must be an integral multiple of the maximum packet size.
5.8.7 Data Transfer Overview
The following shows an overview of data transfer using a transmission as an example.
1. With ANSI Interface
(1). After open processing is complete, control() is used to set the call-back function in the APL.
(2). write() is called and data transfer request executed.
(3). After data transfer is complete the call-back function “complete” that was set in (1) is called and the transfer results
are notified to HDCD. (See
5.8.2, Notice of a transmission result .)
2. non-ANSI Interface
(1). Transfer status is set by the APL or HDCD in the USB_UTR_t structure members listed below.
keyword: Pipe number
tranadr: Data buffer
tranlen: Transfer length
segment: USB_TRAN_END
complete: The callback function performed at the time of the end of data transfer
(2). R_usb_hstd_TransferStart() is called and data transfer request executed.
(3). After data transfer is complete, the call-back function “complete” that was set in (1) is called and the transfer results
are notified to HDCD. (See
5.8.2, Notice of a transmission result.)