Instruction manual

Renesas USB MCU and USB ASSP USB Basic Host and Peripheral firmware
R01AN0512EJ0210 Rev.2.10 Page 41 of 157
Apr 1, 2013
R_usb_pstd_ControlRead
FIFO access request for control read transfer
Format
uint16_t R_usb_pstd_ControlRead(USB_UTR_t *ptr, uint32_t bsize, uint8_t *table)
Arguments
*ptr Pointer to a USB transfer structure, containing pipe number, read size, etc
bsize Transmit data buffer size
*table Pointer to transmit data buffer address.
Return Value
end_flag Data transfer result
Description
During a control IN transfer, this function issues a FIFO access execution request to PCD during the data stage.
PCD reads data from the area referenced by the argument (table) and writes it to the FIFO buffer of the hardware.
This function returns the following result as return value.
USB_WRITESHRT
Data write end (short packet data write)
USB_WRITEEND
Data write end (no additional data/transmission of packet with data length 0
USB_WRITING
Data write in progress (additional data present)
USB_FIFOERROR
FIFO access error
Note
1. Besides above arguments, also set the following members of the USB Transfer Structure before calling this
function.
USB_REGADR_t ipp USB register base address
uint16_t ip USB IP number
2. Please call this function at the control IN transfer data stage. Please refer to
4.4 Peripheral Control Transfer.
Example
void usb_smp_task(USB_UTR_t *ptr)
{
R_usb_pstd_ControlRead(ptr, (uint32_t)1, (uint8_t*)(& usb_smp_buf));
}