Instruction manual

Renesas USB MCU and USB ASSP USB Basic Host and Peripheral firmware
R01AN0512EJ0210 Rev.2.10 Page 87 of 157
Apr 1, 2013
R_usb_hstd_ChangeDeviceState
USB device state change request
Format
USB_ER_t R_usb_hstd_ChangeDeviceState (USB_UTR_t *ptr,
USB_CB_t complete,
uint16_t msginfo,
uint16_t member)
Argument
*ptr Pointer to USB transfer structure
complete Call-back function
msginfo USB communication status
member Port number
Return Value
non-OS
USB_E_OK Success
USB_E_ERROR Failure
RTOS
Error code. Please refer to RI600/4 User's manual for RX family Real-time OS.
Description
This function changes the device state. Change of USB device state is done by HCD after calling this function.
The following is a list of values that may be used for msginfo.
msginfo Outline
USB_MSG_HCD_ATTACH Request to change to connection state
USB_MSG_HCD_DETACH
Request to change to disconnection state from connection
state
USB_MSG_HCD_USBRESET Request to execute USB reset
USB_MSG_HCD_SUSPEND Request to change to suspend state
USB_MSG_HCD_RESUME Request to execute resume signal
USB_MSG_HCD_REMOTE
Request to change to suspend with remote wakeup enabled
state
USB_MSG_HCD_VBON VBUS supply start request
USB_MSG_HCD_VBOFF VBUS shutdown request
USB_MSG_HCD_CLR_STALL Request to clear STALL
Note
1. Besides above arguments, also set the following members of the USB Transfer Structure before calling the
function.
USB_REGADR_t ipp USB register base address
uint16_t ip USB IP number
2. Call this function from the user application or class driver.
3. This function is not necessary when using an ANSI IO API.