Instruction manual

Renesas USB MCU and USB ASSP USB Basic Host and Peripheral firmware
R01AN0512EJ0210 Rev.2.10 Page 36 of 157
Apr 1, 2013
R_usb_pstd_PcdChangeDeviceState
USB peripheral device state change request
Format
USB_ER_t R_usb_pstd_PcdChangeDeviceState (USB_UTR_t *ptr, uint16_t state, uint16_t port_no,
USB_CB_INFO_t complete)
Arguments
*ptr Pointer to a USB Transfer Structure
state Device state to be transitioned to
port_no Port number
complete Call-back function executed at end of PCD processing
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 sends a request to the PCD to change the USB device state by setting one of the following values of
argument “state”, and then call the ‘complete’ call-back function.
USB_DO_REMOTEWAKEUP
Remote wakeup execution request to PCD
USB_DP_ENABLE
D+ line pull-up request to PCD
USB_DP_DISABLE
D+ line pull-up cancel request to PCD
USB_DO_STALL
STALL response execution request to PCD.
Note
1. Besides above arguments, also set the following members of the USB Transfer Structure.
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. If connected/disconnected interrupt is detected, a D+ line pull-up cancel is executed automatically by
firmware.
4. This function is not necessary when using the ANSI IO API