Instruction manual
Renesas USB MCU and USB ASSP USB Basic Host and Peripheral firmware
R01AN0512EJ0210 Rev.2.10 Page 117 of 157
Apr 1, 2013
5.8.4 The USB Communication Structure (USB_UTR_t)
The structure used for Control and data transfer is described below. USB communications with the connected device are
enabled by notifying HCD of the following structure members.
Members of USB_UTR_t Structure are shown in
Table 5.10.
Table 5.10 USB Communication Structure members
and description for use with host
Type Variable Name Description
USB_MH_t msghead The message header is used by the OS.
Not to be used by the application.
uint16_t msginfo Specifies the request content.
Specifies USB-BASIC-FW using an API function.
Specifies USB_MSG_HCD_SUBMITUTR for USB communication.
uint16_t keyword
Please register sub information, including a port number, a pipe
number, etc.
A pipe number is specified when performing USB communication.
USB_REGADR_t ipp Register the address of USB IP.
uint16_t ip Register the number of USB IP.
uint16_t result Store the USB communication result.
USB_CB_t complete Callback function
Specifies the address of the function to be executed when USB
transfer ends. Use the following type declaration for the call-back
function.
typedef void (*USB_CB_t)(USB_UTR_t *);
void *tranadr
Buffer address for transfer data; where to read data to send, or
where to write receive-data.
uint32_t tranlen
Specifies nr of bytes to transfer when transmitting, and provides
information on nr bytes received when receiving. Specify a transfer
size smaller than the user buffer size.
uint16_t *setup Setup packet data.
Requests a setup packet for control transfer to HCD and provides
notification of the device address.
Only used for control transfer
uint16_t status USB communication status.
HCD returns the USB communication result.
Refer to "4.7.2 Notice of a transmission result."
uint16_t pipectr PIPEnCTR register.
HCD returns the PIPEnCTR register information for pipe n. When
using one pipe for two endpoints, specify the transfer toggle state
for the endpoint when continuing the communication.
uint8_t errcnt Stores the number of errors that occur during transfer.
uint8_t segment Segment information.
Provides notification of transfer continuation/end.
int16_t fn File number.
Sets file number when the ANSI IO API is used.
void *usr_data Sets each type of data.