Instruction manual

Renesas USB MCU and USB ASSP USB Basic Host and Peripheral firmware
R01AN0512EJ0210 Rev.2.10 Page 55 of 157
Apr 1, 2013
4.5.3 The USB Communication Structure (USB_UTR_t
The following describes the structure members used for data transfer.
USB communication with a connected host or peripheral device, with the exception of control transfer during peripheral
operation, can be accomplished by notifying the following structure to PCD.
Table 4-9 shows the members of the USB Transfer Structure.
Table 4-9 USB Communication Structure members
and description for use with peripheral
Type Member Description
USB_MH_t msghead
This message header is used by the OS (or non-OS messaging
system). It should not be used by the application.
uint16_t msginfo Message type.
Specifies the request contents.
Specifies USB-BASIC-FW using an API function.
Specifies USB_MSG_PCD_SUBMITUTR for USB communication
uint16_t keyword Sub-code
Specifies the pipe number or the port number etc for USB
communication
USB_REGADR_t ipp Set USB IP base address
uint16_t ip Set USB IP number
uint16_t result
Result of USB transfer. Set by PCD/HCD.
USB_CB_t complete Callback function.
Specifies the address of the function to be executed when USB
communication ends. Use the following type declaration for the
call-back function.
typedef void (*USB_CB_t)(USB_UTR_t*);
void *tranadr USB communication buffer address
Provides notification of the USB communication buffer address.
uint32_t tranlen USB communication data length.
Specify a transfer size smaller than the user buffer size.
uint16_t *setup Not used in USB peripheral mode.
uint16_t status USB communication status
PCD/HCD returns the USB communication result.
Please refer to "
4.5.2 Notification of transfer result".
uint16_t pipectr PIPECTR register.
PCD returns the PIPECTR register content.
PCD specify the transfer start toggle state for continuous
communication.
uint8_t errcnt Stores the number of errors that occurred during transfer.
uint8_t segment Segment information
Provides notification of transfer continuation/end.
int16_t fn File number.
Only for the ANSI-type interface.
void *usr_data Set the variety information.
Additional Communication Structure details for peripheral
1. Buffer address for USB communication (tranadr)
Reception or ControlRead transfer: Specifies the address of the buffer for storing receive data.
Transmission or ControlWrite transfer: Specifies the address of the buffer for storing transmit data.
NoDataControl transfer: Ignored if specified.